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).
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.
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.
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.
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?
Estimation/Smoother creates a sequence of oo_.SmoothedVariables, where the smoothed observables match the data perfectly
It also generates oo_.SmoothedShocks. I assumed that doing simult_ with this sequence of smoothed shocks would allow me to retrieve oo_.SmoothedVariables.
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.
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?
I have a question,
the draws used in the estimation, to compute the smoothed_shocks/variables, are the ones in the folder name/metropolis and then name_mh*_blck** ?
Where ** is the chain number of the MCMC.
And only the last draws in that matrix are used, since the first are burn-in sample?