bayesDccGarch: Bayesian Estimation of the DCC-GARCH(1,1) Model.

View source: R/mainFunctions.R

bayesDccGarchR Documentation

Bayesian Estimation of the DCC-GARCH(1,1) Model.

Description

Performs a Markov Chain for all parameters of the DCC-GARCH(1,1) Model.

Usage

bayesDccGarch(mY, nSim = 10000, tail_ini = 8, omega_ini=0.1*diag(var(mY)),
  alpha_ini=rep(0.05, ncol(mY)), beta_ini=rep(0.85, ncol(mY)),
	a_ini = 0.04, b_ini = 0.8, gamma_ini = rep(1, ncol(mY)),
	errorDist = 2, control = list())

increaseSim(x, nSim=10000)

## S3 method for class 'bayesDccGarch'
update(object, ..., mY_new)

## S3 method for class 'bayesDccGarch'
window(x, start = NULL, end = NULL, thin = NULL, ...)

Arguments

mY

a matrix of the data (n \times k).

nSim

length of Markov chain. Default: 10000.

tail_ini

initial value of \nu parameter if errorDist = 2 or initial value of \delta parameter if errorDist = 3. If errorDist = 1 this arguments is not used.

omega_ini

a numeric vector (k \times 1) with the initial values of \omega_i parameters. Default: rep(0.03, ncol(mY)).

alpha_ini

a numeric vector (k \times 1) with the initial values of \alpha_i parameters. Default: rep(0.03, ncol(mY)).

beta_ini

a numeric vector (k \times 1) with the initial values of \beta_i parameters. Default: rep(0.8, ncol(mY)).

a_ini

a numeric value of the initial values of a parameter. Default: 0.03.

b_ini

a numeric value of the initial values of b parameter. Default: 0.8.

gamma_ini

a numeric vector (k \times 1) with the initial values of \gamma_i parameters. Default: rep(1.0, ncol(mY)).

errorDist

a probability distribution for errors. Use errorDist=1 for SSNorm, errorDist=2 for SST or errorDist=3 for SSGED. Default: 2.

control

list of control arguments (See *Details*).

x, object

an object of bayesDccGarch class.

mY_new

a matrix of new data (n_{new} \times k).

start

the first iteration of interest from Markov chain.

end

the last iteration of interest from Markov chain.

thin

the required interval between successive samples.

...

additional arguments for S3 generic window function

Details

The bayesDccGarch() function performs a Markov Chain for all parameters of the model DCC-GARCH(1,1) (or GARCH(1,1) in the univariate case). There are three options of probability distributions for the error component. These are the standardized skew versions of normal, t-student and ged distributions. See Fioruci et al (2014a) and Fioruci et al (2014b) for any detail. The control argument can be used for define the prior hyper-parameters and the simulation algorithm parameters. It is a list that can supply any of the following components:

$mu_tail

the value of hyper-parameter \mu_\nu if errorDist=2 or the hyper-parameter \mu_\delta if errorDist=3. Default: 8

$mu_gamma

a vector with the hyper-parameters \mu_{\gamma_i}. Default: rep(0,ncol(mY)

$mu_omega

a vector with the hyper-parameters \mu_{\omega_i}. Default: rep(0,ncol(mY)

$mu_alpha

a vector with the hyper-parameters \mu_{\alpha_i}. Default: rep(0,ncol(mY)

$mu_beta

a vector with the hyper-parameters \mu_{\beta_i}. Default: rep(0,ncol(mY)

$mu_a

the value of the hyper-parameter \mu_a. Default: 0

$mu_b

the value of the hyper-parameter \mu_b. Default: 0

$sigma_tail

the value of hyper-parameter \sigma_\nu if errorDist=2 or the hyper-parameter \sigma_\delta if errorDist=3. Default: 10

$sigma_gamma

a vector with the hyper-parameters \sigma_{\gamma_i}. Default: rep(1.25,ncol(mY)

$sigma_omega

a vector with the hyper-parameters \sigma_{\omega_i}. Default: rep(10,ncol(mY)

$sigma_alpha

a vector with the hyper-parameters \sigma_{\alpha_i}. Default: rep(10,ncol(mY)

$sigma_beta

a vector with the hyper-parameters \sigma_{\beta_i}. Default: rep(10,ncol(mY)

$sigma_a

the value of the hyper-parameter \sigma_a. Default: 10

$sigma_b

the value of the hyper-parameter \sigma_b. Default: 10

$simAlg

the random walk Metropolis-Hasting algorithm update. Use 1 for update all parameters as one block, use 2 for update one parameter for each time and use 3 for an automatic choice.

$nPilotSim

number of simulation for pilot sample if control$simAlg=3. Default:1000

$cholCov

the cholesky decomposition matrix of the covariance matrix for simulation by one-block Metropolis-Hasting. It must to be passed if control$simAlg=1.

$sdSim

a vector with the standard deviations for simulation by one-dimensional Metropolis-Hasting. It must to be passed if control$simAlg=2.

$print

a logical variable for if the function should report the number of interactions in each 100 interactions or not. Default: TRUE

The function increaseSim() can be used to increase the length of Markov chain simulation.

The function window() can be used to filter the Markov chain simulation. In this case, all statistics are recomputed.

Value

An object of bayesDccGarch class, which contains a list with elements:

$control

a list with the used control argument.

$MC

an objetic of mcmc class with the Markov Chain simulation for all parameters. (R package coda)

$H

a matrix with the Bayesian estimates of volatilities and co-volatilities.

$R

a matrix with the estimates of the dynamic coditional correlation.

$H_n1

Bayesian prediction of volatilities and co-volatilities for y_n+1.

$R_n1

Bayesian prediction of coditional correlation for y_n+1.

$IC

the Bayesian estimate of Akaike Information Criterion, Bayesian Information Criterion and Deviance Information Criterion.

$elapsedTime

an object of class proc_time which is a numeric vector of length 5, containing the user, system, and total elapsed times of the process.

Author(s)

Jose Augusto Fiorucci, Ricardo Sandes Ehlers and Francisco Louzada

References

Fioruci, J.A., Ehlers, R.S., Andrade Filho, M.G. Bayesian multivariate GARCH models with dynamic correlations and asymmetric error distributions, Journal of Applied Statistics, 41(2), 320–331, 2014a. <doi:10.1080/02664763.2013.839635>

Fioruci, J.A., Ehlers, R.S., Louzada, F. BayesDccGarch - An Implementation of Multivariate GARCH DCC Models, ArXiv e-prints, 2014b. https://ui.adsabs.harvard.edu/abs/2014arXiv1412.2967F/abstract.

See Also

bayesDccGarch-package, logLikDccGarch, plot, plotVol

Examples




data(DaxCacNik)

### Bayes DCC-GARCH(1,1) ###
mY = head(DaxCacNik, 1500)
out1 = bayesDccGarch(mY)
  # more 50000 simulations
out2 = increaseSim(out1, 50000)
  # remove first 10000 simulations and take at intervals of 20
out3 = window(out2, start=10000, thin = 20)
summary(out3)

# Plotting volatilities
plot(out3)

# Plotting Markov Chain
plot(out3$MC)

# Forecast volatility
H_pred = predict(out3, n_ahead=200)$H
plot.ts(rbind(out3$H, H_pred), main="volatility: historical and forecast")

# New data
out4 = update(out3, mY_new=DaxCacNik[1501:1628,])
plot(out4)

### Bayes univariate GARCH(1,1) ###
Dax = DaxCacNik[,1]
out = bayesDccGarch(Dax)
summary(out)
plot(out)




bayesDccGarch documentation built on April 22, 2023, 9:08 a.m.