Get startedGet started for free

Applying Ljung-Box tests to longer-interval returns

What happens when you apply the same analyses as in the previous exercise to the monthly returns rather than the daily returns? Does the amount of serial dependence in the data appear to increase or decrease?

The objects djx and djall from the previous exercise are loaded in your workspace. Recall that djall is a multivariate series.

This exercise is part of the course

Quantitative Risk Management in R

View Course

Exercise instructions

  • Use apply.monthly() to sum the daily log-returns in djx and assign the resulting monthly log-returns to djx_m.
  • Fill in Box.test() to carry out Ljung-Box tests on the raw and absolute values of djx_m with lag = 10.
  • Use apply.monthly() to create monthly log-returns for all the daily return series in djall and assign the results to djall_m.
  • Fill in apply() to carry out Ljung-Box tests on the raw and absolute values of each component in djall_m with lag = 10.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Create monthly log-returns from djx
djx_m <- ___

# Apply Ljung-Box tests to raw and absolute values of djx_m
Box.test(___, lag = ___, type = ___)
___

# Create monthly log-returns from djall
djall_m <- ___

# Apply Ljung-Box tests to raw and absolute values of djall_m
apply(___, 2, Box.test, lag = ___, type = ___)
___
Edit and Run Code