statsmodels.tsa.filters.filtertools.recursive_filter¶
- statsmodels.tsa.filters.filtertools.recursive_filter(x, ar_coeff, init=None)[source]¶
Autoregressive, or recursive, filtering.
- Parameters:
x (array_like) – Time-series data. Should be 1d or n x 1.
ar_coeff (array_like) – AR coefficients in reverse time order. See Notes for details.
init (array_like) – Initial values of the time-series prior to the first value of y. The default is zero.
- Returns:
Filtered array, number of columns determined by x and ar_coeff. If x is a pandas object than a Series is returned.
- Return type:
array_like
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).