statsmodels.tsa.stattools.levinson_durbin¶
-
statsmodels.tsa.stattools.levinson_durbin(s, nlags=
10, isacov=False)[source]¶ Levinson-Durbin recursion for autoregressive processes.
- Parameters:¶
- s : array_like¶
If isacov is False, then this is the time series. If iasacov is true then this is interpreted as autocovariance starting with lag 0.
- nlags : int, optional¶
The largest lag to include in recursion or order of the autoregressive process.
- isacov : bool, optional¶
Flag indicating whether the first argument, s, contains the autocovariances or the data series.
- Returns:¶
sigma_v (float) – The estimate of the error variance.
arcoefs (ndarray) – The estimate of the autoregressive coefficients for a model including nlags.
pacf (ndarray) – The partial autocorrelation function.
sigma (ndarray) – The entire sigma array from intermediate result, last value is sigma_v.
phi (ndarray) – The entire phi array from intermediate result, last column contains autoregressive coefficients for AR(nlags).
Notes
This function returns currently all results, but maybe we drop sigma and phi from the returns.
If this function is called with the time series (isacov=False), then the sample autocovariance function is calculated with the default options (biased, no fft).