statsmodels.tsa.filters.filtertools.recursive_filter

statsmodels.tsa.filters.filtertools.recursive_filter(x, ar_coeff, init=None)[source]

Autoregressive, or recursive, filtering.

Parameters
xarray-like

Time-series data. Should be 1d or n x 1.

ar_coeffarray-like

AR coefficients in reverse time order. See Notes

initarray-like

Initial values of the time-series prior to the first value of y. The default is zero.

Returns
yarray

Filtered array, number of columns determined by x and ar_coeff. If a pandas object is given, a pandas object is returned.

Notes

Computes the recursive filter

y[n] = ar_coeff[0] * y[n-1] + ...
        + ar_coeff[n_coeff - 1] * y[n - n_coeff] + x[n]

where n_coeff = len(n_coeff).