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 for details.

initarray_like

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

Returns:
array_like

Filtered array, number of columns determined by x and ar_coeff. If x is a pandas object than a Series 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).


Last update: Dec 23, 2024