Question about estimation

  1. You should simply initialize every constant at 0.
  2. No, you need to leave the previous steady state and just add the steady state for the newly added variables.
  3. By having a separate constant parameter estimated in each observation equation.

Many thanks for reply. First, I’ve set the constants to 0 and added equations to the previous steady state.

Second, I’m not sure how to have a separate constant parameter in each observation equation. Does this mean I can’t have repeated ā€œctrendā€ in several equations?

The error message I obtain is in the attachemnt. Thanks.
Model.mod (3.4 KB)

It should be like the attached: Model1113.mod (3.5 KB)

Perfect, the code seems to work now, even though I obtain an error message that my Hessian matrix is not positive definite:

OPTIMIZATION PROBLEM!
(minus) the hessian matrix at the ā€œmodeā€ is not positive definite!
ᨀLog data density [Laplace approximation] is NaN.
error: chol: input matrix must be positive definite

How would I run Random Walk Metropolis-Hastings logarythm now? According to Dynare Reference Manual: 4.14 Estimation, I should use command:

posterior_sampling_method='random_walk_metropolis_hastings'

Does this mean I can add the line above as an option to estimation command? Thank you.

If mh_replic>0, the RW-MH will automatically start if you get a positive definite Hessian matrix.

Okay, I already have mh_replic=250000. Could you please confirm if my RW-MH runs correctly? I still obtain some error messages, although the process seems to run smoothy regardless. Thank you!
Model.mod (3.5 KB)

You did not declare endogenous variables after the estimation/calib_smoother command.
warning: Some of the parameters have no value (lne, lnz) when using initial_estimation_checks
. If these parameters are not initialized in a steadystate file or a steady_state_model-block
, Dynare may not be able to solve the model. Note that simul, perfect_foresight_setup, and pe
rfect_foresight_solver do not automatically call the steady state file.

As shown in the manual, you need to pick a number for mh_replic, e.g. mh_replic=100000.

Okay, I already have mh_replic=250000. Could you please confirm if my RW-MH runs correctly? I still obtain some error messages, although the process seems to run smoothy regardless. Thank you!
Model.mod (3.5 KB)

You did not declare endogenous variables after the estimation/calib_smoother command.
warning: Some of the parameters have no value (lne, lnz) when using initial_estimation_checks. If these parameters are not initialized in a steadystate file or a teady_state_model-block, Dynare may not be able to solve the model. Note that simul, perfect_foresight_setup, and perfect_foresight_solver do not automatically call the steady state file.

warning: gmhmaxlik: Unknown option (MaxIter)!
warning: called from
gmhmaxlik at line 59 column 13

Those are warnings you can ignore.

1 Like

Perfect, after almost a year my file finally works, thanks to you! Many thanks for providing help for free without charging students!

Dear professor,

I have to compute full sample maximum likelihood estimates of the parameters, as well as standard errors, using parametric bootstrapping procedure. I can’t find any examples of this on the forum and my RW-MH algorithm computes only estimates of certain parameters. Could you please advise me how to write the code? Thanks.

Model.mod (3.5 KB)

I am not sure I understand the point. If you find a valid mode, you can do a Laplace approximation at the mode to obtain the standard errors at the mode for the estimated parameters.

Here is the paper that I am trying to replicate, please see pages 12/27 and 13/27.
Jerger Roehe 2011.pdf (261.6 KB)

I’m not sure how to do Laplace approximation, I followed this link: Laplace approximation - #2 by MichelJuillard
and set mh_replic=0, however I still obtain only estimates of 8 parameters, please see printscreen attached.

  1. If you really want to follow that paper, you need to program it yourself by simulating the model after estimation and then estimating the model again on that simulated data.
  2. You only estimate 8 parameters, of course you only get results for 8 parameters.
  1. Thank you, regarding parameters, on page 13/27 that paper includes also e and z as parameters, although they’re variables. I obtain error messages, if I include them in the parameter section. How would I estimate these ā€œparametersā€?

  2. Regarding simulating the model, that paper refers to Ireland 2007 paper, that uses Kalman filtering for simulation. So, can I use command for Kalman filter: lik_init = INTEGER from Dynare manual page 74/223? Thank you.

Model.mod (3.8 KB)

I don’t know what is going on in the paper. The estimation results look strange. The HP filtering of the data (which is a no-go) should demean the observed series. Estimating the means of the exogenous processes should be impossible then.,

So if HP filtering is a no-go, I’m not supposed to do HP filtering that you recommended and I can simply use raw observations data?

The authors of the paper quote De Jong, who emphasised need to do HP filtering on page 10/32:

De Jong ch3.pdf (475.4 KB)

It depends on what you are using the HP filter for. You are not supposed to use it for estimating data with a Kalman filter. See e.g.

Okay, thanks, so one-sided HP filter is also a no-go, although you claim on your link that it can be used for estimation unlike two-sided filter?

The two-sided HP filter is a problem for estimation, not the one-sided one. The standard two-sided HP filter violates the causality, i.e. time-ordering, underlying the recursive state space solution of the model.