Module ImportFrom alias Import alias identifier ImportFrom alias FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Num Num NameLoad body Expr Str If CompareLt NameLoad Num body Raise Call NameLoad Str Assign NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareEq AttributeLoad NameLoad attr Num body Assign NameStore SubscriptLoad NameLoad ExtSlice Slice Index NameLoad Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr Assign NameStore BinOpDiv BinOpMult Num AttributeLoad NameLoad attr NameLoad Assign NameStore BinOpDiv BinOpMult Num AttributeLoad NameLoad attr NameLoad If NameLoad body Assign NameStore BinOpSub NameLoad BinOpDiv BinOpMult SubscriptLoad Call AttributeLoad NameLoad attr NameLoad ExtSlice Slice Index NameLoad BinOpSub SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num BinOpSub NameLoad Num Assign NameStore Call AttributeLoad NameLoad attr Num BinOpAdd NameLoad Num Assign NameStore BinOpDiv BinOpSub Call AttributeLoad NameLoad attr BinOpMult NameLoad NameLoad Call AttributeLoad NameLoad attr BinOpMult NameLoad NameLoad BinOpMult AttributeLoad NameLoad attr NameLoad Assign NameStore BinOpDiv BinOpSub NameLoad NameLoad AttributeLoad NameLoad attr Assign NameStore SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index TupleLoad NameLoad NameLoad ExtSlice Slice Index NameLoad Assign NameStore Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad For NameStore Call NameLoad NameLoad body Assign NameStore BinOpSub BinOpMult Num SubscriptLoad NameLoad Index Num Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Slice Num BinOpSub UnaryOpUSub NameLoad Num Assign NameStore BinOpSub BinOpSub BinOpSub UnaryOpUSub SubscriptLoad NameLoad Index Num Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Slice Num BinOpSub UnaryOpUSub NameLoad Num Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Slice Num NameLoad NameLoad Assign SubscriptStore NameLoad Index NameLoad BinOpAdd BinOpAdd BinOpAdd BinOpAdd BinOpMult SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index NameLoad Call AttributeLoad NameLoad attr AttributeLoad SubscriptLoad NameLoad Slice Num BinOpSub UnaryOpUSub NameLoad Num attr SubscriptLoad NameLoad Slice BinOpAdd NameLoad Num Num BinOpMult NameLoad SubscriptLoad NameLoad Index Num Call AttributeLoad NameLoad attr AttributeLoad SubscriptLoad NameLoad Slice Num NameLoad attr SubscriptLoad SubscriptLoad NameLoad Slice Num NameLoad Slice Num BinOpMult NameLoad SubscriptLoad NameLoad Index Num Assign NameStore Call AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore TupleLoad NameLoad BinOpSub Call AttributeLoad NameLoad attr NameLoad If CompareIsNot NameLoad NameLoad body Return TupleLoad Call NameLoad NameLoad Call NameLoad NameLoad Return TupleLoad NameLoad NameLoad decorator_list If CompareEq NameLoad Str body Import alias identifier Assign NameStore SubscriptLoad Call AttributeLoad SubscriptLoad AttributeLoad Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr attr Index ListLoad Str Str attr TupleLoad NameLoad Num Slice Num Assign TupleStore NameStore NameStore Call NameLoad NameLoad Num Num keyword NameLoad Assign NameStore SubscriptLoad SubscriptLoad AttributeLoad Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr attr Index Str Slice Num Assign TupleStore NameStore NameStore Call NameLoad NameLoad Num Num keyword NameLoad
N/A statsmodels.compat.python range N/A numpy np _utils _maybe_get_pandas_wrapper cffilter N/A N/A X low high drift N/A 6 32 True N/A N/A 
    Christiano Fitzgerald asymmetric, random walk filter

    Parameters
    ----------
    X : array-like
        1 or 2d array to filter. If 2d, variables are assumed to be in columns.
    low : float
        Minimum period of oscillations. Features below low periodicity are
        filtered out. Default is 6 for quarterly data, giving a 1.5 year
        periodicity.
    high : float
        Maximum period of oscillations. Features above high periodicity are
        filtered out. Default is 32 for quarterly data, giving an 8 year
        periodicity.
    drift : bool
        Whether or not to remove a trend from the data. The trend is estimated
        as np.arange(nobs)*(X[-1] - X[0])/(len(X)-1)

    Returns
    -------
    cycle : array
        The features of `X` between periodicities given by low and high
    trend : array
        The trend in the data with the cycles removed.

    Examples
    --------
    >>> import statsmodels.api as sm
    >>> import pandas as pd
    >>> dta = sm.datasets.macrodata.load_pandas().data
    >>> dates = sm.tsa.datetools.dates_from_range('1959Q1', '2009Q3')
    >>> index = pd.DatetimeIndex(dates)
    >>> dta.set_index(index, inplace=True)

    >>> cf_cycles, cf_trend = sm.tsa.filters.cffilter(dta[["infl", "unemp"]])

    >>> import matplotlib.pyplot as plt
    >>> fig, ax = plt.subplots()
    >>> cf_cycles.plot(ax=ax, style=['r--', 'b-'])
    >>> plt.show()

    .. plot:: plots/cff_plot.py
     N/A N/A low 2 N/A N/A N/A ValueError low must be >= 2 N/A _pandas_wrapper N/A _maybe_get_pandas_wrapper X N/A X N/A N/A np asanyarray X N/A N/A N/A X ndim 1 N/A N/A X N/A X N/A N/A N/A None N/A N/A nobs nseries N/A X shape N/A a N/A N/A 2 N/A np pi high N/A b N/A N/A 2 N/A np pi low N/A drift N/A N/A X N/A X N/A N/A N/A N/A N/A np arange nobs N/A N/A N/A None N/A N/A X N/A -1 N/A X N/A 0 N/A nobs 1 N/A J N/A N/A np arange 1 N/A nobs 1 N/A Bj N/A N/A N/A N/A np sin N/A b J N/A N/A np sin N/A a J N/A N/A np pi J N/A B0 N/A N/A b a N/A np pi N/A Bj N/A N/A N/A np r_ N/A N/A B0 Bj N/A N/A N/A None N/A y N/A N/A np zeros N/A nobs nseries N/A i N/A range nobs N/A N/A B N/A N/A -0.5 N/A Bj N/A 0 N/A N/A np sum N/A Bj N/A 1 N/A N/A i 2 N/A A N/A N/A N/A N/A N/A Bj N/A 0 N/A N/A np sum N/A Bj N/A 1 N/A N/A i 2 N/A N/A np sum N/A Bj N/A 1 i B N/A N/A y N/A i N/A N/A N/A N/A N/A N/A Bj N/A 0 N/A X N/A i N/A N/A np dot N/A N/A Bj N/A 1 N/A N/A i 2 T N/A X N/A N/A i 1 -1 N/A B N/A X N/A -1 N/A N/A np dot N/A N/A Bj N/A 1 i T N/A N/A X N/A 1 i N/A -1 N/A A N/A X N/A 0 N/A y N/A N/A y squeeze N/A N/A cycle trend N/A y N/A N/A N/A X squeeze y N/A N/A _pandas_wrapper None N/A N/A N/A N/A _pandas_wrapper cycle N/A _pandas_wrapper trend N/A N/A cycle trend N/A N/A N/A __name__ __main__ N/A N/A statsmodels sm N/A dta N/A N/A N/A N/A N/A N/A N/A N/A N/A sm datasets macrodata load data N/A N/A infl tbilrate view N/A float 2 N/A 1 N/A N/A cycle trend N/A cffilter dta 6 32 drift True N/A dta N/A N/A N/A N/A N/A N/A N/A sm datasets macrodata load data N/A tbilrate N/A 1 N/A N/A cycle2 trend2 N/A cffilter dta 6 32 drift True