- Introduced by
- Robert Hodrick & Edward Prescott
- Year
- 1997
- Type
- Penalized least-squares smoother
- Family
- Trend & seasonality
What does it do?
The Hodrick-Prescott (HP) filter is a penalized least-squares method used in macroeconomics and empirical finance to split a time series into a smooth long-run trend component and a short-run cyclical component.
Hodrick and Prescott (1997) introduced it in a study of postwar quarterly U.S. data, and it is widely applied in business cycle analysis, output gap estimation, and related empirical work.
The intuition behind the method
Suppose you have a wiggly economic series, such as real GDP, and want to separate the underlying growth path from short-term fluctuations. The HP filter finds a trend that balances two aims: staying close to the observed data, and changing slowly, measured by the second differences of the trend. A single parameter, lambda, sets this balance. As lambda grows, the trend is pushed toward a straight line; as lambda shrinks, the trend follows the data more closely. The residual between the data and the trend is the cyclical component. If the cyclical component and the second difference of the trend are normally and independently distributed, lambda can be interpreted as the ratio of their variances, so a larger lambda corresponds to a smoother trend and more erratic cycles.
History
Hodrick and Prescott (1997), published in the Journal of Money, Credit and Banking, proposed the filter as a procedure for representing a time series as the sum of a smoothly varying trend and a cyclical component. They applied it to postwar quarterly U.S. data to document the comovements of the cyclical components of several macroeconomic series. The method has since been widely adopted in business cycle and policy research. Later work examined the choice of lambda: Ravn and Uhlig (2001) argued that lambda should vary with the fourth power of the data frequency rather than the square. Subsequent analyses also showed that the filter can introduce spurious fluctuations into the irregular component of a series, which renewed debate about its use.
When to use it
Use the HP filter when the goal is to separate a macroeconomic or financial aggregate into a slowly moving trend and a cyclical residual, for example in business cycle measurement or output gap estimation, and when a commonly replicated smoothing setting is needed for comparison across series. Its use rests on the additive trend-plus-cycle decomposition and on choosing lambda to suit the sampling frequency. The filter is designed to remove unit-root components and works best when the series is I(2), so that smoothing the second difference of the stochastic trend is appropriate; check the order of integration of the series before interpreting the cycle. Use it with caution when the series contains structural breaks, or when the end-of-sample trend is central to the question, because end-point estimates are unreliable. Alternatives include the Baxter-King band-pass filter, which approximates an ideal band-pass filter with a symmetric set of weights, STL decomposition, and Kalman-filter-based unobserved components or state-space models.
Limitations and considerations
- Lambda is set by convention rather than estimated from the data, and the amplitude and timing of the extracted cycle can change noticeably with different values. Hodrick and Prescott recommended 1600 for quarterly series and argued that lambda should scale with the square of the sampling frequency, which gives 100 for annual and 14400 for monthly data. Ravn and Uhlig (2001) argued that lambda should scale with the fourth power of the frequency instead.
- The second-difference penalty makes the trend slow to follow an abrupt change in its growth rate; a lower lambda lets it follow such changes, but it also lets the trend absorb more of the cyclical movement.
- Because the two-sided filter uses observations on both sides of each date, trend and cycle estimates at the start and end of the sample rely on asymmetric data and can be revised substantially as new observations arrive.
- The filter has been shown to introduce spurious fluctuations into the irregular component of a series. It works best when the series is I(2), so the extracted cycle for series of other integration orders needs closer scrutiny before it is read as a genuine economic fluctuation.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- The trend is obtained by solving one linear system in closed form, so no iterative optimization is needed and long series are fast to process.
- The lambda parameter adjusts smoothness to the sampling frequency; the conventional settings on this page are 100 for annual, 1600 for quarterly, and 14400 for monthly data.
- Because the trend is one smooth series governed by one parameter, results obtained with the same lambda are easy to compare across countries, periods, and studies.
- The decomposition is additive and transparent: the cycle is simply the data minus the trend, so the cyclical deviations can be inspected directly.
Applications
- Output gap estimation, comparing actual output with a smooth trend as an input to inflation and policy analysis.
- Business cycle measurement and cross-country comparison of cyclical comovements, in the spirit of the original study.
- Potential output measurement, where the trend is used as a proxy for long-run output.
- Financial cycle analysis, such as measuring deviations of the credit-to-GDP ratio from a smooth trend.
- Comparing data cycles with cycles generated by macroeconomic models, as in real business cycle research.
How it works
How it works
Every observed value y_t is expressed as the sum of a trend component tau_t and a cyclical component c_t. This additive decomposition is the structural assumption underpinning the entire method; the two components are not observed separately but are recovered jointly through optimization.
Formula
y_t = \tau_t + c_t, \quad t = 1, \ldots, T
The filter simultaneously minimizes the sum of squared cyclical deviations from the trend and a penalty on the second differences of the trend. The penalty, scaled by lambda, limits how quickly the trend's growth rate can change; a higher lambda forces the trend to evolve more slowly.
Formula
\min_{\{\tau_t\}} \left[ \sum_{t=1}^{T} (y_t - \tau_t)^2 + \lambda \sum_{t=2}^{T-1} \left( (\tau_{t+1} - \tau_t) - (\tau_t - \tau_{t-1}) \right)^2 \right]Because the objective function is quadratic in tau, the minimizer has a closed-form matrix solution. The trend vector is computed as a linear transformation of the observed data vector y via a band-diagonal matrix involving the second-difference operator K and the identity matrix I.
Formula
\hat{\boldsymbol{\tau}} = (\mathbf{I} + \lambda \mathbf{K}'\mathbf{K})^{-1} \mathbf{y}Once the optimal trend vector is extracted, the cyclical component is obtained by simple subtraction. This cycle series captures business-cycle fluctuations and is the quantity of primary interest in most macroeconomic applications such as output gap estimation. The cyclical component places zero weight on the zero frequency, so the filter removes unit-root components and passes mainly fluctuations at or above a given frequency; for this reason it behaves approximately like a high-pass filter.
Formula
\hat{c}_t = y_t - \hat{\tau}_tCommon pitfalls
- Applying the conventional lambda without checking the data frequency. A quarterly value of 1600 applied to annual data over-smooths the trend, because the penalty is effectively calibrated to the wrong time scale.
- Treating end-point trend and cycle estimates as final. In real-time work, the most recent values of the cycle can change considerably when later observations are added.
- Reading periodicity or persistence in the extracted cycle as a structural feature without checking the order of integration of the input series, since the filter can introduce spurious fluctuations and works best for I(2) series.
Frequently asked questions
How do I choose the lambda parameter?
The conventional values are 100 for annual, 1600 for quarterly, and 14400 for monthly data. Hodrick and Prescott recommended 1600 for quarterly series and argued that lambda should scale with the square of the sampling frequency, which yields the annual and monthly values. Ravn and Uhlig (2001) argued that lambda should scale with the fourth power of frequency. These are conventions rather than estimates from the data. If your frequency is non-standard or your research question calls for a different cut-off, report results over a range of lambda values rather than a single setting, and state the choice explicitly.
What is the end-point problem and how can I address it?
Because the HP filter is a two-sided filter, the trend estimates at the start and end of the sample depend on observations that are not yet available at the end of the sample. This creates substantial revisions as new observations arrive. Common remedies include extending the sample with forecasted values before filtering, using one-sided variants of the filter for real-time applications, or using alternatives such as band-pass or unobserved components approaches. Reporting how much the estimates change as the sample is extended is a direct way to show the size of the end-point effect.
Is the HP filter still acceptable given its known limitations?
The filter has been shown to introduce spurious fluctuations into the irregular component of a series, and it works best when the series is I(2). It nonetheless remains widely accepted and common in policy institutions and comparative studies because of its simplicity. Researchers should check the order of integration of their series, test sensitivity to lambda and to the sample end, complement results with other methods such as band-pass or unobserved components models, and avoid strong structural interpretations of the extracted cycle.
Related methods
Sources
Hodrick, R. J., & Prescott, E. C. (1997). Postwar U.S. business cycles: An empirical investigation. Journal of Money, Credit and Banking, 29(1), 1–16.
Open DOI referenceFinancial, Macro and Micro Econometrics Using R, Volume 42 (2020), p. 164
Econometrics in Theory and Practice: Analysis of Cross Section, Time Series and Panel Data with Stata 15.1 (2019), page not recorded in library
Applied Econometric Time Series, 4th Edition, p. 254