Problems about Bayesian and MCMC estimation

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

Re: Problems about Bayesian and MCMC estimation

Postby jpfeifer » Tue Oct 25, 2016 9:07 am

The variables in your model are log deviations from trend and therefore mean 0:
Code: Select all
y_model=log(Y)-log(Y_SS)

But the data transformation
Code: Select all
log(1+r/(4*100)

is just the log level, not the level minus its mean. Therefore, you need
Code: Select all
log(1+r/(4*100) - mean(log(1+r/(4*100))

to make the data correspond to deviations from mean.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Problems about Bayesian and MCMC estimation

Postby wyl » Wed Oct 26, 2016 5:46 pm

Really appreciate your help and explanation! I think I understand the guide contents now, and the data has been fixed as the guide says.
Yet the strange thing is, the error messages are still as same as previous one. I also tried different parameter values but it doesn't make any difference. The data already has mean 0, so is there anything else in which I make mistakes? Or this part is still wrongly defined?
Thanks a lot!
Attachments
dis444.zip
(584.78 KiB) Downloaded 82 times
wyl
 
Posts: 10
Joined: Thu Sep 08, 2016 7:49 pm

Re: Problems about Bayesian and MCMC estimation

Postby jpfeifer » Wed Oct 26, 2016 6:35 pm

But some of your data still has trends. You fixed the interest rate, but the same problem exists for inflation. Moreover, x trends and has a clear seasonal pattern. What happened to the linear detrending advocated by the original article?
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Problems about Bayesian and MCMC estimation

Postby wyl » Wed Oct 26, 2016 7:52 pm

I think the original paper didn't focus too much on the estimation part. In part 3.1, they just explained that, for large economy they use linearly-detrended log US real GDP (xs), demeaned CPI and demeaned interest rate. For small open economy, they used linearly-detrended log real GDP (x), demeaned trimmed-mean inflation, demeaned cash rate, and linearly-detrended log of exchange rate.
And the posterior statistics are based on 1 million draws using MCMC with 20% burn-in period. I think this part doesn't influence on the estimation.
These are all their words about the estimation part, quite short.

Thanks for pointing out my problems again. And as I understand, like the guide shows, the data could be detrended by:
obs_pi=pi_hat=log(pi_data)-log(mean(pi_data))
obs_y=y_hat=log(y)-log(y_bar)=log(y)-log(mean(y))
So I fixed the data, to match the observation equations. I'm not sure whether I misunderstand something.

Also for x, it trends and has seasonal pattern, does it mean that xs and x need to be fixed like interest rate?
wyl
 
Posts: 10
Joined: Thu Sep 08, 2016 7:49 pm

Re: Problems about Bayesian and MCMC estimation

Postby jpfeifer » Wed Oct 26, 2016 7:56 pm

Please read my Guide carefully. There is an important difference between trending variables (like x) and stationary, but not mean 0 variables (pi and r). Those need to be treated differently. The original paper is quite explicit here.
To take out the linear trend, use something like
Code: Select all
detrend(log(y))
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Previous

Return to Dynare help

Who is online

Users browsing this forum: Google [Bot] and 7 guests