Bayesian estimation

hi sir
i estimate a model with a bayesian estimation and i attached 03 files about diagnostic
please can i have your opinion on the result
thank you
posterior mean.pdf (8.25 KB)
Historical and smothed variable.pdf (8.17 KB)
Multivariate convergence diagnostic.pdf (5.49 KB)

Your MCMC seems to not have converged. At a minimum, you need more draws. Also, how did you treat your data. Some observables look extremely smooth.

thank you for your reply
i have used the detrended series (gdp,c,inv,i,…) with hp filter .then how can i have more draw.
thank you


You should never use the HP filter for Bayesian estimation. Please see Pfeifer(2013): “A Guide to Specifying Observation Equations for the Estimation of DSGE Models”

ok i will use the log first difference and i will send you the results

good morning
i have simulate my model with bayseian estimation
my model is log lineared and i calculated the steady state value. the variables y_hat,c_hat,inv_hat,i_hat,picz_hat,P_hat and ca_y_hat are the devaiation about steady state
i use data contain
i=nominan interest
picz:core inflation
p:price of oil
ca_y: current account gdp ratio

i make a transformation as following
y,c,inv : the first differnec og logarithm: ln(y)-ln(y-1)
i: no transformation
picz: is expressed as deviation from its target
p:the first differnec og logarithm: ln(y+1)-ln(y)
ca_y: no transformation

and i estimate the model and i put

i have the multivariate diagnostic as attached

a have another question i want to compare the standard deviation of real gdp and the gdp of model (théorical moment)
for model there is no problem, i take the théorical moment about the oo file
for real data, do i filtred the serie with hp filter(1600) and compute the standard deviation about demeanded series.
muultivariate convergenec.pdf (5.23 KB)

  1. Your general approach for the observation equations is correct.
  2. Make sure your interest rate and inflation data are consistent (net vs. gross and annual vs. quarterly)

[quote]p:the first differnec og logarithm: ln(y+1)-ln(y)

is clearly not correct
4. For comparing moments, you need to use the same filter. If you use the HP-filter to compute theoretical moments and in the data, you are fine. Note, however, that it is more common to compare the standard deviations of growth rates if you estimate your model on growth rates.

hi professor
thank you for your post
1-I’m confused about your answer in: Estimation command
please can you explain me more clearly
2-how i use (the command) the HP filter to estimate the théorical moment
thank you again

  1. Please reply in that post by clarifying your question as I asked.
  2. By specifying the hp_filter option of the stoch_simul command (see the manual)

i am asking if i can match observable variable in the data like ΔlnYt to the model variable (y_hat).
y_hat is fractional deviations from it steady state value. my model is log linearzed.
Yt is real gdp.

Obviously, you cannot do this. You cannot match growth rates in the data (ΔlnYt) to percentage deviations from trend in the model (y_hat). You need to match them to the growth rates of the model variables (and to account for the mean in growth rates).

ok professor
I did what you told me and I think I have very good result (acceptance current ratio 24.5%)
and i had a théorical moment for my variable (ex sigma y_hat=10)
and i want to compare this standard deviation (sigma y_hat) with the standard déviation of the data.
how i compute the standard deviation of y in my data. is it the standard déviation of filtred gdp with hp filter?

No, you can only compare the model variables to corresponding objects you observe in the data. You do not observe y_hat, only it’s growth rate. For this reason you can only compare these two,

Dear Johannes,

If data is in growth rate, model is log linearized, and there is measurement error,


Then should we compare the standard deviation of data with standard deviation of Model y_obs,which of course includes y_ME;

should we compare the standard deviation of data with standard deviation of** Model y-y(-1)** ?
Even though they are very similar.

Many thanks,

In the data you only observe the variable including measurement error. Thus, y_obs is the natural object of comparison.