Session Ready
Exercise

Roll, roll, roll

You can visualize the time-variation in volatility by using the function chart.RollingPerformance() in the package PerformanceAnalytics. An important tuning parameter is the choice of the window length. The shorter the window, the more responsive the rolling volatility estimate is to recent returns. The longer the window, the smoother it will be. The function sd.annualized lets you compute annualized volatility under the assumption that the number of trading days in a year equals the number specified in the scale argument.

In this exercise you need to complete the code to compute the rolling estimate of annualized volatility for the daily S&P 500 returns in sp500ret for the period 2005 until 2017.

Instructions
100 XP
  • Load the package PerformanceAnalytics.
  • Compute the one month estimate, setting the scale argument to the number of trading days in a year.
  • Compute the three months estimate, setting the scale argument to the number of trading days in a year.