HPfilter
The Hodrick-Prescott filter, abbreviated HP filter or HPfilter, is a smoothing technique used in time series analysis to separate a data series into a smooth trend component and a cyclical component. It is widely used in macroeconomics to extract the business cycle from gross domestic product and related series.
In its standard form, given a time series y_t, the goal is to find a trend sequence
λ is chosen according to data frequency and analyst preference; common guidance cites λ ≈ 1600 for quarterly data
Used to study business cycles by removing trend, the HP filter is simple and widely implemented in
Variants include bandpass filters such as Baxter-King and Christiano-Fitzgerald, and alternative detrending methods like linear or