Trace plot after estimation

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.

Trace plot after estimation

Postby Econbee » Mon Sep 01, 2014 5:21 am

Dear all,

I added a command in mod file after the estimation for trace plot of random draws. And I found a problem.

There is no problem when I added the command for a deep parameter "tau": trace_plot(options_,M_,estim_params_,'DeepParameter',1,'tau'). I got the plot in this case.

But, when I added a command for the standard deviation "sigma_z": trace_plot(options_,M_,estim_params_,'StructuralShock',1,'sigma_z'), there is no trace plot produced and I got an error message "The standard deviation of sigma_z is not an estimated parameter!".

I used Dynare unstable version 2014-08-26. And I referred to http://www.dynare.org/DynareWiki/TracePlots for the plot. I am wondering if there is anything wrong in my command or if there is a bug in Dynare. Anybody has any idea?

Thanks a lot in advance!
Econbee
 
Posts: 74
Joined: Fri Nov 08, 2013 8:14 am

Re: Trace plot after estimation

Postby jpfeifer » Mon Sep 01, 2014 9:22 am

Please provide a file to replicate the issue.
------------
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: Trace plot after estimation

Postby Econbee » Mon Sep 01, 2014 2:27 pm

Dear Johannes,

Thanks for your reply. The testing codes are attached.
Attachments
Trace_Plot.rar
(24.56 KiB) Downloaded 78 times
Econbee
 
Posts: 74
Joined: Fri Nov 08, 2013 8:14 am

Re: Trace plot after estimation

Postby jpfeifer » Mon Sep 01, 2014 5:07 pm

You have
Code: Select all
shocks;
var eps_d; stderr sigma_d;
end; 

, but you don't want to plot sigma_d. You want the estimated standard deviation. You are estimating
Code: Select all
estimated_params;
stderr eps_d, inv_gamma_pdf, 0.1, inf;       
end;

Thus, you must call
Code: Select all
trace_plot(options_,M_,estim_params_,'StructuralShock',1,'eps_d');

In contrast, sigma_d is a constant you defined, which has no meaning for Dynare.
------------
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: Trace plot after estimation

Postby Econbee » Tue Sep 02, 2014 1:48 am

Thank you, Dear Johannes. It works now.

I am a little confused. You said that "sigma_d is a constant you defined, which has no meaning for Dynare". I looked up the manual and some examples. I also tried the code by commenting out the lines for defining sigma_d. It seems that the shocks-end block is not necessary for estimation. And sigma_d in my code is totally redundant and has no meaning at all. In my case, does Dynare assign any value to sigma_d during estimation? Also, does it mean that the shocks-end block is only required for stochastic simulation?

Please clarify if I am wrong. Thank you!
Econbee
 
Posts: 74
Joined: Fri Nov 08, 2013 8:14 am

Re: Trace plot after estimation

Postby jpfeifer » Tue Sep 02, 2014 5:18 am

I meant to say " has no meaning for Dynare during estimation of this standard deviation". The reason is the following:
You cannot use parameters assigned in the shocks-block for estimation purposes. If you would try to estimate the sigma_d, it would fail. This is a safeguard in newer Dynare versions against erroneously thinking parameters within the shocks-block can be used for estimation. The reason is that the contents of the shocks block are executed exactly once and not iteratively during estimation. The shocks-block and all parameters used in it are only used for calibration and simulation purposes!

When you start estimation of the standard deviation of eps_d, Dynare will estimate it, but the respective estimate will have nothing to with sigma_d (which you did not estimate as I pointed out). This also implies that after estimation, the value of sigma_d will be unchanged compared to the value before estimation, because it was not estimated. Rather the standard deviation will be for example be directly saved into M_.Sigma_e.

If you did not estimate standard deviation of eps_d, Dynare would keep this standard deviation at the value assigned during calibration of the model, which is the constant value of sigma_d. This is the case where sigma_d has a meaning for Dynare.

The reason you can comment this line out without consequences is that during estimation, Dynare estimates the standard deviation and no calibrated model is necessary for estimation (but it is recommended).
------------
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: Trace plot after estimation

Postby Econbee » Tue Sep 02, 2014 7:23 am

Dear Johannes, thanks a lot for your clarification!
Econbee
 
Posts: 74
Joined: Fri Nov 08, 2013 8:14 am


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 4 guests