Autocorrelation

Autocorrelation measures the linear relationship between a time series and its lagged values. In simpler terms, it assesses how much the current value of a series depends on its past values. Autocorrelation is fundamental in time series analysis, helping identify patterns and dependencies within the data.

Mathematical Representation

The autocorrelation function (ACF) at lag k for a time series.

Here:

  • Cov() is the covariance function.
  • Var() is the variance function.
  • k is the lag.
  • ​ is the value of the time series at time t.
  • is the value of the time series at time t-k

Interpretation

  • Positive ACF: A positive ACF at lag k indicates a positive correlation between the current observation and the observation at lag k.
  • Negative ACF: A negative ACF at lag k indicates a negative correlation between the current observation and the observation at lag k.
  • Decay in ACF: The decay in autocorrelation as lag increases often signifies the presence of a trend or seasonality in the time series.
  • Significance: Significant ACF values at certain lags may suggest potential patterns or relationships in the time series.

Let’s take an example with a real-world dataset to illustrate the differences between the Autocorrelation Function (ACF) and Partial Autocorrelation Function (PACF). In this example, we’ll use the “AirPassengers” dataset in R, which represents monthly totals of international airline passengers.

R

# Load necessary libraries
library(forecast)
 
# Load AirPassengers dataset
data("AirPassengers")
 
# Plot the time series
plot(AirPassengers, main = "Monthly International Airline Passengers")

                    

Output:

Autocorrelation

Now Plot ACF

R

# Plot ACF
acf(AirPassengers, main = "Autocorrelation Function (ACF) for AirPassengers")

                    

Output:

Autocorrelation

we use the same “AirPassengers” dataset and plot the PACF. The PACF plot shows the direct correlation at each lag, helping identify the order of autoregressive terms.

  • The ACF plot reveals a decaying pattern, indicating a potential seasonality in the data. Peaks at multiples of 12 (12, 24, …) suggest a yearly cycle, reflecting the seasonal nature of airline passenger data.
  • The ACF plot gives a comprehensive view of the correlation at all lags, showing how each observation relates to its past values.

Autocorrelation and Partial Autocorrelation

Autocorrelation and partial autocorrelation are statistical measures that help analyze the relationship between a time series and its lagged values. In R Programming Language, the acf() and pacf() functions can be used to compute and visualize autocorrelation and partial autocorrelation, respectively.

Similar Reads

Autocorrelation

Autocorrelation measures the linear relationship between a time series and its lagged values. In simpler terms, it assesses how much the current value of a series depends on its past values. Autocorrelation is fundamental in time series analysis, helping identify patterns and dependencies within the data....

Partial Autocorrelation

...

Difference between Autocorrelation and Partial Autocorrelation

...

Conclusion

Partial autocorrelation removes the influence of intermediate lags, providing a clearer picture of the direct relationship between a variable and its past values. Unlike autocorrelation, partial autocorrelation focuses on the direct correlation at each lag....