Page 1 of 1
Smoother
Posted:
Fri Jun 26, 2015 10:23 am
by draoul
Dear all,
I have a question regarding the smoother implemented in Bayesian estimation. Does dynare compute the smoothed variables conditional on the posterior mean after estimation? I am asking because I calibrated my model at the posterior mean, simulated it using stoch_simul and computed the smoothed variables using the calib_smoother command. However, the smoothed estimates differ (the differences are small but visible when I plot the two series together (see attached figure).
Best,
Raoul
Re: Smoother
Posted:
Tue Jun 30, 2015 6:56 am
by qazi.haque
Hi Raoul,
After running MCMC Dynare computes the smoothed estimates of the endogenous variables at the posterior mean.
Cheers,
Qazi
Re: Smoother
Posted:
Sun Jul 05, 2015 4:23 pm
by jpfeifer
The estimation command computes the mean estimates, i.e. the average smoother results over the MCMC parameter draws. In contrast, stoch_simul after estimation computes the smoother at the mean of the parameter values. Those are two different things.
Re: Smoother
Posted:
Mon Jul 06, 2015 8:17 am
by draoul
Thanks a lot for your answer.
I see your point. However, is this also true if I do not include the smoother option in the estimation command? Because then dynare also computes smoothed shocks (saved under oo_.SmoothedShocks.shockname). I thought, these might be the ones based on the posterior mean and I was reffering to these shocks (oo_.SmoothedShocks.shockname and not oo_.SmoothedShocks.Mean.shockname) when comparing them to the smoothed shocks obtained by the calib_smoother.
Re: Smoother
Posted:
Mon Jul 06, 2015 8:56 am
by jpfeifer
oo_.SmoothedShocks should only be set by the estimation command if it is used with the smoother option. Alternatively, the calib_smoother command will set it.
Re: Smoother
Posted:
Mon Aug 03, 2015 4:52 pm
by yinx
Hello All,
Please can you provide an example of how to use calib_smoother.
Thank you.
Yinka
Re: Smoother
Posted:
Mon Aug 03, 2015 4:54 pm
by yinx
P.S. I would prefer if the command set up is for filtered variables please.
Re: Smoother
Posted:
Mon Aug 03, 2015 5:44 pm
by jpfeifer
One example is here:
https://github.com/DynareTeam/dynare/blob/master/tests/fs2000/fs2000_calib.mod. The fsdat_simul.m dataset is in the Dynare examples folder.
Re: Smoother
Posted:
Mon Aug 03, 2015 7:38 pm
by yinx
Thank you for your help.
Re: Smoother
Posted:
Mon Jun 06, 2016 10:53 pm
by kipfilet
Hi,
Apologies if this is a stupid question, but I still haven't understood why "oo_.SmoothedVariables" and doing simult_ with oo_.SmoothedShocks generates slightly different results?
Re: Smoother
Posted:
Tue Jun 07, 2016 12:10 am
by kipfilet
To be more clear,my procedure is as follows:
1) Estimation/Smoother creates a sequence of oo_.SmoothedVariables, where the smoothed observables match the data perfectly
2) It also generates oo_.SmoothedShocks. I assumed that doing simult_ with this sequence of smoothed shocks would allow me to retrieve oo_.SmoothedVariables.
3) I eliminate the first row of oo_.SmoothedShocks, set y0=oo_.SmoothedVariables(1) and do
simult_(y0, oo_.dr, shocks, 1)
The output is not exactly the same as oo_.SmoothedVariables. Some of the variables are quite similar, but others are considerably different, it almost seems that one or more shocks are missing!
I saw in other threads that some people have issues with steady state values, etc, but my model is written in log-linear form (i.e. I am writing the model so that steady states are zero for all variables) and data is detrended/demeaned before estimation.
Am I missing anything?
Re: Smoother
Posted:
Tue Jun 07, 2016 8:59 am
by jpfeifer
Re: Smoother
Posted:
Tue Jun 07, 2016 4:09 pm
by kipfilet
Hey Johannes,
First of all, thanks a lot for taking the time to read my "complaint" and for suggesting a solution.
It seems to be working now! But I am curious as to what was the issue.
I went carefully over your file, and everything coincides with what I was doing from line 118 onwards.
The only difference (the only change I made to my code) is that I added the "smoother" option to "estimation". Now, instead of oo_.SmoothedVariables being a structure of the kind oo_.SmoothedVariables.(varnames), it is of the kind oo_.SmoothedVariables.(yyy) where
(yyy) = {Mean, Median, Var, deciles, HPDInf, HPDSup}
and each of these in turn is of the type oo_.SmoothedVariables.(yyy).(varnames). To obtain the results that match exactly, I am using the Mean for both SmoothedVariables and SmoothedShocks.
I am very happy that this got solved, but out of curiosity, would you mind explaining what the difference is with respect to what I was doing?
I guess my question can be reframed as follows: if I do not specify the "smoother" option when estimating the model, Dynare still generates a sequence of oo_.SmoothedVariables and oo_.SmoothedShocks, where the former coincide with the data exactly for the observables. But what are these objects, exactly?
Thanks again!
Re: Smoother
Posted:
Wed Jun 08, 2016 5:08 pm
by jpfeifer
My guess is that it has to do with the variable ordering of the matrix returned by the non-MCMC smoother.