Estimation VS Simulation

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

Estimation VS Simulation

Postby Muhammad Ali Nasir » Thu Aug 23, 2012 11:49 am

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
Attachments
DATA.xls
data set
(16.75 KiB) Downloaded 68 times
Simulation.mod
simulation which produces some results
(6.29 KiB) Downloaded 78 times
Estimation.mod
which gives error.
(6.52 KiB) Downloaded 85 times
Muhammad Ali Nasir
 
Posts: 22
Joined: Wed Jan 12, 2011 9:30 am
Location: Leeds England

Re: Estimation VS Simulation

Postby jpfeifer » Fri Aug 24, 2012 8:34 am

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.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Estimation VS Simulation

Postby Muhammad Ali Nasir » Fri Aug 24, 2012 11:48 am

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
Attachments
Stock.xls
stockprices
(12.91 KiB) Downloaded 64 times
Estimation.mod
Nk-DSGE
(7.43 KiB) Downloaded 73 times
Muhammad Ali Nasir
 
Posts: 22
Joined: Wed Jan 12, 2011 9:30 am
Location: Leeds England

Re: Estimation VS Simulation

Postby jpfeifer » Fri Aug 24, 2012 5:19 pm

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.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Estimation VS Simulation

Postby Muhammad Ali Nasir » Sat Aug 25, 2012 2:37 pm

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
Attachments
Stock.xls
(12.91 KiB) Downloaded 57 times
Estimation3.mod
(7.77 KiB) Downloaded 67 times
Muhammad Ali Nasir
 
Posts: 22
Joined: Wed Jan 12, 2011 9:30 am
Location: Leeds England

Re: Estimation VS Simulation

Postby jpfeifer » Sat Aug 25, 2012 4:43 pm

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
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Estimation VS Simulation

Postby Muhammad Ali Nasir » Sat Aug 25, 2012 6:24 pm

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
Muhammad Ali Nasir
 
Posts: 22
Joined: Wed Jan 12, 2011 9:30 am
Location: Leeds England

Re: Estimation VS Simulation

Postby jpfeifer » Sat Aug 25, 2012 6:52 pm

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.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Estimation VS Simulation

Postby Muhammad Ali Nasir » Sun Aug 26, 2012 8:15 pm

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
Muhammad Ali Nasir
 
Posts: 22
Joined: Wed Jan 12, 2011 9:30 am
Location: Leeds England

Re: Estimation VS Simulation

Postby Muhammad Ali Nasir » Sun Aug 26, 2012 8:15 pm

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
Muhammad Ali Nasir
 
Posts: 22
Joined: Wed Jan 12, 2011 9:30 am
Location: Leeds England

Re: Estimation VS Simulation

Postby jpfeifer » Mon Aug 27, 2012 8:23 am

Which method you use to find the mode does not matter as long as you find it.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Estimation VS Simulation

Postby Muhammad Ali Nasir » Mon Aug 27, 2012 9:52 am

Many thanks.
Muhammad Ali Nasir
 
Posts: 22
Joined: Wed Jan 12, 2011 9:30 am
Location: Leeds England

Re: Estimation VS Simulation

Postby mikhelee » Wed Sep 26, 2012 10:32 am

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.
mikhelee
 
Posts: 1
Joined: Wed Sep 26, 2012 10:29 am


Return to Dynare help

Who is online

Users browsing this forum: Google [Bot] and 4 guests