1. Learn
  2. /
  3. Courses
  4. /
  5. Quantitative Risk Management in R

Exercise

Applying Ljung-Box tests to return data

As you saw in the video, this code applies the Ljung-Box test to the ftse data with a lag of 10:

Box.test(ftse, lag = 10, type = "Ljung")

In this exercise, you will carry out a Ljung-Box test for serial correlation on the time series djx which contains the Dow Jones daily index returns for 2008-2011, as well as on all the individual equity return series in djall which contains the Dow Jones data for 2006-2015. You will implement this test on both the raw return series and the absolute values of the series, which you can calculate with abs(). Both djx and djall are loaded in your workspace.

You should notice that while the hypothesis of no serial correlation is rejected for many of the raw return series, it is rejected overwhelmingly for all of the absolute value series.

Instructions

100 XP
  • Apply the Ljung-Box test to the Dow Jones index returns djx with a lag of 10.
  • Apply the Ljung-Box test to the absolute values of djx with a lag of 10.
  • Use the apply() function to perform the Ljung-Box test, with a lag of 10, for each of the equity return series in djall.
  • Use the apply() function to perform the Ljung-Box test, with a lag of 10, for the absolute values of the data in djall.