ComenzarEmpieza gratis

Using acf plots to reveal volatility

This exercise follows on from the previous R exercise where we looked for visible signs of volatility in a financial time series. For the Dow Jones returns from 2008-11 in djx and the simulated normal and t-distributed data in ndata and tdata, respectively, you will calculate and plot the sample autocorrelation functions (acf) using the command acf().

While very little evidence of serial correlation is found in these plots, the picture changes dramatically when we look at absolute or squared return data. The real returns in the Dow Jones return series djx behave very differently to the simulated data. The serial correlation in absolute or squared returns is a consequence of volatility, which causes large returns to be followed by further large returns, although not necessarily of the same sign.

djx, ndata, and tdata are available in your workspace.

Este ejercicio forma parte del curso

Quantitative Risk Management in R

Ver curso

Instrucciones del ejercicio

  • Set up the plotting region to show 3 plots at a time (this has been done for you).
  • Plot the sample acf of djx and the simulated normal and t-distributed data ndata and tdata.
  • Plot the sample acf of the absolute values of the three series.
  • Plot the sample acf of the squares of the values of the three series.

Ejercicio interactivo práctico

Prueba este ejercicio y completa el código de muestra.

# Set up a plot region to show 3 plots at a time
par(mfrow = c(3, 1))

# Plot the acfs of djx, ndata and tdata
___
___
___

# Plot the acfs of the absolute values
___
___
___

# Plot the acfs of the squares of the values
___
___
___
Editar y ejecutar código