Hodrick–Prescott filter
The reasoning for the methodology uses ideas related to the decomposition of time series. Let formula_2 for formula_3 denote the logarithms of a time series variable. The series formula_2 is made up of a trend component formula_5, a cyclical component formula_6, and an error component formula_7 such that formula_8. Given an adequately chosen, positive value of formula_1, there is a trend component that will solve
formula_10
The first term of the equation is the sum of the squared deviations formula_11, which penalizes the cyclical component. The second term is a multiple formula_1 of the sum of the squares of the trend component's second differences. This second term penalizes variations in the growth rate of the trend component. The larger the value of formula_1, the higher is the penalty. Hodrick and Prescott suggest 1600 as a value for formula_1 for quarterly data. Ravn and Uhlig (2002) state that formula_1 should vary by the fourth power of the frequency observation ratio; thus, formula_1 should equal 6.25 (1600/4^4) for annual data and 129,600 (1600
in practice, formula_17 for yearly data and formula_18 for monthly data are commonly used, however. The Hodrick–Prescott filter is explicitly given by
formula_19
where formula_20 denotes the lag operator, as can seen from the F.O.C. for the minimization problem. The Hodrick–Prescott filter will only be optimal when:


The standard two-sided Hodrick–Prescott filter is non-causal as it is not purely backward looking. Hence, it should not be used when estimating DSGE models based on recursive state-space representations (e.g., likelihood-based methods that make use of the Kalman filter). The reason is that the Hodrick–Prescott filter uses observations at formula_22 to construct the current time point formula_23, while the recursive setting assumes that only current and past states influence the current observation. One way around this is to use the one-sided Hodrick–Prescott filter. Exact algebraic formulas are available for the two-sided Hodrick–Prescott filter in terms of its signal-to-noise ratio formula_1.
A working paper by James D. Hamilton at UC San Diego titled "Why You Should Never Use the Hodrick-Prescott Filter" presents evidence against using the HP filter. Hamilton writes that:
# The HP filter produces series with spurious dynamic relations that have no basis in the underlying data-generating process. # A one-sided version of the filter reduces but does not eliminate spurious predictability and moreover produces series that do not have the properties sought by most potential users of the HP filter. # A statistical formalization of the problem typically produces values for the smoothing parameter vastly at odds with common practice, e.g., a value for λ far below 1600 for quarterly data. # There’s a better alternative. A regression of the variable at date t+h on the four most recent values as of date t offers a robust approach to detrending that achieves all the objectives sought by users of the HP filter with none of its drawbacks. "
A working paper by Robert J. Hodrick titled "An Exploration of Trend-Cycle Decomposition Methodologies in Simulated Data" examines whether the proposed alternative approach of James D. Hamilton is actually better than the HP filter at extracting the cyclical component of several simulated time series calibrated to approximate U.S. real GDP. Hodrick finds that for time series in which there are distinct growth and cyclical components, the HP filter comes closer to isolating the cyclical component than the Hamilton alternative.
Drawbacks to the Hodrick–Prescott filter
The Hodrick–Prescott filter (also known as Hodrick–Prescott decomposition) is a mathematical tool used in macroeconomics, especially in real business cycle theory, to remove the cyclical component of a time series from raw data. However, it was first proposed much earlier by E. T. Whittaker in 1923.