Loading...

Plus+ Python

How to Calculate Partial Autocorrelation (PACF) using Python

How to Calculate Partial Autocorrelation (PACF) using Python

What is Partial Autocorrelation
Extending from our previous discussion of autocorrelation, partial autocorrelation (PACF) measures the correlation between two time series observations after partialling out the intervening correlations. So any correlation found in PACF between lags is isolated between the current window series and lag. For example, PACF with a lag of 4 measures the correlation specific to current value and 4 periods prior; after accounting for and removing periods 2 & 3. More in depth understanding for partial autocorrelation and autocorrelation in general can be found here.

Interpreting Results
Most academic literature would suggest using the PACF to inform the "order of the model" to be used if it is an autoregressive (AR) model (or by extension, ARIMA model for timeseries). Interpreting the below graph shows that after the 4th lag, all of the others are not statistically significant as they are outside of the 95% confidence intervals. Therefore, the PACF would suggest that we use an AR model with an order of 4.



Plus+ membership required

Create a Plus+ account to view the live codebase.

This article has a fully working, notebook-ready code block. Sign up for Plus+ to access it and the rest of the 20+ premium articles.

Subscribe to Plus+ Browse Plus+ articles