Page 1 of 1
Recursive one-sided HP filtered trend
Posted: Wed Jan 06, 2016 11:56 am
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.
Re: Recursive one-sided HP filtered trend
Posted: Wed Jan 06, 2016 7:07 pm
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).
Re: Recursive one-sided HP filtered trend
Posted: Thu Jan 21, 2016 1:39 pm
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.
Re: Recursive one-sided HP filtered trend
Posted: Fri Jan 22, 2016 3:13 am
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.