statsmodels.tsa.stattools.pacf_ols¶
-
statsmodels.tsa.stattools.
pacf_ols
(x, nlags=40, efficient=True, unbiased=False)[source]¶ Calculate partial autocorrelations via OLS
- Parameters
- x1d array
observations of time series for which pacf is calculated
- nlagsint
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)
- Returns
- pacf1d array
partial autocorrelations, (maxlag,) array corresponding to lags 0, 1, …, maxlag
See also
statsmodels.tsa.stattools.pacf
,statsmodels.tsa.stattools.pacf_yw
,statsmodels.tsa.stattools.pacf_burg
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