In this task, you will need to download daily data for the S&P 500 index (not the ETF). The data should date between to Jan 1960 and Feb 2019. Given this time series, compute the daily returns using the adjusted prices and address the following:
1. Your first task to compute the realized volatility. To do so, for each week in the time series, compute the realized variance as the average squared return and scale it by 5. Hence, the realized volatility is given by the squared root of the realized variance.
2. Your second task is to construct a forward estimate (forecast) for the realized volatility. You will need convert the returns from daily to weekly. Given the weekly returns, you are required to use two models: a 50-week moving average (MA) and an EWMA model with Î» = 90%.
3. Finally, merge the realized volatility along with the forecast of each model. As a summary of performance, plot the realized against the forecast (1 Points). Moreover, regress the realized volatility on the each of the forecasts and report the following measures: coefficient of determination R2, mean-squared error (MSE), the intercept, and the slope. How do you compare between the two models? Which one provides a better approach to model risk? (4 Points)