ComenzarEmpieza gratis

The autocorrelation function

Autocorrelations can be estimated at many lags to better assess how a time series relates to its past. We are typically most interested in how a series relates to its most recent past.

The acf(..., lag.max = ..., plot = FALSE) function will estimate all autocorrelations from 0, 1, 2,…, up to the value specified by the argument lag.max. In the previous exercise, you focused on the lag-1 autocorrelation by setting the lag.max argument to 1.

In this exercise, you'll explore some further applications of the acf() command. Once again, the time series x has been preloaded for you and is shown in the plot on the right.

Este ejercicio forma parte del curso

Time Series Analysis in R

Ver curso

Instrucciones del ejercicio

  • Use acf() to view the autocorrelations of series x from 0 to 10. Set the lag.max argument to 10 and keep the plot argument as FALSE.
  • Run the acf() code, and copy and paste the autocorrelation estimate (ACF) at lag-10 from the output.
  • Repeat this for the autocorrelation estimate (ACF) at lag-5.

Ejercicio interactivo práctico

Prueba este ejercicio completando el código de muestra.

# Generate ACF estimates for x up to lag-10
acf(___, lag.max = ___, plot = FALSE)

# Type the ACF estimate at lag-10 


# Type the ACF estimate at lag-5

Editar y ejecutar código