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

Calculate partial autocorrelations via OLS

x1d array

observations of time series for which pacf is calculated


Number of lags for which pacf is returned. Lag 0 is not returned.

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.

unbiasedbool, optional

Adjust each partial autocorrelation by n / (n - lag)

pacf1d array

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


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