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
Exercise instructions
- Use
apply.monthly()to sum the daily log-returns indjxand assign the resulting monthly log-returns todjx_m. - Fill in
Box.test()to carry out Ljung-Box tests on the raw and absolute values ofdjx_mwithlag = 10. - Use
apply.monthly()to create monthly log-returns for all the daily return series indjalland assign the results todjall_m. - Fill in
apply()to carry out Ljung-Box tests on the raw and absolute values of each component indjall_mwithlag = 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 = ___)
___