IRIS Toolbox Reference Manual

hpf

Hodrick-Prescott filter with tunes (aka LRX filter)

Syntax

[T,C,CutOff,Lambda] = hpf(X)
[T,C,CutOff,Lambda] = hpf(X,Range,...)

Syntax with output arguments swapped

[C,T,CutOff,Lambda] = hpf2(X)
[C,T,CutOff,Lambda] = hpf2(X,Range,...)

Input arguments

Output arguments

Options

'infoSet=' [ 1 | 2 ] - Information set assumption used in the filter: 1 runs a one-sided filter, 2 runs a two-sided filter.

Description

The underlying optimisation problem

The function hpf solves a constrained optimisation problem described by the following Lagrangian

$$\min_{\bar y_t, \omega_t, \sigma_t} \underbrace{ \tsum \lambda \left( \Delta \bar y_t - \Delta \bar y_{t-1} \right)^2 + \tsum \gamma_t \left( \bar y_t - y_t \right)^2}_\text{Plain HP with time-varying signal-to-noise ratio} + \cdots$$ $$\cdots + \underbrace{\tsum u_t \left( \bar y_t - a_t \right)^2}_\text{Soft level tunes} + \underbrace{\tsum v_t \left( \Delta \bar y_t - b_t \right)^2}_\text{Soft growth tunes} + \underbrace{\tsum \omega_t \left( \bar y_t - c_t \right)}_\text{Hard level tunes} + \underbrace{\tsum \sigma_t \left( \Delta \bar y_t - d_t \right)}_\text{Hard growth tunes},$$

where

Each of the summations in the above Lagrangian goes over those periods in which the respective bracketed terms are defined (observations or tunes exist). You can combine any number of any tunes in one run of hpf, including out-of-sample tunes (see below).

How to enter the tunes
Out-of-sample tunes

Tunes can be imposed also at dates before the first observation of the input series, or after the last observation. In other words, the time series in 'level=' and/or 'growth=' can have a more extended Range (at either side) than the filtered input series.

Default smoothing parameters

If the user does not specify the smoothing parameter using the 'lambda=' option (or reassigns the default @auto), a default value is used. The default value is based on common practice and can be calculated using the date frequency of the input time series as $\lambda = 100 \cdot f^2$, where $f$ is the frequency (yearly=1, half-yearly=2, quarterly=4, bi-monthly=6, monthly=12). This gives the following default values:

Note that there is no default value for data with indeterminate or daily frequency: for these types of time series, you must always use the option `'lambda=''.

Example