Posterior distribution of smoothed (unobserved) variables

I am interested in obtaining the posterior distribution of the smoothed unobserved variables in my model. In other words, I would like to run the Kalman smoother for each posterior draw and save the smoothed series.

Does dynare save this somewhere or is it possible to compute it “by hand” by handing the Parameter draws to some Kalman smoother Routine (obviously, this must be possible but may be quite complicated as deep understanding of dynare routines is necessary)?

Kind regards

If you run the smoother in the estimation command, Dynare should already save those. In the metropolis-subfolder, you should have

FILE_NAME_smooth*.mat

which stores the deviation from steady state across draws. You can also find the smoothed steady state in that folder.

The alternative would be to run a posterior_function on evaluate_smoother.m

Thank you very much. I will implement your auggestions.