statsmodels.tsa.stattools.innovations_algo

statsmodels.tsa.stattools.innovations_algo(acov, nobs=None, rtol=None)

Innovations algorithm to convert autocovariances to MA parameters.

Parameters:
acovarray_like

Array containing autocovariances including lag 0.

nobsint, optional

Number of periods to run the algorithm. If not provided, nobs is equal to the length of acovf.

rtolfloat, optional

Tolerance used to check for convergence. Default value is 0 which will never prematurely end the algorithm. Checks after 10 iterations and stops if sigma2[i] - sigma2[i - 10] < rtol * sigma2[0]. When the stopping condition is met, the remaining values in theta and sigma2 are forward filled using the value of the final iteration.

Returns:
thetandarray

Innovation coefficients of MA representation. Array is (nobs, q) where q is the largest index of a non-zero autocovariance. theta corresponds to the first q columns of the coefficient matrix in the common description of the innovation algorithm.

sigma2ndarray

The prediction error variance (nobs,).

See also

innovations_filter

Filter a series using the innovations algorithm.

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)

Last update: Dec 16, 2024