Page 1 of 1
Estimation VS Simulation
Posted:
Thu Aug 23, 2012 11:49 am
by Muhammad Ali Nasir
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
Re: Estimation VS Simulation
Posted:
Fri Aug 24, 2012 8:34 am
by jpfeifer
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.
Re: Estimation VS Simulation
Posted:
Fri Aug 24, 2012 11:48 am
by Muhammad Ali Nasir
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
Re: Estimation VS Simulation
Posted:
Fri Aug 24, 2012 5:19 pm
by jpfeifer
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
- Code: Select all
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.
Re: Estimation VS Simulation
Posted:
Sat Aug 25, 2012 2:37 pm
by Muhammad Ali Nasir
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
.
many thanks and best wishes
Re: Estimation VS Simulation
Posted:
Sat Aug 25, 2012 4:43 pm
by jpfeifer
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
Re: Estimation VS Simulation
Posted:
Sat Aug 25, 2012 6:24 pm
by Muhammad Ali Nasir
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
Re: Estimation VS Simulation
Posted:
Sat Aug 25, 2012 6:52 pm
by jpfeifer
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.
Re: Estimation VS Simulation
Posted:
Sun Aug 26, 2012 8:15 pm
by Muhammad Ali Nasir
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
if that would be a good idea and possible.
with regards and best wishes
Ali
Re: Estimation VS Simulation
Posted:
Sun Aug 26, 2012 8:15 pm
by Muhammad Ali Nasir
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
if that would be a good idea and possible.
with regards and best wishes
Ali
Re: Estimation VS Simulation
Posted:
Mon Aug 27, 2012 8:23 am
by jpfeifer
Which method you use to find the mode does not matter as long as you find it.
Re: Estimation VS Simulation
Posted:
Mon Aug 27, 2012 9:52 am
by Muhammad Ali Nasir
Many thanks.
Re: Estimation VS Simulation
Posted:
Wed Sep 26, 2012 10:32 am
by mikhelee
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.