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

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/garch.R

Description

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

Usage

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

Arguments

ts

a numeric or ts object with the univariate time series.

order

A specification of the garch model: the three components (s, k, h) are the arch order, the garch order, and the mgarch order.

arma

A specification of the ARMA model,same as order parameter: the two components (p, q) are the AR order,and the MA order.

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.

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:

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

Value

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

Author(s)

Asael Alonzo Matamoros.

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# 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

bayesforecast documentation built on June 17, 2021, 5:14 p.m.