Re: Problems about Bayesian and MCMC estimation
Posted:
Tue Oct 25, 2016 9:07 am
by jpfeifer
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.
Re: Problems about Bayesian and MCMC estimation
Posted:
Wed Oct 26, 2016 5:46 pm
by wyl
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!
Re: Problems about Bayesian and MCMC estimation
Posted:
Wed Oct 26, 2016 6:35 pm
by jpfeifer
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?
Re: Problems about Bayesian and MCMC estimation
Posted:
Wed Oct 26, 2016 7:52 pm
by wyl
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?
Re: Problems about Bayesian and MCMC estimation
Posted:
Wed Oct 26, 2016 7:56 pm
by jpfeifer
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))