Skip to main content
ExplainerMacroeconomic Modeling· Updated · 5 min read· in Data & Analysis

Setting Lambda in the Hodrick-Prescott Filter to Balance Fit and Smoothness

The Hodrick-Prescott filter relies on a single smoothing parameter to separate macroeconomic trends from business cycles. The mathematical assumptions behind that number dictate whether a dataset reveals a temporary boom or a permanent structural shift.

By Karim Mansour

Share this story

Listen

In short

  • The HP filter uses a smoothing parameter (λ) to balance data fit against trend smoothness.
  • A λ of 1,600 is the universal standard for quarterly macroeconomic data, assuming cycles are 40 times more volatile than trends.
  • Adjusting the parameter for monthly data requires raising the frequency ratio to the fourth power, yielding 129,600.

In 1997, the Journal of Money, Credit and Banking published a paper by economists Robert Hodrick and Edward Prescott that formalized a mathematical operation they had been circulating since 1980. The paper introduced a method to decompose macroeconomic time series into a long-term growth trend and a short-term business cycle.

At the center of their equation was a single smoothing parameter, denoted by the Greek letter lambda (λ), which they set to 1,600 for quarterly data. That specific integer became the default setting in statistical software worldwide, defining the amplitude and duration of business cycles in thousands of subsequent empirical studies.[1]

The Hodrick-Prescott (HP) filter operates as an optimization problem with two competing objectives. The first objective is data fit: the extracted trend line should stay as close to the actual observed data points as possible, minimizing the sum of squared deviations. If this were the only objective, the trend line would simply connect every data point, leaving no cyclical component at all.[1]

The second objective is smoothness: the trend line's growth rate should not change abruptly. The filter measures this by calculating the sum of squared second differences—essentially the acceleration or deceleration of the trend. The λ parameter acts as the exchange rate between these two goals. A λ of zero produces a trend that perfectly matches the raw data. As λ approaches infinity, the penalty for changing the growth rate becomes so severe that the trend becomes a perfectly straight line, forcing all variation into the cyclical component.[1]

Hodrick and Prescott arrived at 1,600 by assuming that the cyclical component of the U.S. economy is 40 times more volatile than the growth rate of its underlying trend. Because the parameter operates on squared deviations, squaring 40 yields 1,600. This assumption fit the postwar U.S. gross domestic product data they analyzed, extracting business cycles that lasted between four and eight years—matching the National Bureau of Economic Research's historical definitions.[1]

The mathematical consensus fractured when researchers applied the filter to data collected at different frequencies. In 2002, The Review of Economics and Statistics published a paper by Morten Ravn and Harald Uhlig addressing how to adjust λ for annual or monthly data. While earlier researchers had simply divided or multiplied 1,600 by four—using 400 for annual data and 4,800 for monthly—Ravn and Uhlig demonstrated that the frequency adjustment must be raised to the fourth power.[2]

Under the Ravn-Uhlig rule, the correct λ for annual data is 1,600 multiplied by the fourth power of one-quarter, which equals 6.25. For monthly data, the calculation multiplies 1,600 by the fourth power of three, yielding 129,600. This fourth-power adjustment ensures that the filter isolates the exact same cyclical frequencies regardless of how often the data is sampled, preserving the four-to-eight-year business cycle definition across different datasets.[2]

Software implementations of the filter forced users to navigate these competing mathematical rules. The documentation for Stata's tsfilter hp command notes that while it defaults to 1,600 for quarterly data and 6.25 for annual data, it applies a value of 14,400 for monthly data—a figure derived from a linear adjustment method rather than the fourth-power rule.

Users who want the Ravn-Uhlig monthly adjustment must manually override the software to specify 129,600. IBM's SPSS Statistics similarly requires users to manually input the λ value, leaving the mathematical burden entirely on the analyst.[4][5]

The reliance on a fixed smoothing parameter eventually triggered a severe methodological backlash. In 2018, economist James Hamilton published a paper in The Review of Economics and Statistics with an unambiguous title: "Why You Should Never Use the Hodrick-Prescott Filter." Hamilton argued that the filter's mathematical structure fundamentally distorts the underlying data, regardless of which λ value is chosen.[3]

Hamilton's primary critique centers on how the filter handles random walks—series where each value is simply the previous value plus a random shock, which characterizes many financial and macroeconomic datasets. He demonstrated that applying the HP filter to a pure random walk generates artificial cycles. "I show that the HP filter introduces spurious dynamic relations that have no basis in the underlying data-generating process," Hamilton wrote, quantifying that these phantom cycles can account for a significant percentage of the variance in the filtered data.[3]

Critics note that applying the HP filter to a random walk generates artificial wave patterns that do not exist in the underlying data.

The filter also suffers from a documented end-point problem. Because the smoothing penalty relies on the second difference—which requires a previous, current, and future data point—the filter cannot calculate the penalty symmetrically at the very beginning or the very end of a dataset. As a result, the trend line becomes highly sensitive to the final few observations.[3]

If an economy experiences a sudden shock in the most recent quarter, the HP filter will aggressively pull the entire recent trend line toward that shock. This mathematical artifact mischaracterizes a temporary drop as a permanent structural decline, which can mislead central banks evaluating real-time data during a crisis.[3][6]

The filter's inability to calculate symmetric penalties at the end of a dataset causes the trend line to overreact to the most recent observations.

To resolve these distortions, Hamilton proposed an alternative approach based on a simple linear regression of the variable on its own historical values, shifted forward by a specific horizon—typically two years for macroeconomic data. This regression approach requires no arbitrary smoothing parameter, relies only on data available at the time of the observation, and does not generate spurious cycles when applied to random walks.[3]

The debate over λ illustrates the broader tension in macroeconomic data analysis between theoretical purity and empirical utility. A smoothing parameter of 1,600 is not a physical constant of the global economy; it is a mathematical assumption about the variance of shocks. When researchers alter that single integer, they redefine the boundary between a temporary cyclical fluctuation and a permanent change in the trajectory of a nation's wealth.[6]

Jargon, explained

Smoothing Parameter (λ)
The mathematical penalty applied to changes in the growth rate of a trend line, determining how stiff or flexible the line is.
Spurious Cycle
An artificial wave pattern generated by a statistical filter rather than the underlying data.
End-Point Bias
The tendency of a smoothing filter to become highly sensitive to the final few observations in a dataset because it lacks future data to anchor the trend.
Random Walk
A time series where each value is simply the previous value plus a random, unpredictable shock.

Competing readings

The Standardization Camp

Researchers who prioritize comparability across decades of macroeconomic literature.

For many empirical macroeconomists, the exact value of λ is less important than the fact that everyone uses the same number. A universal standard of 1,600 for quarterly data allows researchers to compare the amplitude of business cycles across different countries and different eras without worrying that the results are simply an artifact of different smoothing choices. In this view, the HP filter is a standardized lens rather than a perfect representation of reality.

The Spurious Cycle Critics

Statisticians who argue the filter's mathematical structure creates illusions in the data.

Critics following James Hamilton's 2018 framework point out that macroeconomic data often behaves like a random walk. When the HP filter is applied to a random walk, the mathematics of the second-difference penalty inherently generate a wave-like cyclical component. These critics argue that researchers using the HP filter are often studying the mathematical echo of their own smoothing parameter rather than actual economic phenomena.

The Frequency Adjusters

Methodologists focused on preserving the filter's properties across different sampling rates.

The Ravn-Uhlig adjustment camp focuses on the spectral properties of the filter. They argue that if a business cycle is defined as lasting four to eight years, the filter must be calibrated to isolate that exact frequency band regardless of whether the data is collected every month, quarter, or year. Their fourth-power rule is a mathematical proof designed to ensure that the definition of a business cycle remains invariant to the data collection schedule.

Traditional Macroeconomists 40%Time-Series Skeptics 40%Software Implementers 20%
Traditional Macroeconomists
Value the HP filter for its intuitive separation of trend and cycle, accepting the 1,600 parameter as a useful and established standard.
Time-Series Skeptics
Argue the filter introduces spurious cycles and end-point bias, advocating for regression-based alternatives.
Software Implementers
Focus on providing standardized, computationally efficient tools, often locking in specific parameter defaults that shape downstream research.

Perspectives this story doesn't cover

  • Central Bank Forecasters

Sources

Source coverage

6 outlets

3 viewpoints surfaced

Traditional Macroeconomists 40%Time-Series Skeptics 40%Software Implementers 20%
  1. [1]Journal of Money, Credit and BankingTraditional Macroeconomists

    Postwar U.S. Business Cycles: An Empirical Investigation

    Read on Journal of Money, Credit and Banking →
  2. [2]The Review of Economics and StatisticsTime-Series Skeptics

    On Adjusting the Hodrick-Prescott Filter for the Frequency of Observations

    Read on The Review of Economics and Statistics →
  3. [3]The Review of Economics and StatisticsTime-Series Skeptics

    Why You Should Never Use the Hodrick-Prescott Filter

    Read on The Review of Economics and Statistics →
  4. [4]IBMSoftware Implementers

    Time Series Filters: Options

    Read on IBM →
  5. [5]StataSoftware Implementers

    tsfilter hp — Hodrick–Prescott time-series filter

    Read on Stata →
  6. [6]Factlen Editorial Team

    Synthesis by Factlen editorial team

    Read on Factlen Editorial Team →
Listen

Comments

Stay informed

Every angle. Every day.

Get Data & Analysis stories with full source coverage and perspective breakdowns, free every day.