R Resources for Portfolio Optimization and Volatility Forecasting
Summary
The discussion recommends books and supporting materials for learning quantitative finance workflows in R, especially portfolio selection and volatility forecasting. Suggested resources include a practical guide to financial risk modeling and portfolio optimization, a book with code examples for numerical optimization and some GARCH models, and a financial time-series handbook covering forecasting and volatility models.
The recommendations point learners toward worked examples, sample materials, and an R package that collects functions from one of the books. The thread does not compare the resources in depth or provide a step-by-step lesson itself. Its suggestions span portfolio optimization, GARCH forecasting, and broader volatility topics, so readers may need to choose based on their specific goal and desired level of theory. One response also names a volatility surface book, which is relevant to volatility study but is less directly focused on R workflows.
Key ideas
- Several books offer R examples for portfolio selection and optimization.
- GARCH models appear in some of the recommended numerical finance examples.
- A financial time-series handbook surveys forecasting and multiple volatility model families.
- Sample materials and an R package can support practical learning, but the thread does not evaluate the resources comparatively.
Tags
Full text
# R: Book with extensive examples for either portfolio optimization or volatility forecasting?
# R: Book with extensive examples for either portfolio optimization or volatility forecasting?
I'm at a new job and there's the option to use R (you don't have to, but I'd like to). I used R years ago, so I while I'm somewhat familiar with it, I have forgotten most of it. For me, the best approach to get back into this and keep me motivated is to be guided step by step through a practical example. Get it to work and then I work backwards from there to really understand what I was doing. Later I would probably modify it.
At my work, R is mainly used for portfolio optimization, but volatility forecasting especially with GARCH models is also a big topic. So I'm interested in any book (or any other source) that walks me through how to do this. If it explains the theory too, it's great, but I can read up on this somewhere else.
## Answer by Bob Jansen (score 5, accepted)
https://quant.stackexchange.com/a/45107
Have you seen Financial Risk Modelling and Portfolio Optimization with R by Bernhard Pfaff?
## Answer by Enrico Schumann (score 3)
https://quant.stackexchange.com/a/54377
There are many R code examples for portfolio selection and some for GARCH models in this book:
```
@BOOK{Gilli2019,
title = {Numerical Methods and Optimization in Finance},
publisher = {Elsevier/Academic Press},
year = 2019,
author = {Gilli, Manfred and Maringer, Dietmar and Schumann, Enrico},
edition = 2,
url = {http://enricoschumann.net/NMOF.htm},
doi = {10.1016/C2017-0-01621-X}
}
```
(Disclosure: I am one of the authors.)
There are sample materials available on backtesting and optimisation, though the book contains another chapter dedicated to portfolio selection. There is also an R package NMOF that bundles many functions described in the book; all code examples are available from https://gitlab.com/NMOF/NMOF2-Code .
Some examples that use the `NMOF` package are on Stack Exchange:
Regularizers to compute Minimum Variance Portfolio weights
target market correlation for long / short equity portfolio
Calculating the efficient frontier from expected returns and SD
CVAR alternatives for optimization
## Answer by statmed (score 1)
https://quant.stackexchange.com/a/54374
The following book on Time Series and forecasting might be of help for you
Handbook of Financial Time Series
Editors: Andersen, T.G., Davis, R.A., Kreiss, J.-P., Mikosch, Th.V. (Eds.)
This handbook presents a collection of survey articles from a statistical as well as an econometric point of view on the broad and still rapidly developing field of financial time series. It includes most of the relevant topics in the field, from fundamental probabilistic properties of financial time series models to estimation, forecasting, model fitting, extreme value behavior and multivariate modeling for a wide range of GARCH, stochastic volatility, and continuous-time models
## Answer by AlRacoon (score 0)
https://quant.stackexchange.com/a/45125
Jim Gatheral's The Volatility Surface, A Practitioner's Guide is a good resource for volatility.Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.