statsmodels.tsa.stattools.pacf_ols¶
- statsmodels.tsa.stattools.pacf_ols(x, nlags=None, efficient=True, adjusted=False)[source]¶
Calculate partial autocorrelations via OLS.
- Parameters:
- xarray_like
Observations of time series for which pacf is calculated.
- nlags
int
,optional
Number of lags to return autocorrelation for. If not provided, uses min(10 * np.log10(nobs), nobs - 1).
- efficientbool,
optional
If true, uses the maximum number of available observations to compute each partial autocorrelation. If not, uses the same number of observations to compute all pacf values.
- adjustedbool,
optional
Adjust each partial autocorrelation by n / (n - lag).
- Returns:
ndarray
The partial autocorrelations, (maxlag,) array corresponding to lags 0, 1, …, maxlag.
See also
statsmodels.tsa.stattools.pacf
Partial autocorrelation estimation.
statsmodels.tsa.stattools.pacf_yw
Partial autocorrelation estimation using Yule-Walker.
statsmodels.tsa.stattools.pacf_burg
Partial autocorrelation estimation using Burg”s method.
Notes
This solves a separate OLS estimation for each desired lag using method in [1]. Setting efficient to True has two effects. First, it uses nobs - lag observations of estimate each pacf. Second, it re-estimates the mean in each regression. If efficient is False, then the data are first demeaned, and then nobs - maxlag observations are used to estimate each partial autocorrelation.
The inefficient estimator appears to have better finite sample properties. This option should only be used in time series that are covariance stationary.
OLS estimation of the pacf does not guarantee that all pacf values are between -1 and 1.
References
[1]Box, G. E., Jenkins, G. M., Reinsel, G. C., & Ljung, G. M. (2015). Time series analysis: forecasting and control. John Wiley & Sons, p. 66