Page 1 of 1

One-sided HP filter

PostPosted: Wed Jun 18, 2014 12:40 pm
by brasidas1
Hi,

I hope I'm posting the question in the right part of the forum. Johannes Pfeifer discusses the one-sided HP filter in his guide to observation equations (thanks Johannes, I found it very useful) and mentions that the resulting de-trended variable will always have a mean of zero.
I have been using the add-in from Eviews to carry this out as well as the Matlab file from the file exchange and both yield identical, but not mean-zero, output. I could of course de-mean the result but it's somewhat puzzling.

Does anyone have any suggestions?
Many thanks

Re: One-sided HP filter

PostPosted: Wed Jun 18, 2014 1:32 pm
by jpfeifer
Which Matlab file are you talking about? Most HP filters provide the trend component as the first argument. This one is not mean zero. Only the cyclical component is mean zero.

Re: One-sided HP filter

PostPosted: Wed Jun 18, 2014 2:22 pm
by brasidas1
Dear Johannes,

Thank you for your reply.
All I did was
[Ytrend, Yobs] = one_sided_hp_filter_serial(log(Y))

where Yobs gives the cyclical component. Alternatively, Yobs = 100*(log(Y)-Ytrend) still gives the same output, which has a non-zero mean.

The Matlab file came from (http://ideas.repec.org/c/dge/qmrbcd/181.html) and the Eviews add-in (from their website) gives identical results.

Re: One-sided HP filter

PostPosted: Wed Jun 18, 2014 3:45 pm
by jpfeifer
Because of the Kalman filtering approach, the sample mean of the trend component is always approximately zero (and not exactly zero as for HP-filtering) and becomes closer to zero the longer the data series (asymptotically). I will update the guide accordingly. Thanks for pointing this out.