Package 'RobGARCHBoot'

Title: Robust Bootstrap Forecast Densities for GARCH Models
Description: Bootstrap forecast densities for GARCH (Generalized Autoregressive Conditional Heteroskedastic) returns and volatilities using the robust residual-based bootstrap procedure of Trucios, Hotta and Ruiz (2017) <DOI:10.1080/00949655.2017.1359601>.
Authors: Carlos Trucios
Maintainer: Carlos Trucios <[email protected]>
License: GPL (>= 2)
Version: 1.2.0
Built: 2024-11-03 06:06:47 UTC
Source: https://github.com/ctruciosm/robgarchboot

Help Index


Robust Bootstrap Forecast Densities for GARCH Models

Description

Bootstrap forecast densities for returns and volatilities using the robust residual-based bootstrap procedure of Trucíos et at. (2017). The package also includes the robust GARCH (Generalized Autoregressive Conditional Heteroskedastic) estimator of Boudt et al. (2013) with the modification introduced by Trucíos et at. (2017). The robust cDCC estimator used in Trucíos et al. (2018) is also implemented.

Details

This package provides a robust bootstrap procedure to obtain forecast densities for both return and volatilities in a GARCH context. The forecast densities are useful to obtain forecast intervals as well as to estimate risk measures such as Value-at-Risk (VaR) and Expected Shortfall (ES). We also provide the robust GARCH estimator of Boudt et al. (2013) with the modification introduced by Trucíos et at. (2017). This procedure has shown good finite sample properties in both Monte Carlo experiments and empirical data. See; Trucíos et al. (2017), Trucíos (2019) and Trucíos et al. (2020) for recent implementations.

Author(s)

Carlos Trucíos <[email protected]>

References

Boudt, Kris, Jon Danielsson, and Sébastien Laurent. Robust forecasting of dynamic conditional correlation GARCH models. International Journal of Forecasting 29.2 (2013): 244-257.

Trucíos, Carlos, Luiz K. Hotta, and Esther Ruiz. Robust bootstrap forecast densities for GARCH returns and volatilities. Journal of Statistical Computation and Simulation 87.16 (2017): 3152-3174.

Trucíos, Carlos, Luiz K. Hotta, and Esther Ruiz. Robust bootstrap densities for dynamic conditional correlations: implications for portfolio selection and value-at-risk. Journal of Statistical Computation and Simulation 88.10 (2018): 1976-2000.

Trucíos, Carlos. Forecasting Bitcoin risk measures: A robust approach. International Journal of Forecasting 35.3 (2019): 836-847.

Trucíos, Carlos, Aviral K. Tiwari, and Faisal Alqahtani. Value-at-risk and expected shortfall in cryptocurrencies' portfolio: a vine copula–based approach. Applied Economics 52.24 (2020): 2580-2593.


Estimated Volatility

Description

Using the robust estimated parameters of Boudt et al. (2013) with the modification introduced by Trucíos et at. (2017), we obtain the estimated volatility.

Usage

fitted_Vol(theta,r)

Arguments

theta

Vector of robust estimated parameters obtained from ROBUSTGARCH function.

r

Vector of time series returns.

Details

More details can be found in Boudt et al. (2013) and Trucíos et at. (2017).

Value

The function returns the estimated volatility from 1 to T+1.

Author(s)

Carlos Trucíos

References

Boudt, Kris, Jon Danielsson, and Sébastien Laurent. Robust forecasting of dynamic conditional correlation GARCH models. International Journal of Forecasting 29.2 (2013): 244-257.

Trucíos, Carlos, Luiz K. Hotta, and Esther Ruiz. Robust bootstrap forecast densities for GARCH returns and volatilities. Journal of Statistical Computation and Simulation 87.16 (2017): 3152-3174.

Examples

# Using the Bitcoin daily returns, we estimate the parameter of the GARCH model in a robust way
param = ROBUSTGARCH(returnsexample)
# With the estimated parameters, we estimate the volatiltiy in a robust way
vol = fitted_Vol(param, returnsexample)

Loss function used in cDCC robust estimation.

Description

Loss function used in cDCC robust estimation.

Usage

loglik_cDCC(par, Qb, s, sigma)

Arguments

par

teste

Qb

teste

s

teste

sigma

teste

Details

This function is used in the robust estimation. We can use it to evaluate the value of the robust cDCC loss function using several values of the vector parameters.

Value

Returns the value of the loss function.

Author(s)

Carlos Trucíos

References

Boudt, Kris, Jon Danielsson, and Sébastien Laurent. Robust forecasting of dynamic conditional correlation GARCH models. International Journal of Forecasting 29.2 (2013): 244-257.

Trucíos, Carlos, Luiz K. Hotta, and Esther Ruiz. Robust bootstrap densities for dynamic conditional correlations: implications for portfolio selection and value-at-risk. Journal of Statistical Computation and Simulation 88.10 (2018): 1976-2000.

Examples

# Estimating the parameters of the cDCC model in a robust way.
cDCC = Robust_cDCC(returns3)
param = cDCC[[1]]
Qbar = cDCC[[2]]
vol1 = fitted_Vol(param[1:3],returns3[,1])
vol2 = fitted_Vol(param[4:6],returns3[,2])
vol3 = fitted_Vol(param[7:9],returns3[,3])
e = matrix(c(returns3[,1]/vol1[1:nrow(returns3)],
             returns3[,2]/vol2[1:nrow(returns3)],
             returns3[,3]/vol3[1:nrow(returns3)]), ncol=3)
      
loglik_cDCC(param[10:11],Qbar,e, 0.8309765)

Matrix of time series returns for illustrative purposes

Description

Three-variate time series returns for illustrative purposes


Time series returns for illustrative purposes

Description

Cryptocurrencies report large returns over time. In this sense and with illustrative purposes, we use Bitcoin daily returns from July 2014 to February 2017.


Robust GARCH bootstrap procedure

Description

Robust GARCH (Generalized Autoregressive Conditional Heteroskedastic) Bootstrap procedure of Trucíos et al. (2017)

Usage

RobGARCHBoot(data, n.boot = 1000, n.ahead = 1, ins = FALSE)

Arguments

data

Vector of time series returns.

n.boot

Number of bootsrap replications. By default n.boot = 1000

n.ahead

Numbers of steps-ahead. By default n.ahead = 1

ins

If TRUE in-sample bootstrap returns are calculated. By default ins = FALSE

Details

More details can be found in Trucíos et at. (2017), Hotta and Trucíos (2018), and Trucíos (2019).

Value

The function returns two lists with the empirical H-steps-ahead bootstrap densities for returns and squared volatilities. If ins = TRUE, a third list with in-sample bootstrap returns is also provided.

Author(s)

Carlos Trucíos

References

Hotta, Luiz Koodi, and Carlos Trucíos. Inference in (M)GARCH models in the presence of additive outliers: Specification, estimation, and prediction. Advances in Mathematics and Applications. Springer, Cham, 2018. 179-202.

Trucíos, Carlos, Luiz K. Hotta, and Esther Ruiz. Robust bootstrap forecast densities for GARCH returns and volatilities. Journal of Statistical Computation and Simulation 87.16 (2017): 3152-3174.

Trucíos, Carlos. Forecasting Bitcoin risk measures: A robust approach. International Journal of Forecasting 35.3 (2019): 836-847.

Examples

# Robust bootstrap forecast densities for returns and volatilities
boot = RobGARCHBoot(returnsexample, n.boot = 1000, n.ahead = 1)

# Obtaining the forecast intervals for returns (95%)
quantile(boot[[1]], prob = c(0.025, 0.975))
# Obtaining the forecast intervals for volatilities (95%)
quantile(boot[[2]], prob = c(0.025, 0.975))

# Risk measures can also be obtained
VaR1 = quantile(boot[[1]], prob = 0.01)

Parallel implementation of the Robust GARCH bootstrap procedure

Description

Robust GARCH (Generalized Autoregressive Conditional Heteroskedastic) Bootstrap procedure of Trucíos et al. (2017)

Usage

RobGARCHBootParallel(data, n.boot = 1000, n.ahead = 1, ncl = 2)

Arguments

data

Vector of time series returns.

n.boot

Number of bootsrap replications. By default n.boot = 1000

n.ahead

Numbers of steps-ahead. By default n.ahead = 1

ncl

Numbers of parallel processes. By default ncl = 2

Details

More details can be found in Trucíos et at. (2017), Hotta and Trucíos (2018), and Trucíos (2019).

Value

The function returns two lists with the empirical H-steps-ahead bootstrap densities for returns and squared volatilities.

Author(s)

Carlos Trucíos

References

Hotta, Luiz Koodi, and Carlos Trucíos. Inference in (M)GARCH models in the presence of additive outliers: Specification, estimation, and prediction. Advances in Mathematics and Applications. Springer, Cham, 2018. 179-202.

Trucíos, Carlos, Luiz K. Hotta, and Esther Ruiz. Robust bootstrap forecast densities for GARCH returns and volatilities. Journal of Statistical Computation and Simulation 87.16 (2017): 3152-3174.

Trucíos, Carlos. Forecasting Bitcoin risk measures: A robust approach. International Journal of Forecasting 35.3 (2019): 836-847.

Examples

# Robust bootstrap forecast densities for returns and volatilities
boot = RobGARCHBootParallel(returnsexample, n.boot = 1000, n.ahead = 1)

# Obtaining the forecast intervals for returns (95%)
quantile(boot[[1]], prob = c(0.025, 0.975))
# Obtaining the forecast intervals for volatilities (95%)
quantile(boot[[2]], prob = c(0.025, 0.975))

# Risk measures can also be obtained
VaR1 = quantile(boot[[1]], prob = 0.01)

Robust cDCC Estimator

Description

Robust cDCC estimator as in Trucíos et at. (2018), which is a slight modification of the procedure of Boud et al. (2013).

Usage

Robust_cDCC(r)

Arguments

r

Matrix of time series returns.

Details

More details can be found in Boudt et al. (2013) and Trucíos et at. (2018).

Value

The function returns the estimated parameters and the Qbar matrix.

Author(s)

Carlos Trucíos

References

Boudt, Kris, Jon Danielsson, and Sébastien Laurent. Robust forecasting of dynamic conditional correlation GARCH models. International Journal of Forecasting 29.2 (2013): 244-257.

Trucíos, Carlos, Luiz K. Hotta, and Esther Ruiz. Robust bootstrap densities for dynamic conditional correlations: implications for portfolio selection and Value-at-Risk. Journal of Statistical Computation and Simulation 88.10 (2018): 1976-2000.

Examples

# Estimating the parameters of the cDCC model in a robust way.
cDCC = Robust_cDCC(returns3)
#parameters
cDCC[[1]]
#Qbar
cDCC[[2]]

Robust GARCH Estimator

Description

Robust GARCH (Generalized Autoregressive Conditional Heteroskedastic) estimator of Boudt et al. (2013) with the modification introduced by Trucíos et at. (2017).

Usage

ROBUSTGARCH(y)

Arguments

y

Vector of time series returns.

Details

More details can be found in Boudt et al. (2013) and Trucíos et at. (2017).

Value

The function returns the estimated parameters.

Author(s)

Carlos Trucíos

References

Boudt, Kris, Jon Danielsson, and Sébastien Laurent. Robust forecasting of dynamic conditional correlation GARCH models. International Journal of Forecasting 29.2 (2013): 244-257.

Trucíos, Carlos, Luiz K. Hotta, and Esther Ruiz. Robust bootstrap forecast densities for GARCH returns and volatilities. Journal of Statistical Computation and Simulation 87.16 (2017): 3152-3174.

Examples

# Estimating the parameters of the GARCH model in a robust way.
ROBUSTGARCH(returnsexample*100)

Loss function used in GARCH robust estimation.

Description

Loss function used in GARCH (Generalized Autoregressive Conditional Heteroskedastic) robust estimation.

Usage

ROBUSTGARCHloss_RCPP(theta, r, sigma2)

Arguments

theta

Vector of robust estimated (or initial values) parameters obtained from ROBUSTGARCH function.

r

Vector of time series returns.

sigma2

robust squared volatility estimation (or initial value of squared volatility)

Details

This function is used in the robust estimation. We can use it to evaluate the value of the loss function using several values of the vector parameters (theta)

Value

Returns the value of the loss function

Author(s)

Carlos Trucíos

References

Boudt, Kris, Jon Danielsson, and Sébastien Laurent. Robust forecasting of dynamic conditional correlation GARCH models. International Journal of Forecasting 29.2 (2013): 244-257.

Trucíos, Carlos, Luiz K. Hotta, and Esther Ruiz. Robust bootstrap forecast densities for GARCH returns and volatilities. Journal of Statistical Computation and Simulation 87.16 (2017): 3152-3174.

Examples

# Using the Bitcoin daily returns, we estimate the parameter of the GARCH model in a robust way
param = ROBUSTGARCH(returnsexample)
# We can evaluate the loss function using the estimated parameters
ROBUSTGARCHloss_RCPP(param[2:3], returnsexample, param[1]/(1-param[2]-param[3]))