Learn R Programming

bayesforecast (version 1.0.5)

garch: A constructor for a GARCH(s,k,h) model.

Description

Constructor of the GARCH(s,k,h) object for Bayesian estimation in Stan.

Usage

garch(
  ts,
  order = c(1, 1, 0),
  arma = c(0, 0),
  xreg = NULL,
  genT = FALSE,
  asym = "none",
  series.name = NULL
)

Value

The function returns a list with the data for running stan()

function of rstan package.

Arguments

ts

a numeric or ts object with the univariate time series.

order

a three length vector, with the GARCH model specification: the three components c(s, k, h) are the ARCH, GARCH, and MGARCH orders respectively.

arma

a two length vector with the ARMA model specification, similar to the order argument; the two components c(p, q) are the AR, and MA orders.

xreg

Optionally, a numerical matrix of external regressors, which must have the same number of rows as ts. It should not be a data frame.

genT

a boolean value to specify for a generalized t-student GARCH model.

asym

a string value for the asymmetric function for an asymmetric GARCH process. By default the value "none" for standard GARCH process. If "logit" a logistic function is used for asymmetry, and if "exp" an exponential function is used.

series.name

an optional string vector with the time series names.

Author

Asael Alonzo Matamoros.

Details

The function returns a list with the data for running stan() function of rstan package.

By default the garch() function generates a GARCH(1,1) model, when genT option is TRUE a t-student innovations GARCH model (see Ardia (2010)) is generated, and for Asymmetric GARCH models use the option asym for specify the asymmetric function, see Fonseca, et. al (2019) for more details.

The default priors used in a GARCH(s,k,h) model are:

  • ar ~ normal(0,0.5)

  • ma ~ normal(0,0.5)

  • mu0 ~ t-student(0,2.5,6)

  • sigma0 ~ t-student(0,1,7)

  • arch ~ normal(0,0.5)

  • garch ~ normal(0,0.5)

  • mgarch ~ normal(0,0.5)

  • dfv ~ gamma(2,0.1)

  • breg ~ t-student(0,2.5,6)

For changing the default prior use the function set_prior().

References

Engle, R. (1982). Autoregressive Conditional Heteroscedasticity with Estimates of the Variance of United Kingdom Inflation. Econometrica, 50(4), 987-1007. url: http://www.jstor.org/stable/1912773.

Bollerslev, T. (1986). Generalized autoregressive conditional heteroskedasticity. Journal of Econometrics. 31(3), 307-327. doi: https://doi.org/10.1016/0304-4076(86)90063-1.

Fonseca, T. and Cequeira, V. and Migon, H. and Torres, C. (2019). The effects of degrees of freedom estimation in the Asymmetric GARCH model with Student-t Innovations. arXiv doi: arXiv: 1910.01398.

Ardia, D. and Hoogerheide, L. (2010). Bayesian Estimation of the GARCH(1,1) Model with Student-t Innovations. The R Journal. 2(7), 41-47. doi: 10.32614/RJ-2010-014.

See Also

Sarima auto.arima set_prior

Examples

Run this code
# Declaring a garch(1,1) model for the ipc data.
dat = garch(ipc,order = c(1,1,0))
dat

# Declaring a t-student M-GARCH(2,3,1)-ARMA(1,1) process for the ipc data.
dat = garch(ipc,order = c(2,3,1),arma = c(1,1),genT = TRUE)
dat

# Declaring a logistic Asymmetric GARCH(1,1) process.
dat = garch(ipc,order = c(1,1,0),asym = "logit")
dat

Run the code above in your browser using DataLab