Recursive one-sided HP filtered trend

Questions and discussions on Time Series Analysis
holyw160
Posts: 10
Joined: Thu Nov 09, 2006 3:07 am

Recursive one-sided HP filtered trend

Unread post by holyw160 »

Hi, does any one have an example of a one-sided Hodrick-Prescott filter for the purpose of calculating gaps/deviations from trend (e.g., credit to GDP ratio)? Thanks.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Recursive one-sided HP filtered trend

Unread post by TomDoan »

Wouldn't that just be the state-space model in the HPFILTER.RPF

with TYPE=SMOOTH in

dlm(a=ahp,c=chp,f=fhp,sv=1.0,sw=1.0/lambda,presample=diffuse,$
type=smooth,var=concentrate,y=lgdp) / hpstates

replaced with TYPE=FILTER? You would have to adjust the LAMBDA value to the value specified. The trend itself can be pulled out as the series HPSTATES(t)(1).
randal_verbrugge
Posts: 14
Joined: Mon Sep 23, 2013 10:43 am

Re: Recursive one-sided HP filtered trend

Unread post by randal_verbrugge »

You are probably aware of this, but in case you aren't ... all filters like this have serious problems near the edges of the data.

The standard procedure to help minimize this is to augment the data with a forecast. (For example, see Ashley and Verbrugge, Econometric Reviews 2009). In quarterly data, I'd say 8 quarters.

The RATS proc for the Baxter-King filter actually does this automatically, both at the beginning and the end of the sample period.
holyw160
Posts: 10
Joined: Thu Nov 09, 2006 3:07 am

Re: Recursive one-sided HP filtered trend

Unread post by holyw160 »

randal_verbrugge wrote:You are probably aware of this, but in case you aren't ... all filters like this have serious problems near the edges of the data.

The standard procedure to help minimize this is to augment the data with a forecast. (For example, see Ashley and Verbrugge, Econometric Reviews 2009). In quarterly data, I'd say 8 quarters.

The RATS proc for the Baxter-King filter actually does this automatically, both at the beginning and the end of the sample period.
Dear randal_verbrugge,
Thank you for the insight - I obtained results using the state-space model in the HPFILTER.RPF (with trend extracted as the series HPSTATES(t)(1)) but will investigate your suggested approach and compare results. Thanks once again.
Post Reply