Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Auto correlation Function (ACF) and Partial Auto correlation Function (PACF)

Ritu Santra
4 min readMay 26, 2023

--

Image Source

Auto correlation Function (ACF)

Auto-correlation is the correlation between a time series and a delayed version of itself (lag). It represents a correlation coefficient between the time series and its lag values.

Auto correlation Function (ACF) plots the correlation coefficient against the lag, and it’s a visual representation of autocorrelation.

For example, ACF at lag 3 is calculated as the correlation between the time series (Yt) and the same time series lagged by 3 time periods (Yt-3). In this way, the correlation is estimated at every lag and plotted on a graph showing the correlation coefficient at each lag.

The correlation coefficient is measured either by Pearson’s correlation coefficient or by Spearman’s rank correlation coefficient.

The correlation coefficient can range from -1 (a perfect negative relationship) to +1 (a perfect positive relationship). A coefficient of 0 means that there is no relationship between the variables.

The autocorrelation function starts a lag 0, which is the correlation of the time series with itself and therefore results in a correlation of 1.

Note: ACF includes both direct and indirect effects through the intermediary time periods.

Image Source

Partial Auto correlation Function (PACF)

A partial autocorrelation function captures a direct correlation between time series and a lagged version of itself.

For example, if we’re regressing a signal S at lag t (St) with the same signal at lags t-1, t-2 and t-3 (St-1, St-2, St-3), the partial correlation between St and St-2 is the amount of correlation between St and St-3 that isn’t explained by their mutual correlations with St-1 and St-2.

To find PACF between St and St-3 we use regression model,

Here, ϕ3 is the PACF at lag 3;

ϕ1, ϕ2 and ϕ3 are coefficients and Є is error.

From the regression formula above, the PACF value between St and St-3 is the coefficient ϕ3. This coefficient will give us direct effect of time-series St-3 to the time-series St because the effects of St-2 and St-1 are already captured by ϕ1 and ϕ2.

The PACF graph is constructed by plotting all the values of PACF obtained from regressions at different lags.

Note: PACF includes only direct effect and it does not consider the indirect effects.

Image Source

Importance of ACF and PACF

ACF and PACF graphs are used to find out the order of AR and MA component of an ARIMA model.

If the ACF graph is declining and there are a few significant lags in the PACF, then this indicates the process is AR (Auto-regressive). We can select the order p for AR(p) model based on significant spikes from the PACF plot. Spikes those are outside the blue boundary of the PACF plot tell us the order of the AR model.

If the PACF graph is declining and there are a few significant lags in the ACF, then this indicates the process is MA (Moving average). We can select the order q for MA(q) model based on significant spikes from the ACF plot. Spikes those are outside the blue boundary of the ACF plot tell us the order of the MA model.

The blue area in the ACF and PACF graphs indicated 95% confidence interval and it is an indictor of significance threshold. Anything within the are is statistically close to zero and anything outside is statistically non-zero.

To determine the order of the model, we have to consider the spikes which are outside the significance threshold (blue area).

References

Happy Learning! Cheers!

If you find my articles helpful, don’t forget to tap the clap button to show your support and save the articles for future reference.

--

--

Ritu Santra

Business Analyst @Cognizant | Expert in Advanced SQL, Python, Power BI, Statistics | Data Analytics | Data Science | Business Intelligence