Page 1 of 1

bayesian estimation

PostPosted: Tue Mar 08, 2016 9:54 pm
by riiiiad
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

Re: bayesian estimation

PostPosted: Thu Mar 10, 2016 10:30 am
by jpfeifer
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.

Re: bayesian estimation

PostPosted: Thu Mar 10, 2016 4:15 pm
by riiiiad
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

Re: bayesian estimation

PostPosted: Thu Mar 10, 2016 4:36 pm
by jpfeifer
Increase
Code: Select all
mh_replic

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" https://sites.google.com/site/pfeiferecon/Pfeifer_2013_Observation_Equations.pdf

Re: bayesian estimation

PostPosted: Thu Mar 10, 2016 5:06 pm
by riiiiad
ok i will use the log first difference and i will send you the results
thanks

Re: bayesian estimation

PostPosted: Fri Mar 11, 2016 9:01 am
by riiiiad
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
y:gdp
c:consumption
inv:investment
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
y_hat=ln(y)-ln(y-1)
c_hat=ln(c)-ln(c-1)
inv_hat=ln(inv)-ln(inv-1)
p_hat=ln(p)-ln(p-1)
i_hat=i
picz_hat=picz
ca_y_hat=ca_y

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.
thankd

Re: bayesian estimation

PostPosted: Sun Mar 13, 2016 11:40 am
by jpfeifer
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)
3.
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.

Re: bayesian estimation

PostPosted: Sun Mar 13, 2016 4:41 pm
by riiiiad
hi professor
thank you for your post
1-I'm confused about your answer in: viewtopic.php?f=1&t=7950
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

Re: bayesian estimation

PostPosted: Mon Mar 14, 2016 8:12 pm
by jpfeifer
1. Please reply in that post by clarifying your question as I asked.
2. By specifying the
Code: Select all
hp_filter
option of the stoch_simul command (see the manual)

Re: bayesian estimation

PostPosted: Mon Mar 14, 2016 8:53 pm
by riiiiad
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.
thanks

Re: bayesian estimation

PostPosted: Tue Mar 15, 2016 7:33 am
by jpfeifer
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).

Re: bayesian estimation

PostPosted: Wed Mar 16, 2016 8:16 pm
by riiiiad
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?
thanks

Re: bayesian estimation

PostPosted: Thu Mar 17, 2016 8:50 am
by jpfeifer
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,

Re: bayesian estimation

PostPosted: Fri Mar 18, 2016 5:50 am
by ZBCPA
jpfeifer wrote: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,
Code: Select all
y_obs=y-y(-1)+y_ME
;

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

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

Many thanks,
Huan

Re: bayesian estimation

PostPosted: Fri Mar 18, 2016 8:16 am
by jpfeifer
In the data you only observe the variable including measurement error. Thus, y_obs is the natural object of comparison.