Page 1 of 1
how to load posterior mean?
Posted:
Tue Dec 04, 2012 7:57 am
by use
Dear All,
How can I load the posterior mean and perform forecast after estimation is already done?
Thank you.
Re: how to load posterior mean?
Posted:
Thu Jan 10, 2013 3:07 pm
by MichelJuillard
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
Re: how to load posterior mean?
Posted:
Wed Jan 08, 2014 9:59 am
by gin
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
Re: how to load posterior mean?
Posted:
Wed Jan 08, 2014 10:01 am
by jpfeifer
Try using 4.4 and put those statements into the new verbatim-block.
Re: how to load posterior mean?
Posted:
Wed Jan 08, 2014 10:22 am
by gin
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?
Re: how to load posterior mean?
Posted:
Wed Jan 08, 2014 12:27 pm
by gin
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;
Re: how to load posterior mean?
Posted:
Fri Jan 10, 2014 5:33 pm
by jpfeifer
Given the current preprocessor, that is the only way to do it.