statsmodels.tsa.stattools.innovations_filter

statsmodels.tsa.stattools.innovations_filter(endog, theta)[source]

Filter observations using the innovations algorithm

Parameters
endogarray-like

The time series to filter (nobs,). Should be demeaned if not mean 0.

thetandarray

Innovation coefficients of MA representation. Array must be (nobs, q) where q order of the MA.

Returns
residndarray

Array of filtered innovations

See also

innovations_algo

References

*

Brockwell, P.J. and Davis, R.A., 2016. Introduction to time series and forecasting. Springer.

Examples

>>> import statsmodels.api as sm
>>> data = sm.datasets.macrodata.load_pandas()
>>> rgdpg = data.data['realgdp'].pct_change().dropna()
>>> acov = sm.tsa.acovf(rgdpg)
>>> nobs = activity.shape[0]
>>> theta, sigma2  = innovations_algo(acov[:4], nobs=nobs)
>>> resid = innovations_filter(rgdpg, theta)