Econometrics
- This set of methods is concerned with inference about an
MomentOpt.MAlgoBGP
- This is mostly standard GMM technology
MomentOpt.FD_gradient
— Method.FD_gradient(m::MProb,p::Dict;step_perc=0.005,diff_method=:forward)
Get the gradient of the moment function wrt to some parameter vector via finite difference approximation. The output is a (k,n) matrix, where $k$ is the number of m.params_to_sample
and where $m$ is the number of moments.
step_perc
: step size in percent of parameterdiff_method
::forward
or:central
differencinguse_range
: compute the step as a percentage of the parameter range (true
), or not
The default step size is 1% of the parameter range.
MomentOpt.getSigma
— Method.getSigma(m::MProb,p::Union{Dict,OrderedDict},reps::Int)
Computes var-cov matrix of simulated data. This requires to unseed the random shock sequences in the objective function (to generate randomly different moments in each run). Argument reps
controls how many samples of different moment functions should be taken.
MomentOpt.get_stdErrors
— Method.get_stdErrors(m::MProb,p::Union{Dict,OrderedDict};reps=300)
Computes standard errors according to standard sandwich formula:
\[S = (J W J')^{-1} (J W \Sigma W J') (J W J')^{-1}\]
where
- $\Sigma$ is the data var-cov matrix generated by drawing H samples of simulated data using p. each draw has a different shock sequence here. this is done in function
getSigma
. - $J$ is the gradient of the objective function obtained with
FD_gradient
- $W$ is the weighting matrix.