Volatility modelling in R exercises (Part-3)

July 10, 2017
By

(This article was first published on R-exercises, and kindly contributed to R-bloggers)

This is the third part of the series on volatility modelling. For other parts of the series follow the tag volatility.

In this exercise set we will use GARCH models to forecast volatility.

Answers to the exercises are available here.

Exercise 1
Load the rugarch and the FinTS packages. Next, load the m.ibmspln dataset from the FinTS package. This dataset contains monthly excess returns of the S&P500 index from Jan-1926 to Dec-1999 (Ruey Tsay (2005) Analysis of Financial Time Series, 2nd ed. ,Wiley, chapter 3).
Also, load the forecast package which we will use for auto-correlation graphs.

Exercise 2
Excess S&P500 returns are defined as a regular zoo variable. Convert this to a time series variable with correct dates.

Exercise 3
Plot the excess S&P500 returns along with its ACF and PACF graphs and comment on the apparent correlation.

Exercise 4
Plot the squared excess S&P500 returns along with its ACF and PACF graphs and comment on the apparent correlation.

Learn more about Model Evaluation in the online course Regression Machine Learning with R. In this course you will learn how to:

  • Avoid model over-fitting using cross-validation for optimal parameter selection
  • Explore maximum margin methods such as best penalty of error term support vector machines with linear and non-linear kernels.
  • And much more

Exercise 5
Using the results from exercise-3, estimate a suitable ARMA model for excess returns assuming normal errors.

Exercise 6
Using the results from exercise-4, estimate a suitable ARMA model for excess returns without assuming normal errors.

Exercise 7
Using the results from exercises 5 and 6, estimate a more parsimonious model that has better fit.

Exercise 8
Generate 10 steps ahead forecast for the model from exercise-7

Exercise 9
Plot the excess returns forecast.

Exercise 10
Plot the volatility forecast.

To leave a comment for the author, please follow the link and comment on their blog: R-exercises.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.

Search R-bloggers

Sponsors

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)