Multivariate HP filter
Re: Multivariate HP filter
Why are you accumulating the estimate? r-bar is the first state.
You didn't include SV in your options, so you only have a rank one error process. You also need to define C, SW and SV as FRML's (or put them directly into the DLM instruction the way you're handling MU), since they depend upon free parameters. (See the User's Guide if you're unclear about this).
You also want METHOD=BFGS, so it estimates rather than solving.
You didn't include SV in your options, so you only have a rank one error process. You also need to define C, SW and SV as FRML's (or put them directly into the DLM instruction the way you're handling MU), since they depend upon free parameters. (See the User's Guide if you're unclear about this).
You also want METHOD=BFGS, so it estimates rather than solving.
Re: Multivariate HP filter
Dear Tom,
Would be this a final, working code with frml instructions, hp parameter 6.25 for annual data. Could you please rerun the code and let me know what you think.
Many thanks,
Marinko
Would be this a final, working code with frml instructions, hp parameter 6.25 for annual data. Could you please rerun the code and let me know what you think.
Many thanks,
Marinko
Code: Select all
*
open data data1.xls
calendar(a) 1800
data(format=xls, org=columns) 1800:1 2012:1 ytilde qtilde r a2
compute a=||1.0,1.0,0.0|0.0,1.0,0.0|1.0,0.0,0.0||
compute f=||0.0|1.0|0.0||
declare vector alpha(3) sigma(3)
nonlin sigma0 sigma1 sigma2 alpha1 alpha2 alpha3
linreg ytilde
# constant ytilde{1} a2{1} qtilde{1}
compute alpha1=0.56,alpha2=0.0003,alpha3=-0.005,sigma2=sqrt(%seesq)
compute sigma1=3.008
compute sigma0=sqrt(6.25)*sigma1
decl frml[rect] sv sw c
frml sv = %diag(||sigma0^2,sigma2^2||)
frml sw = sigma1^2
frml c = ||1,0|0,0|0,-alpha2||
dlm(sw=sw,sv=sv,c=c,a=a,f=f,y=||r,ytilde||,presample=diffuse,pmethod=simplex,piters=5,exact,method=bfgs,type=smooth, mu=||0.0|alpha1*ytilde{1}+alpha2*r{1}+alpha3*qtilde{1}||) 1800:1 * xstates
set NRI 1800:1 * = xstates(t)(1)
graph(footer="Natural interest rate, HPMV estimation")
# NRI
print / NRIRe: Multivariate HP filter
I certainly would never have chosen a local trend model (which is what underlies the H-P filter) for the real rate of interest---a local level model would have made more sense. However, there probably is little difference in practice. What you have now appears to be a reasonable replication of their method.