how to load posterior mean?

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.

how to load posterior mean?

Postby use » Tue Dec 04, 2012 7:57 am

Dear All,

How can I load the posterior mean and perform forecast after estimation is already done?

Thank you.
use
 
Posts: 18
Joined: Mon Aug 20, 2012 4:50 pm

Re: how to load posterior mean?

Postby MichelJuillard » Thu Jan 10, 2013 3:07 pm

First of all you need to enough Metropolis replications (option mh_replic) to get a good description of the posterior distribution. It is not possible to obtain posterior mean after computing only the posterior mode.

If you run Metropolis replications as part of the estimation statement (or use load_mh_file), the parameter values used in a subsequent stoch_simul or forecast will be at the posterior mean

Best

Michel
MichelJuillard
 
Posts: 680
Joined: Thu Nov 18, 2004 10:51 am

Re: how to load posterior mean?

Postby gin » Wed Jan 08, 2014 9:59 am

Dear all,

I'm trying to load the posterior values for the estimated parameters and shock std in another .mod session where I'm going to use the stochastic simulation only. For that purpose, I wrote the following before the stoch_simul block:

Code: Select all
load baseline189_oo_.mat;
mypars=baseline189_oo_.posterior_mean.parameters;
myshocks=baseline189_oo_.posterior_mean.shocks_std;
xid  = mypars.xid;
shocks;
 var muz_eps  = myshocks.muz_eps ^2 ;
end;


But Dynare spits an error: syntax error, unexpected '.' at the first instance of `mypars.xid '.

Attached mod-file.

gin
Attachments
baseline192.mod
(59.22 KiB) Downloaded 47 times
-------------------------
gin
http://gin.mozello.com
gin
 
Posts: 47
Joined: Wed Feb 27, 2013 3:10 pm
Location: Riga, Latvia

Re: how to load posterior mean?

Postby jpfeifer » Wed Jan 08, 2014 10:01 am

Try using 4.4 and put those statements into the new verbatim-block.
------------
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: how to load posterior mean?

Postby gin » Wed Jan 08, 2014 10:22 am

It is working with loading the parameters, but verbatim-block seems to be conflicting with the shocks-block - either put inside or outside the shocks-block.
Any workaround to load shock std?
-------------------------
gin
http://gin.mozello.com
gin
 
Posts: 47
Joined: Wed Feb 27, 2013 3:10 pm
Location: Riga, Latvia

Re: how to load posterior mean?

Postby gin » Wed Jan 08, 2014 12:27 pm

An inelegant solution to load shock std:

myshocks=baseline189_oo_.posterior_mean.shocks_std;
myshocksmat=cell2mat(struct2cell(myshocks));

shocks;
var muz_eps = myshocksmat(1) ^2 ;
var epsilon_eps = myshocksmat(2) ^2 ;
% etc.
end;
-------------------------
gin
http://gin.mozello.com
gin
 
Posts: 47
Joined: Wed Feb 27, 2013 3:10 pm
Location: Riga, Latvia

Re: how to load posterior mean?

Postby jpfeifer » Fri Jan 10, 2014 5:33 pm

Given the current preprocessor, that is the only way to do 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


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 6 guests