Bivariate H-P Filter

Use this forum for posting example programs or short bits of sample code.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Bivariate H-P Filter

Unread post by TomDoan »

This is an example of a bivariate HP filter. There's a common growth component for both series. Each series has its own intercept and loading on the growth component, that is, the model has

y1(t) = a1 + g1 G(t) + v1(t)
y2(t) = a2 + g2 G(t) + v2(t)

where G(t) is a standard local trend state space model. If the "SV" matrix is the identity, the series are given equal weight in determining G(t). Changing that to a non-identity will force G to fit better the series with the smaller value for SV. It's based (loosely) upon Kozicki(1999), "Multivariate detrending under common trend restrictions: Implications for business cycle research," Journal of Economic Dynamics and Control, vol. 23(7), pages 997-1028. However, she collapses the model so the common trend can be estimated by a univariate HP filter on a weighted average of the series.

The setup actually will fit two or more series; you just have to change n=2 and redo the frml yf line.

This is covered in detail in the 2nd Edition of the State-Space/DSGE e-course.
ss_6_2.rpf
Program file
(2.13 KiB) Downloaded 835 times
oecdgdp.rat
Data file
(45.75 KiB) Downloaded 957 times
BinhPham
Posts: 51
Joined: Tue Feb 14, 2017 10:00 am

Re: Bivariate H-P Filter

Unread post by BinhPham »

Dear Tom,

First of all, I would say thank to your multivariate HP filter.

Yet, I would want to have multivariate one-sided HP filter. Is is possible in term of theoretical aspects?
Because I am really a new RATSer, could you guide me some RATS code?

Thank you and best regards,
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Bivariate H-P Filter

Unread post by TomDoan »

Use TYPE=FILTER rather than TYPE=SMOOTH on the DLM instruction.


Last bumped by TomDoan on Thu Aug 31, 2017 11:56 am.
Post Reply