Autocorrelation in R

Premium

Autocorrelation is an important part of time series analysis. It helps us understand how each observation in a time series is related to its recent past observations. When autocorrelation is high in a time series, it becomes easy to predict their future observations.

Let us consider the Microsoft stock prices for the year 2016, which we have as a time series object msft_ts. Below we have plotted the stock prices in the left chart and a scatter plot of the stock prices with a lag of 1 on the right hand side. We can clearly see a strong positive correlation between the two.

Unlock Premium Content

Upgrade your account to access the full article, downloads, and exercises.

You'll get access to:

  • Access complete tutorials and examples
  • Download source code and resources
  • Follow along with practical exercises
  • Get in-depth explanations