NxHP - Hodrick-Prescott Filter

Computes the cyclical component of a given time series using the Hodrick–Prescott filter.

Syntax

NxHP(X, Order, Lambda, Freq)
X
is the univariate time series data (a one-dimensional array of cells (e.g., rows or columns)).
Order
is the time order in the data series (i.e., the first data point's corresponding date (earliest date = 1 (default), latest date = 0)).
Order Description
1 ascending (the first data point corresponds to the earliest date) (default)
0 descending (the first data point corresponds to the latest date)
Lambda
is the multiplier used to penalize the variation in the trend component. If missing, a default is used based on the data frequency.
Freq
is the frequency of the input time series (1 = quarterly (default), 2 = annual, 3 = monthly).

Remarks

  1. The time series is homogeneous or equally spaced.
  2. The time series may include missing values (e.g., #N/A) at either end.
  3. If lambda and data frequency are missing, a default value of 1600 is used.
  4. The Hodrick–Prescott filter is a mathematical tool used to separate the cyclical component of a time series from raw data:

    $$ y_t = c_t + \tau_t $$

    Where:
    • $ t=1,2,\cdots , T$.
    • $y_t$ is the input time series.
    • $c_t$ is the cyclical component.
    • $\tau_t$ is the trend component.
  5. Hodrick and Prescott (1997) suggest the following criterion to reveal the unobserved components, $\tau_t$ and $c_t$, conditional on a choice of "smoothing parameter" $\lambda$:

    $$\min_{\tau}\left(\sum_{t = 1}^T {(y_t - \tau _t )^2 } + \lambda \sum_{t = 2}^{T - 1} {[(\tau _{t+1} - \tau _t) - (\tau _t - \tau _{t - 1} )]^2 }\right)$$
  6. An expert judgment for the choice of λ is necessary. Generally, the closer λ is to zero, the closer the filtered trend is to the original series. Likewise, if λ approaches infinity, the filtered trend becomes a straight line.
  7. Hodrick and Prescott proposed a default value for the smoothing parameter: 1600 for quarterly data, 100 for annual data, and 14400 for monthly data.
  8. The Hodrick–Prescott filter is used to obtain a smoothed-curve representation of a time series, one that is more sensitive to long-term than to short-term fluctuations.
  9. The HP filter is a fast and easy-to-use alternative to other techniques, such as the production function approach or the Kalman filter.
  10. Proper seasonal adjustment should be carried out before HP filtering. 
  11. HP Analysis is purely historical and static (closed domain). The filter causes misleading predictions when used dynamically since the algorithm changes (during iteration for minimization) the past state (unlike a moving average) of the time series to adjust for the current state, regardless of the size of $\lambda$ used.

Files Examples

Related Links

References

  • Hodrick, R., Prescott, E. (1997): "Postwar U.S. Business Cycles: An Empirical Investigation", Journal of Money, Credit, and Banking, 29(1), pp. 1-16.
  • Beveridge, S., Nelson, C. R. (1981): "A New Approach to Decomposition of Economic Time Series into Permanent and Transitory Components with Particular Attention to Measurement of the Business Cycle", Journal of Monetary Economics, No. 7, pp. 151-174
  • Hamilton, J .D.; Time Series Analysis , Princeton University Press (1994), ISBN 0-691-04289-6
  • Tsay, Ruey S.; Analysis of Financial Time Series John Wiley & SONS. (2005), ISBN 0-471-690740

Comments

Article is closed for comments.

Was this article helpful?
1 out of 1 found this helpful