The student will implement common General Autoregressive Conditional Heteroskedasticity (GARCH) style models for users in the brms R package. The R package brms is a frontend for Stan that allows R users to write R formula syntax for models that is translated and compiled into a Stan model. Currently brms allows for arma
style models on the mean, but does not support GARCH style models on the variance. The student will code up several of these models in Stan, testing with simulation based calibration that the models are well calibrated, write a technical document describing the GARCH model form and how it can be incorporated into brms, then implement these models directly into brms.
Intensity | Priority | Involves | Mentors |
---|---|---|---|
Medium | Low | R, Bayesian Modeling | Paul-Christian Bürkner, Asael A Matamoros, Steve Bronder |
An Autoregressive Moving Average model (ARMA) is of the form
where
Y_t
is the series at timet
,p
and\rho_i
is the number of autoregressive parameters and autoregressive parametersq
and\theta_i
is the number of moving average parameters and moving average parameters.epsilon_t
is the error at timet
Currently, brms users are able to express autoregressive and moving average components of the mean of their model with syntax such as
# Only auto regressive
y ~ ar(time | group, p = 1)
# Only moving average
y ~ ma(time | group, q = 1)
# Both
y ~ arma(time | group, p = 1, q = 1)
We would like to extend this functionality to support General Autoregressive Conditional Heteroskedasticity (GARCH) style models which have the form
Where
y
is the series with meanmu
and errorepsilon
at timet
epsilon
is normally distributed with mean 0 and variancesigma_t^2
at timet
sigma_t^2
is modeled withp
autoregressive parametersbeta
q
moving average componentsalpha
As you can see, ARMA and GARCH are pretty similar! The fun starts happening when we are talking about real life modeling where it's very common to have very nasty tails on volatility models. Then we start building models such as asymmetric GARCH (AGARCH) models where one side of volatility leads to more conditional heteroskedasticity than the other.
Here, gamma
acts like a weight that when positive amplifies the expected volatility if previous errors were negative.
Inside of brms it's possible to distributional parameters and so for sigma
we would like to allow syntax such as
# Only autoregressive
sigma ~ ar(time | group, p = 1)
# Only moving average
sigma ~ ma(time | group, q = 1)
# Both autoregressive and moving average
sigma ~ garch(time | group, p = 1, q = 1)
# Asymmetric autoregressive
sigma ~ aar(time | group, q = 1)
# Asymmetric autoregressive and moving averag
sigma ~ agarch(time | group, p = 1, q = 1)
This would be combined with the current ARMA syntax to create models with varying autoregressive components for both the mean and variance such as
bf_mod = bf(
y ~ arma(time | group, p = 1, q = 1),
sigma ~ agarch(time | group, p = 1, q = 1)
)
Challenges from brms side will be to determine which of all the other modeling options can be combined with GARCH models. For example, how to combine GARCH models on sigma with distributional regression in sigma. Other difficulties will be to implement all the post-processing such as posterior predictions etc. The existing ARMA terms already pave the way for all of this but we will have to figure out if the current structure is satisfactory for autoregressive terms to be applied to distributional parameters other than the mean. There are also other minor difficulties such as if/how GARCH models can be combined with a covariance formulation of ARMA models on the mean arma(..., cov = TRUE)
. These are all details we have to figure out in the process.
The expected result of this project is that brms users will have access to a simple way to incorporate standard volatility models into their overall model structure.
Take models from NYU Stern Volatility lab and write them in Stan along with data generating processes. Then use both of these to perform Simulation Based Calibration
Write tech spec as an issue in BRMS suggesting the syntax style, supported models, outstanding issues, any good default priors for the parameters that were found, etc. (Paul you'd probably need to lay out the template here).
Make a prototype with tests, prediction methods, and docs for simple a simple garch(p, q)
on sigma
Add additional garch flavors such as GJR-GARCH, EGARCH, APARCH, AGARCH, etc.
- Knowledge of the tools behind developing R packages
- Experience with Stan and Bayesian modeling
- Studies in time series and volatility modeling
By the end of the project students will have experience in R package development and working with a large, international open source development team, the algorithms behind volatility modeling, an understanding of the workflow in developing Bayesian models.
It would be very good to read materials related to time series modeling with Bayesian Statistics link, be familiar with Simulation Based Calibration, and try some practice models in the Stan programming language.