Beyond ARMA-GARCH: leveraging any statistical model for volatility forecasting

[This article was first published on T. Moudiki's Webpage - R, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Remark: There’s now a button for copying the code chunks. It’s useful; I needed it.

This post is a sequel of Beyond ARMA-GARCH: leveraging model-agnostic Machine Learning and conformal prediction for nonparametric probabilistic stock forecasting (ML-ARCH) and Python version of Beyond ARMA-GARCH: leveraging model-agnostic Quasi-Randomized networks and conformal prediction for nonparametric probabilistic stock forecasting (ML-ARCH).

The novelty in this post is that: you can use any statistical model (meaning Theta, ARIMA, exponential smoothing, etc.) for volatility forecasting. It will be adapted to the Python version (previous link) in the next few days. Remember that the models used below are not tuned, and that you need to tune them to reduce the forecasting uncertainty.

Installing the package

options(repos = c(
                techtonique = "https://r-packages.techtonique.net",
                CRAN = "https://cloud.r-project.org"
            ))            

install.packages("ahead")

Theta

# Default model for volatility (Ridge regression for volatility)
(obj_ridge <- ahead::mlarchf(fpp2::goog200, h=20L, B=500L, ml=FALSE, stat_model=forecast::thetaf))
plot(obj_ridge)

image-title-here

Mean forecast

(obj_ridge <- ahead::mlarchf(fpp2::goog200, h=20L, B=500L, ml=FALSE, stat_model=forecast::meanf))
plot(obj_ridge)

image-title-here

Auto ARIMA

(obj_ridge <- ahead::mlarchf(fpp2::goog200, h=20L, B=500L, ml=FALSE, stat_model=forecast::auto.arima))
plot(obj_ridge)

image-title-here

Exponential smoothing

(obj_ridge <- ahead::mlarchf(fpp2::goog200, h=20L, B=500L, ml=FALSE, stat_model=forecast::ets))
plot(obj_ridge)

image-title-here

To leave a comment for the author, please follow the link and comment on their blog: T. Moudiki's Webpage - R.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

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)