cffilter
Syntax
Description
The cffilter
function applies the Christiano-Fitzgerald filter to
separate one or more time series into additive trend and cyclical components.
cffilter
optionally plots the series and trend component, with
cycles removed.
In addition to the Christiano-Fitzgerald filter, Econometrics Toolbox™ supports the Baxter-King (bkfilter
), Hamilton
(hfilter
), and
Hodrick-Prescott (hpfilter
) filters.
[
returns tables or timetables containing variables for the trend and cyclical components
from applying the Christiano-Fitzgerald filter to each variable in an input table or
timetable. To select different variables to filter, use the
TTbl
,CTbl
] = cffilter(Tbl
)DataVariables
name-value argument.
[___] = cffilter(___,
specifies options using one or more name-value arguments in
addition to any of the input argument combinations in previous syntaxes.
Name=Value
)cffilter
returns the output argument combination for the
corresponding input arguments. For example, cffilter(Tbl,Symmetric=true,Drift=[false false
true],DataVariables=1:3)
applies the symmetric Christiano-Fitzgerald filter to
the first three variables in the input table Tbl
, and removes the
linear drift term from the third variable before applying the filter.
cffilter(___)
plots time series variables in the
input data and their respective smoothed trend components (cycles removed), computed by
the Christiano-Fitzgerald filter, on the same axes.
cffilter(
plots on the axes specified by ax
,___)ax
instead of
the current axes (gca
). ax
can precede any of the input
argument combinations in the previous syntaxes.
Examples
Input Arguments
Output Arguments
More About
Tips
The definition of a business cycle in [1]
suggests values in the table for the cutoff periods LowerCutoff
and
UpperCutoff
, and lag length LagLength
that depend
on the periodicity of the data.
Periodicity | LowerCutoff | UpperCutoff | LagLength |
---|---|---|---|
Yearly | 2 | 8 | 3 |
Quarterly | 6 | 32 | 12 |
Monthly | 18 | 96 | 36 |
In practice, use vectors of cutoff periods and lag lengths to test alternatives. Use the
plot produced by cffilter
to compare results among settings.
References
Version History
Introduced in R2023a