Include Top

Autocorrelation (ACF/PACF) Plots


    Chemical Process Concentration - Series A

  1. Open Chemical Process Concentration – Series A.xlsx (Sheet 1 tab). This is the Series A data from Box and Jenkins, a set of 197 concentration values from a chemical process taken at two hour intervals.
  2. Click SigmaXL > Time Series Forecasting > Utilities > Lag Data. Ensure that the entire data table is selected. If not, check Use Entire Data Table. Click Next.
  3. Select Concentration, click Numeric Time Series Data (Y) >>. Use the default Number of Lags = 1.


    Autocorrelation1

  4. Click OK. A new sheet is created with the Lag 1 data.

    Autocorrelation2
  5. Click Recall SigmaXL Dialog menu or press F3 to recall last dialog. Enter Lag = 2. Click OK. Repeat for Lag = 3. The Lag columns are appended as shown:

    Autocorrelation2
  6. Click SigmaXL > Graphical Tools > Scatter Plot Matrix. Ensure that the entire data table is selected. If not, check Use Entire Data Table. Click Next.
  7. Select all four columns, click Numeric Data Variables (Y) >>. Check Display Trendline.

    Autocorrelation3
  8. Click OK. The Scatterplots for Lag 1 to 3 are produced, showing a positive trend, so positive autocorrelation.

    Autocorrelation3
  9. Click the Lag Data sheet tab. Click SigmaXL > Statistical Tools > Correlation Matrix. Ensure that the entire data table is selected. If not, check Use Entire Data Table. Click Next.
  10. Select all four columns, click Numeric Data Variables (Y) >>.

    Autocorrelation3
  11. Click OK. The Correlation Coefficient Matrix is produced.

    Autocorrelation3
    Lag 1 correlation is .57, Lag 2 is .5, and Lag 3 is .41. The correlations in red (and bolded P-Values) indicates that the correlations are significant.

  12. Now we will create the ACF/PACF plots. Click the Sheet 1 tab. Click SigmaXL > Time Series Forecasting > Autocorrelation (ACF/PACF) Plots. Ensure that the entire data table is selected. If not, check Use Entire Data Table. Click Next.
  13. Select Concentration, click Numeric Time Series Data (Y) >>. Use the default Automatic Number of Lags. Seasonal Frequency = 1. Alpha Level = 0.05.

    Autocorrelation3
  14. Click OK. The ACF and PACF plots are produced.

    Autocorrelation3
    Hover the mouse cursor on the Lag 1 ACF bar to view the correlation value = .57, Lag 2 = 0.5, and Lag 3 = .4. The values are approximately the same as those obtained manually (with some minor differences in how the correlations are calculated).

    The lags that exceed the significance limit lines are statistically significant at alpha = 0.05, so there is an autocorrelation structure in the data which can be modeled using Exponential Smoothing or ARIMA.

  15. The slow decrease in the ACF as the lags increase is due to the non-stationarity, so we will now compare to the differenced data. Select the Difference Data sheet (or recreate using SigmaXL > Time Series Forecasting > Utilities > Difference Data, with Nonseasonal Differencing (d) = 1).
  16. Redo the ACF/PACF Plots for the differenced data:

    Autocorrelation3
    After differencing Lag 1 now shows a negative autocorrelation, but Lag 2 and following have insignificant autocorrelations and small partial autocorrelations. This is in agreement with the results in Box and Jenkins (2016, pp.185-186) who also suggest that, after differencing, the model might be a moving average of order 1. We will examine this later in ARIMA Forecasting.

    Monthly Airline Passengers - Series G

  17. Open Monthly Airline Passengers - Series G.xlsx (Sheet 1 tab). This is the Series G data from Box and Jenkins, monthly total international airline passengers for January 1949 to December 1960.
  18. Click SigmaXL > Time Series Forecasting > Autocorrelation (ACF/PACF) Plots. Ensure that the entire data table is selected. If not, check Use Entire Data Table. Click Next.
  19. Select Ln(Airline Passengers), click Numeric Time Series Data (Y) >>. Select Automatic Number of Lags. Specify Seasonal Frequency = 12 and Alpha Level = 0.05.

    Autocorrelation3
    The automatic number of lags will be (a minimum of) Seasonal Frequency * 3 = 36 allowing us to see seasonal patterns in the ACF.

  20. Click OK. The ACF and PACF plots are produced.

    Autocorrelation3
    The slow decrease in the ACF as the lags increase is due to the trend, while the “scalloped” shape is due to the seasonality.

  21. We will now compare to the differenced data for Ln(Airline Passengers). Select the Difference Data sheet (or recreate using SigmaXL > Time Series Forecasting > Utilities > Difference Data, with Nonseasonal Differencing (d) = 1 and Seasonal Differencing (D) = 1 with Seasonal Frequency = 12).
  22. Redo the ACF/PACF Plots for the differenced data:

    Autocorrelation3
    After nonseasonal and seasonal differencing, Lag 1 now shows a negative autocorrelation, but Lag 2 and following have mostly insignificant autocorrelations and partial autocorrelations. Lag 12 is due to the seasonality. This is in agreement with the results in Box and Jenkins (2016, Chapter 9, “Analysis of Seasonal Time Series”, p. 319) who also suggest that, after differencing, the model might be a moving average of order 1 and seasonal moving average of order 1. We will examine this later in ARIMA Forecasting.

    Daily Electricity Demand with Predictors – ElecDaily

  23. Open Daily Electricity Demand with Predictors – ElecDaily.xlsx (Sheet 1 tab). This is daily electricity demand (GW) for the state of Victoria, Australia, every day during 2014 (Hyndman, fpp2). This data has a seasonal frequency = 7 (observations per week).
  24. Click SigmaXL > Time Series Forecasting > Autocorrelation (ACF/PACF) Plots. Ensure that the entire data table is selected. If not, check Use Entire Data Table. Click Next.
  25. Select Demand, click Numeric Time Series Data (Y) >>. Select Automatic Number of Lags. Specify Seasonal Frequency = 7 and Alpha Level = 0.05.

    Autocorrelation3
  26. Click OK. The ACF and PACF plots are produced.

    Autocorrelation3
    Here we can see the 7-day seasonal pattern. We will not do manual differencing for this example, but the automatic ARIMA algorithm will do a nonseasonal difference (d) = 1 and leave the seasonal differencing (D) = 0.

    Sales with Indicator - Modified Series M

  27. Open Sales with Indicator - Modified Series M.xlsx. (Sheet 1 tab). This is modified Series M data from Box and Jenkins, with 50 quarters of corporate sales values along with a leading indicator. The data is treated as nonseasonal, as done in Box and Jenkins.
  28. Click SigmaXL > Time Series Forecasting > Autocorrelation (ACF/PACF) Plots. Ensure that the entire data table is selected. If not, check Use Entire Data Table. Click Next.
  29. Select Sales, click Numeric Time Series Data (Y) >>. Select Automatic Number of Lags. Specify Seasonal Frequency = 1 and Alpha Level = 0.05.

    Autocorrelation3
  30. Click OK. The ACF and PACF plots are produced.

    Autocorrelation3
    Here we can see the strong autocorrelation with slow decay due to the trend.

  31. Click the Sheet 1 tab. Redo the ACF/PACF Plots for Indicator:

    Autocorrelation3
    As expected, the autocorrelation for Indicator is very similar to Sales. This will be addressed when Cross Correlation (CCF) Plots are created.

    Half-Hourly Multiple Seasonal Electricity Demand – Taylor

  32. Open Half-Hourly Multiple Seasonal Electricity Demand - Taylor.xlsx (Sheet 1 tab). This is halfhourly electricity demand (MW) in England and Wales from Monday, June 5, 2000 to Sunday, August 27, 2000 (taylor, R forecast). This data has multiple seasonality with frequency = 48 (observations per day) and 336 (observations per week), with a total of 4032 observations.
  33. Click SigmaXL > Time Series Forecasting > Autocorrelation (ACF/PACF) Plots. Ensure that the entire data table is selected. If not, check Use Entire Data Table. Click Next.
  34. Select Demand, click Numeric Time Series Data (Y) >>. Select Automatic Number of Lags. Specify Seasonal Frequency = 336 and Alpha Level = 0.05.

    Autocorrelation3
    The automatic number of lags will be (a minimum of) Seasonal Frequency * 3 = 1008 allowing us to see seasonal patterns in the ACF.

  35. Click OK. The ACF and PACF plots are produced.

    Autocorrelation3
    Here we can see the half-hourly seasonal patterns of 48 per day and 336 per week.

    Just as correlation measures the extent of a linear relationship between two variables, autocorrelation measures the linear relationship between lagged values of data. A plot of the data vs. the same data at lag 𝑘 may show a positive or negative trend. If the slope is positive, the autocorrelation is positive; if there is a negative slope, the autocorrelation is negative. We will use the lag utility and scatterplots to demonstrate this for 3 lags using the Series A data. /br>
    ACF denotes the AutoCorrelation Function plot (sometimes called a Correlogram). PACF denotes the Partial AutoCorrelation Function plot.

    We will use the ACF and PACF to get a general idea of what models should be used, but let the automatic algorithms do the heavy lifting of determining which model is optimal. Later, ACF on model residuals are used to assist in determining how well a model fits the autocorrelation structure, ideally with the residuals showing no statistically significant autocorrelation.

    We will also examine how differencing results in stationarity with the ACF and PACF plots.


Define, Measure, Analyze, Improve, Control

Lean Six Sigma Software Excel Add-in

Simulate, Optimize,
Realize

Lean Six Sigma Software Excel Add-in

Web Demos

Our CTO and Co-Founder, John Noguera, regularly hosts free Web Demos featuring SigmaXL and DiscoverSim
Click here to view some now!

Contact Us

Ph: 1.888.SigmaXL (744.6295)

Support: Support@SigmaXL.com

Sales: Sales@SigmaXL.com

Information: Information@SigmaXL.com