rtime-serieseconomicstrend

Hodrick and Prescott (HP) filter in R


I'm applying the HP filter to time series data to remove the cyclical component of a time series (TS) from raw data. Data do have a yearly frequency. I write in R:

lambda=100 #penalty term
cycle= hpfilter(v1,freq=lambda)$cycle

where v1 is my TS data. In this way, I get the cyclical component.

Do you agree with me that is common practice to set lambda=100 when you deal with annual data?


Solution

  • Yes, usually we use 100 for yearly data. See "tips" section in (https://www.mathworks.com/help/econ/hpfilter.html).