cffilter
Syntax
Description
Separate one or more time series into additive trend and cyclical components by
applying the Christiano-Fitzgerald filter
[2]. 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 the additive trend Trend
,Cyclical
] = cffilter(Y
)Trend
and cyclical
Cycilcal
components from applying the Christiano-Fitzgerald
filter to each variable (column) of the input matrix of time series data
Y
, using the definition of a business cycle in [1] for quarterly data.
[
returns the tables or timetables TTbl
,CTbl
] = cffilter(Tbl
)TTbl
and CTbl
containing variables for the trend and cyclical components, respectively, from applying
the Christiano-Fitzgerald filter to each variable in the input table or timetable
Tbl
. To select different variables in Tbl
to
filter, use the 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