Estimation VS Simulation

Hello

I have tried to build a very simple Nk-DSGE model, the simulation seems work however it gives error when i bring to estimation, I have attached both code files and small data set, if you please have a look.

Regards

Ali
DATA.xls (16.7 KB)
Simulation.mod (6.29 KB)
Estimation.mod (6.52 KB)

Which error do you mean? You should not name your datafile just data and specify xls_range=B1:B285. Finally, you did not specify any estimated_params.

Thanks you very much indeed for kind reply and identification of my mistakes. I have included estimated_params, the file name has also been changed to “Stock” with only one observable variable S. however it gives error about the steady state, although the initial values for steady state are same which I used for simulation. I have attached the file with data series, if you please have a look. I am stuck and requested several people for help but only you have replied. I would be very grateful if you please help me once again.

Regards and best wishes
Stock.xls (12.9 KB)
Estimation.mod (7.43 KB)

You did not provide starting values for the estimated parameters, hence the prior mean is taken and the SS values cannot be computed. Your initial value

h=(alp/cy*(1-varrho)/varrho)/(1+(alp/cy*(1-varrho)/varrho));
depends on cy, which itself depends on alp, which is estimated and changes in every iteration. Hence, cy should not be a parameter, but an expression that depends on other parameters, i.e. use the # operator inside the model block.

Moreover, provide the calibrated values as starting values.

Thank you very much for reply, I really appreciate your kindness. I have act on your advice , it gives some calculation, however at end it gives again some error. could you please have another look whenever its convenient to you, I am aware that I am bothering you too much but I am really stuck and not getting help from somewhere else :frowning: .

many thanks and best wishes
Stock.xls (12.9 KB)
Estimation3.mod (7.77 KB)

Please always post the error message. If you are referring to the message that the Hessian is not positive definite, please search the forum. There are dozens of posts. The short answer is: use mode_compute=6

Thank you very much again for reply and please accept my apology for not putting error, Actually It gave me some results on posterior parameters( tough without diagram) but did not get anything about observable variable. The error it display are mostly about steady state …

SOLVE: maxit has been reached

Log data density [Laplace approximation] is NaN.
SOLVE: maxit has been reached
??? Attempted to access SteadyState(37); index out of bounds because
numel(SteadyState)=0.

Error in ==> DsgeSmoother at 80
constant = SteadyState(bayestopt_.mfys);

Error in ==> dynare_estimation_1 at 920
[atT,innov,measurement_error,updated_variables,ys,trend_coeff,aK,T,R,P,PK,decomp]
=
DsgeSmoother(xparam1,dataset_.info.ntobs,dataset_.data,dataset_.missing.aindex,dataset_.missing.state);

Error in ==> dynare_estimation at 70
dynare_estimation_1(var_list,dname);

Error in ==> Estimation3 at 367
dynare_estimation(var_list_);

Error in ==> dynare at 120
evalin(‘base’,fname) ;

look forward to your kind response with best wishes

Ali

Apparently, Dynare has trouble finding the posterior mode. You can try a different mode-finder or tighter priors (also check if the data and the observation equations are consistent). Also, if you have not done so already, upgrade to Dynare 4.3. I think, I got a more explicit error message directly after the posterior parameters telling me the Hessian at the mode was not positive definite.

Hello

Thank you very much for kind and helpful advise, actually I acted accordingly. I first re-installed the 4.3 dynare to be sure about it. then one by one i applied all mode_compute options. from 1 to 5 it was giving error, Number 6 and 8 took a lot of time(after one hour I stopped dynare), however the number 7 and 9 worked and i got results. It has been possible with you help. “Thank You Very Much” and now could you advise me further please, should I use 7 or 9? or should I spend some hours to get (6 or 8) if that would be a good idea and possible.

with regards and best wishes

Ali

Hello

Thank you very much for kind and helpful advise, actually I acted accordingly. I first re-installed the 4.3 dynare to be sure about it. then one by one i applied all mode_compute options. from 1 to 5 it was giving error, Number 6 and 8 took a lot of time(after one hour I stopped dynare), however the number 7 and 9 worked and i got results. It has been possible with you help. “Thank You Very Much” and now could you advise me further please, should I use 7 or 9? or should I spend some hours to get (6 or 8) if that would be a good idea and possible.

with regards and best wishes

Ali

Which method you use to find the mode does not matter as long as you find it.

Many thanks.

I am having problems with adding a shock to the LZB model. Whenever I run the dynare file I only get the graphs of the IRF from the shocks already in the model. Could you please explain how one could add shocks.