## Why is the Hodrick-Prescott filter often inappropriate?

The Hodrick-Prescott (HP) filter is the optimal estimator of the trend component in a smooth trend model with signal-to-noise ratio parameter fixed at 1/1600. It gives the detrended observations, $X_{t}$,  for large samples and t not near the beginning or end of the series

$\displaystyle X_{t}= \left[ \frac{(1-L)^{2}(1-L^{-1})^{2}}{\bar{q}_{\zeta}+ (1-L)^{2}(1-L^{-1})^{2}}\right] Y_{t}$

where $\bar{q}_{\zeta}= \sigma_{\zeta}^{2} / \sigma_{\epsilon}^{2}$.

Bear in mind that if the  smooth trend model was believed to be the true model there would be no reason to apply the HP filter. The filtered data of a smooth trend model contain nothing more than white noise. The belief here is clearly different.

We can easily show that the gain from the detrending filter is given by:

$G(\lambda) = \frac{4(1-cos \lambda)^{2}}{\bar{q}_{\zeta}+4(1-cos \lambda)^{2}} = \frac{16sin^{4}( \lambda /2)}{\bar{q}_{\zeta}+16sin^{4}( \lambda /2)}$

Note that the smaller the ${\bar{q}_{\zeta}}$ the more the filter concentrates on removing low frequencies.

Gain for HP filter

Suppose the series are integrated e.g. $ARIMA(p,d,q)$ then

$X_{t} = \left[ \frac{(1-L)^{2-d}(1-L^{-1})^{2}}{\bar{q}_{\zeta}+ (1-L)^{2}(1-L^{-1})^{2}}\right]\frac{\theta (L)}{\phi (L)} \xi_{t}$

${X_{t}}$ stationary for ${d\leq4}$

Then the autocovariance generating function of the series is given by:

$\displaystyle g^{*}(L)= \left[ \frac{(1-L)^{4-d}(1-L^{-1})^{4-d}}{[\bar{q}_{\zeta}+ (1-L)^{2}(1-L^{-1})^{2}]^{2}}\right]g_{Y}(L)$

Hence if ${X_{t}}$ is a random walk the spectrum of the detrended series is given by

$\displaystyle f^{*}(\lambda)= \frac{1}{2 \pi}\frac{8(1-cos \lambda)^{3}}{[\bar{q}_{\zeta}+4(1-cos \lambda)^{2}]^{2}}\sigma^{2}_{\eta} =\frac{1}{2 \pi}\frac{64sin^{6}(\lambda/2)}{[\bar{q}_{\zeta}+16sin^{4} (\lambda / 2)]^{2}}\sigma^{2}_{\eta}$

Spectrum of HP detrended random walk.

This spectrum has got a peak at ${\lambda_{max}=cos^{-1}(1-\sqrt{0.75\bar{q}_{\zeta}})}$ which for signal-to-noise ratio fixed at 1/1600 corresponds to a period of about thirty. Thus applying the HP filter to a random walk generates detrended observations which have the characteristics of a business cycle for quarterly observations!
̄

——————————————————————————————————————————————

An example:

#Simulates random walk
x<- cumsum(rnorm(80))
# Plots Trend and Cyclical of HP - requires package mFilter
plot(hpfilter(x,type="lambda",freq=1600))


Harvey, A. C. and Jaeger, A. (1993), Detrending, stylized facts and the business cycle. Journal of Applied Econometrics, 8: 231–247

## 7 thoughts on “Why is the Hodrick-Prescott filter often inappropriate?”

1. manblogg says:

You don’t happen to work as a quant in a hedgefund or IB do you? 🙂

2. David says:

For a given sampling frequency (monthly, quarterly, etc.) is there a functional relationship between lambda and omega-star, where omega-star is the peak frequency from, say, a periodogram? I’m new to spectral analysis. It would seem that if we new a monthly time series had a n-month cycle that lambda should be set to x(n).

• epanechnikov says:

Hi David and thanks for your message. The sample periodogram allows us to get statistical inference (i.e. estimates) for a time-series based on their frequency domain properties. It essentially captures the portion of the sample variance of the series that can be attributed to a continuum of frequencies (or the contribution made by various periodic components). Bear however in mind that regular cycles are quite rare (especially in economic time series) and hence what we look for is a tendency towards cyclical movements centred around particular frequencies.

Now ω* (omega-star) is an estimate of the λ_max/2π since the periodogram is the sample equivalent of 2πf(λ). Assume that the periodogram gives you peak frequency at ω*=1/n (note that for discrete time points ω* max =.5 – half cycles per observation – since we need at least two points to determine a cycle). That would suggest the existence of a cycle of period n (i.e. at λ_max = 2π/n). However as I have highlighted here some linear filters (such as the HP) can potentially create spurious cycles. Apply the HP on I(1) (quarterly) time series and what your see in your periodogram is the standard 7+ year business cycles.

3. Fred says:

I think you have omitted the main drawback of HP filter, which is that it gives volatile results on a rolling window

• epanechnikov says:

You are right Fred. Although HP is very efficient in the middle, it is much less efficient at the end – see for example Harvey and Delle Monache (JEDC, 2009). There is much bigger increase in MSE at the end of the series as compared with the middle.

But here I focused on one of the less known attributes of the filter. The Yule-Slutzky effect.

4. David says:

This is very helpful. Can you please suggest a reference (book, paper) that shows the mathematical details of the connection between omega-star and lambda?

• epanechnikov says:

Brockwell and Davis (2009 – yellow book, ch4, 10) and Shumway and Stoffer (2000, ch4) are two good references. Harvey (1993) is also good but it is less rigorous