statsmodels.tsa.stattools.innovations_filter¶
- statsmodels.tsa.stattools.innovations_filter(endog, theta)¶
Filter observations using the innovations algorithm.
- Parameters:
endog (array_like) – The time series to filter (nobs,). Should be demeaned if not mean 0.
theta (ndarray) – Innovation coefficients of MA representation. Array must be (nobs, q) where q order of the MA.
- Returns:
Array of filtered innovations.
- Return type:
ndarray
See also
innovations_algoConvert autocovariances to MA parameters.
References
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)