Learn R Programming

bayesGARCH (version 2.1.10)

bayesGARCH: Bayesian Estimation of the GARCH(1,1) Model with Student-t Innovations

Description

Performs the Bayesian estimation of the GARCH(1,1) model with Student-t innovations.

Usage


  bayesGARCH(y, mu.alpha = c(0,0), Sigma.alpha = 1000 * diag(1,2), 
             mu.beta = 0, Sigma.beta = 1000,
             lambda = 0.01, delta = 2, control = list())

Arguments

y

vector of observations of size \(T\). NA values are not allowed.

mu.alpha

hyper-parameter \(\mu_\alpha\) (prior mean) for the truncated Normal prior on parameter \(\alpha := (\alpha_0 \ \alpha_1)'\). Default: a \(2 \times 1\) vector of zeros.

Sigma.alpha

hyper-parameter \(\Sigma_\alpha\) (prior covariance matrix) for the truncated Normal prior on parameter \(\alpha\). Default: a \(2 \times 2\) diagonal matrix whose variances are set to 1'000, i.e., a diffuse prior. Note that the matrix must be symmetric positive definite.

mu.beta

hyper-parameter \(\mu_\beta\) (prior mean) for the truncated Normal prior on parameter \(\beta\). Default: zero.

Sigma.beta

hyper-parameter \(\Sigma_\beta > 0\) (prior variance) for the truncated Normal prior on parameter \(\beta\). Default: 1'000, i.e., a diffuse prior.

lambda

hyper-parameter \(\lambda > 0\) for the translated Exponential distribution on parameter \(\nu\). Default: 0.01.

delta

hyper-parameter \(\delta \ge 2\) for the translated Exponential distribution on parameter \(\nu\). Default: 2 (to ensure the existence of the conditional variance).

control

list of control parameters (See *Details*).

Value

A list of class mcmc.list (R package coda).

Details

The function bayesGARCH performs the Bayesian estimation of the GARCH(1,1) model with Student-t innovations. The underlying algorithm is based on Nakatsuma (1998, 2000) for generating the parameters of the GARCH(1,1) scedastic function \(\alpha := (\alpha_0 \ \alpha_1)'\) and \(\beta\) and on Geweke (1993) and Deschamps (2006) for the generating the degrees of freedom parameter \(\nu\). Further details and examples can be found in Ardia (2008) and Ardia and Hoogerheide (2010). Finally, we refer to Ardia (2009) for an extension of the algorithm to Markov-switching GARCH models.

The control argument is a list that can supply any of the following components:

n.chain

number of MCMC chain(s) to be generated. Default: n.chain=1.

l.chain

length of each MCMC chain. Default: l.chain=10000.

start.val

vector of starting values of chain(s). Default: start.val=c(0.01,0.1,0.7,20). A matrix of size \(n \times 4\) containing starting values in rows can also be provided. This will generate \(n\) chains starting at the different row values.

addPriorConditions

function which allows the user to add constraints on the model parameters. Default: NULL, i.e. not additional constraints are imposed (see below).

refresh

frequency of reports. Default: refresh=10 iterations.

digits

number of printed digits in the reports. Default: digits=4.

References

Ardia, D. (2009) Bayesian Estimation of a Markov-Switching Threshold Asymmetric GARCH Model with Student-t Innovations. Econometrics Journal 12(1), pp. 105-126. 10.1111/j.1368-423X.2008.00253.x

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

Ardia, D. (2008) Financial Risk Management with Bayesian Estimation of GARCH Models. Lecture Notes in Economics and Mathematical Systems 612. Springer-Verlag, Berlin, Germany. ISBN 978-3-540-78656-6, e-ISBN 978-3-540-78657-3, 10.1007/978-3-540-78657-3

Deschamps, P.J. (2006) A Flexible Prior Distribution for Markov Switching Autoregressions with Student-t Errors. Journal of Econometrics 133, pp.153-190.

Geweke, J.F. (1993) Bayesian Treatment of the Independent Student-t Linear Model. Journal of Applied Econometrics 8, pp.19-40.

Nakatsuma, T. (2000) Bayesian Analysis of ARMA-GARCH Models: A Markov Chain Sampling Approach. Journal of Econometrics 95(1), pp.57-69.

Nakatsuma, T. (1998) A Markov-Chain Sampling Algorithm for GARCH Models. Studies in Nonlinear Dynamics and Econometrics 3(2), pp.107-117.

See Also

garchFit (R package fGarch) for the classical Maximum Likelihood estimation of GARCH models.

Examples

Run this code
# NOT RUN {
<!-- % -->
# }
# NOT RUN {
  ## !!! INCREASE THE NUMBER OF MCMC ITERATIONS !!!

  ## LOAD DATA
  data(dem2gbp)
  y <- dem2gbp[1:750]

  ## RUN THE SAMPLER (2 chains)
  MCMC <- bayesGARCH(y, control = list(n.chain = 2, l.chain = 200))

  ## MCMC ANALYSIS (using coda)
  plot(MCMC)
  
  ## FORM THE POSTERIOR SAMPLE
  smpl <- formSmpl(MCMC, l.bi = 50)

  ## POSTERIOR STATISTICS
  summary(smpl)
  smpl <- as.matrix(smpl)
  pairs(smpl)

  ## GARCH(1,1) WITH NORMAL INNOVATIONS
  MCMC <- bayesGARCH(y, lambda = 100, delta = 500,
                     control = list(n.chain = 2, l.chain = 200))

  ## GARCH(1,1) WITH NORMAL INNOVATIONS AND 
  ## WITH COVARIANCE STATIONARITY CONDITION
  addPriorConditions <- function(psi){psi[2] + psi[3] < 1}
  MCMC <- bayesGARCH(y, lambda = 100, delta = 500,
                     control = list(n.chain = 2, l.chain = 200, 
                     addPriorConditions = addPriorConditions))
# }

Run the code above in your browser using DataLab