statsmodels.tsa.stattools.pacf_ols(x, nlags=None, efficient=True, adjusted=False)[source]

Calculate partial autocorrelations via OLS.


Observations of time series for which pacf is calculated.

nlagsint, 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).


The partial autocorrelations, (maxlag,) array corresponding to lags 0, 1, …, maxlag.

See also


Partial autocorrelation estimation.


Partial autocorrelation estimation using Yule-Walker.


Partial autocorrelation estimation using Burg”s method.


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.



Box, G. E., Jenkins, G. M., Reinsel, G. C., & Ljung, G. M. (2015). Time series analysis: forecasting and control. John Wiley & Sons, p. 66

Last update: Jun 14, 2024