Transformer
CFFilter
Filter a times series using the Christiano Fitzgerald filter.
This is a wrapper around the cffilter function from statsmodels. (see statsmodels.tsa.filters.cf_filter.cffilter).
Schnellstart
python
from sktime.transformations.cffilter import CFFilter
estimator = CFFilter(low=6, high=32, drift=True)Tags
Fähigkeiten
- Multivariat
- Reihen ungleicher Länge
- Inverse Transformation: Nicht unterstützt
- Fehlende Werte: Nicht unterstützt
- Entfernt fehlende Werte: Nicht unterstützt
- Gleicht Reihenlängen an: Nicht unterstützt
Eigenschaften
- Eingabetypscitype:transform-input
- Series
- Ausgabetypscitype:transform-output
- Series
- Label-Typscitype:transform-labels
- None
- Fit ist leerfit_is_empty
- Ja
- Behält den Zeitindextransform-returns-same-time-index
- Nein
- Benötigt Xrequires_X
- Ja
- Benötigt yrequires_y
- Nein
- X und y brauchen denselben IndexX-y-must-have-same-index
- Nein
Parameter(3)
- lowfloat, optional, default = 6.0
- Minimum period of oscillations. Features below low periodicity are filtered out. For quarterly data, the default of 6 gives 1.5 years periodicity.
- highfloat, optional, default = 32.0
- Maximum period of oscillations. Features above high periodicity are filtered out. For quarterly data, the default of 32 gives 8 year periodicity.
- driftbool, optional, default = True
- Whether or not to subtract a trend from the data. The trend is estimated as np.arange(nobs)*(x[-1] -x[0])/(len(x)-1). > X: argument of CFFilter._transform() > x: If X is 1d, X=x. If 2d, x is assumed to be in columns. > nobs: len(x)
Beispiele
>>> from sktime.transformations.cffilter import CFFilter
>>> import pandas as pd
>>> import statsmodels.api as sm
>>> dta = sm. datasets. macrodata. load_pandas (). data
>>> index = pd. date_range (start = '1959Q1', end = '2009Q4', freq = 'Q')
>>> dta. set_index (index, inplace = True)
>>> cf = CFFilter (6, 24, True)
>>> cycles = cf. fit_transform (X = dta [['realinv' ]])