| Title: | Estimation of Different Quantile Related Models |
|---|---|
| Description: | Estimation of different quantile models, at the moment only Conditional autoregressive value at risk (CAViaR) proposed by Engle & Manganelli (2004) <doi:10.1198/073500104000000370> with also the specification proposed in Huang et al. (2009) <doi:10.1016/j.eneco.2008.12.006> and it's multivariate extension, Multi-variate multi-quantile CAViaR (MVMQ-CAViaR) proposed by White et al. (2015) <doi:10.1016/j.jeconom.2015.02.004> are available, however, in further updates, other models and extensions will be included. |
| Authors: | Christian Jorge Carreiro [aut, cre, cph] |
| Maintainer: | Christian Jorge Carreiro <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 1.0.0 |
| Built: | 2026-06-25 17:20:21 UTC |
| Source: | https://github.com/cran/QuantileModels |
This function allows the estimation for a general order the caviar model proposed by Engle & Manganelli (2004).
CAViaR( Y, p = 1, q = 1, model.type = "SAV", tau = 0.05, band.hs = FALSE, jac.method = "Richardson", jac.options = list(), sign.level = 0.05, quant.type = 7, optim.config = list(), refine.estim = FALSE, refinement.conf = list() )CAViaR( Y, p = 1, q = 1, model.type = "SAV", tau = 0.05, band.hs = FALSE, jac.method = "Richardson", jac.options = list(), sign.level = 0.05, quant.type = 7, optim.config = list(), refine.estim = FALSE, refinement.conf = list() )
Y |
A vector, matrix, zoo or xts object containing the univariate series. |
p |
Order of autoregressive quantile. |
q |
Order of lag Y values. |
model.type |
The specification, one of the following:
where
where |
tau |
The quantile of interest. Set default to 0.05. |
band.hs |
Logical parameter passed to quantreg::bandwidth.rq, if TRUE the Hall-Sheather bandwidth is computed, if FALSE it is computed the Bofinger bandwidth. |
jac.method |
One of "Richardson" (default), "simple", or "complex". This determines the method to compute finite differences jacobian to as part of the standard errors calculations. See numDeriv::jacobian for more information. |
jac.options |
A list passed to |
sign.level |
The |
quant.type |
One of the types available in quantile. This is used to initialize the quantile process. |
optim.config |
A list containing the optimization-related parameters, see |
refine.estim |
Should the result from the global optimization be refined with a gradient-based solver? |
refinement.conf |
A list containing the refinement optimization-related parameters, see |
The main difference in this implementation is the optimization procedure used to estimate the parameters. The original paper begins with a grid search and alternates between the Nelder-Mead and quasi-Newton optimization algorithms until convergence. In this function, however, a global optimization algorithm is used: the Multilevel Single Linkage ("NLOPT_GN_MLSL_LDS"). At each iteration, the sampled points are quasi-deterministic, using Sobol's low discrepancy sequences. Thus, different optimization runs are much less dependent on the choice of random seed.
As local optimizer, it is set by default to the NELDER-MEAD. However, other option is SUBPLEX which uses the NELDER-MEAD is subspaces, and is claimed to be more efficient and robust than the later. One can change this as described in the nloptr::nloptr function.
An alternative to MLSL is the Improved Stochastic Ranking Evolution Strategy ("NLOPT_GN_ISRES"). However, this algorithm is much more dependent on the choice of the random seed. Although it is theoretically the case that it should return the same estimates among different runs, in practice, the user should be careful when choosing this algorithm. Furthermore, the standard errors are computed using the numerical Jacobian from numDeriv, and the bandwidth is computed as described in White et al. (2015).
A list containing different results from the estimation. Class CAViaR_estim.
Engle, R. F., & Manganelli, S. (2004). CAViaR: Conditional Autoregressive Value at Risk by Regression Quantiles. Journal of Business & Economic Statistics, 22(4), 367–381.
Huang, D., Yu, B., Fabozzi, F. J., & Fukushima, M. (2009). CAViaR-based forecast for oil price risk. Energy Economics, 31(4), 511-518.
White, H., Kim, T. H., & Manganelli, S. (2015). VAR for VaR: Measuring tail dependence using multivariate regression quantiles. Journal of econometrics, 187(1), 169-188.
data=dataCAViaR SAV <- CAViaR(Y=data$GM[1:2892],model.type = "SAV", p=1,q=1,band.hs = TRUE,quant.type = 7, tau=0.05,refine.estim = FALSE) summary(SAV) #or SAV plot(SAV)data=dataCAViaR SAV <- CAViaR(Y=data$GM[1:2892],model.type = "SAV", p=1,q=1,band.hs = TRUE,quant.type = 7, tau=0.05,refine.estim = FALSE) summary(SAV) #or SAV plot(SAV)
Original caviar data used in Engle & Manganelli (2004).
dataCAViaRdataCAViaR
3392 rows x 3 columns of log returns of General Motors, IBM and S&P 500.
https://www.simonemanganelli.org/Simone/Research.html
Engle, R. F., & Manganelli, S. (2004). CAViaR: Conditional autoregressive value at risk by regression quantiles. Journal of business & economic statistics, 22(4), 367-381.
Data used in White et al. (2015)
MVMQMVMQ
An xts object containing the returns of Goldman sachs, Braclays, HSBC and Deutsche Bank, as well as the corresponding index.
https://www.simonemanganelli.org/Simone/Research.html
White, H., Kim, T. H., & Manganelli, S. (2015). VAR for VaR: Measuring tail dependence using multivariate regression quantiles. Journal of econometrics, 187(1), 169-188.
MVMQ-CAViaR model estimation proposed by White et al. (2015).
MVMQ_CAViaR( Y, p = 1, q = 1, tau = rep(0.05, ncol(Y)), band.hs = FALSE, jac.method = "simple", jac.options = list(), sign.level = 0.05, quant.type = 7, optim.config = list(), init.optim.config = list(), global.estim = FALSE, global.optim = list() )MVMQ_CAViaR( Y, p = 1, q = 1, tau = rep(0.05, ncol(Y)), band.hs = FALSE, jac.method = "simple", jac.options = list(), sign.level = 0.05, quant.type = 7, optim.config = list(), init.optim.config = list(), global.estim = FALSE, global.optim = list() )
Y |
A matrix, xts or zoo object of multivariate series. |
p |
Order of autoregressive quantile. |
q |
Order of lag Y values. |
tau |
A vector containing the quantiles of interest. Set default to 0.05. |
band.hs |
Logical parameter passed to quantreg::bandwidth.rq, if TRUE the Hall-Sheather bandwidth is computed, if FALSE it is computed the Bofinger bandwidth. |
jac.method |
One of "Richardson" (default), "simple", or "complex". This determines the method to compute finite differences jacobian to as part of the standard errors calculations. See numDeriv::jacobian for more information. |
jac.options |
A list passed to |
sign.level |
The |
quant.type |
One of the types available in quantile. This is used to initialize the quantile process. |
optim.config |
A list containing the optimization-related parameters, see |
init.optim.config |
A list containing the univariate optimization-related parameters, see |
global.estim |
Should the optimization be performed in first place with global optimization with GenSA::GenSA in order to potentially achieve a better exploration of parameter space? |
global.optim |
A list containing the global optimization-related parameters, see GenSA::GenSA for more information. |
This implementation follows in essence the same optimization strategy as White et al. (2015), by first obtaining for each series their univariate CAViaR estimation with CAViaR, and setting the rest of the parameters to 0. As mentioned above, staring from those univariate estimates, this function offers two different optimization strategies: i) feed this starting point to a local optimizer (by default NLOPT_LN_SBPLX) following the original work, in such case the user should set global.estim=FALSE (the default); ii) feed this starting point to GenSA::GenSA in order perform a global optimization with the intention to explore the parameter space, and the result from this global phase is then used as starting point for the same procedure as i), then the user should set global.estim=TRUE.
Regarding the specification, at the moment, only the symmetric absolute value specification is available, having the following form:
A list containing different results from the estimation. Class MVMQ_CAViaR
White, H., Kim, T. H., & Manganelli, S. (2015). VAR for VaR: Measuring tail dependence using multivariate regression quantiles. Journal of econometrics, 187(1), 169-188.
Barclays <- MVMQ_CAViaR(MVMQ[,c(6,1)],tau =c(0.01,0.01),band.hs = TRUE) summary(Barclays) #or Barclays plot(Barclays,rows=2,columns=1)Barclays <- MVMQ_CAViaR(MVMQ[,c(6,1)],tau =c(0.01,0.01),band.hs = TRUE) summary(Barclays) #or Barclays plot(Barclays,rows=2,columns=1)
Plot CAViaR
## S3 method for class 'CAViaR_estim' plot(x, .by = "month", .format = "%b-%Y", titl = "VaR", ...)## S3 method for class 'CAViaR_estim' plot(x, .by = "month", .format = "%b-%Y", titl = "VaR", ...)
x |
|
.by |
Frequency to display the dates in the plot, see axis.Date. |
.format |
Format of the displayed dates in the plot, see axis.Date. |
titl |
Optional title of the plot. |
... |
other arguments to plot |
No value returned
Plot MVMQ_CAViaR
## S3 method for class 'MVMQ_CAViaR' plot( x, rows = 2, columns = 1, .by = "month", .format = "%b-%Y", titl = "VaR at ", ... )## S3 method for class 'MVMQ_CAViaR' plot( x, rows = 2, columns = 1, .by = "month", .format = "%b-%Y", titl = "VaR at ", ... )
x |
|
rows |
Number of rows to display in the plot, passed to par |
columns |
Number of columns to display in the plot, passed to par |
.by |
Frequency to display the dates in the plot, see axis.Date. |
.format |
Format of the displayed dates in the plot, see axis.Date. |
titl |
Optional title of the plot. |
... |
other arguments to plot |
No value returned
Print CAViaR
## S3 method for class 'CAViaR_estim' print(x, digits = 5, conf.level = 0.95, ...)## S3 method for class 'CAViaR_estim' print(x, digits = 5, conf.level = 0.95, ...)
x |
|
digits |
number of decimals to display, passed to round. |
conf.level |
Confidence level to the coverage test. |
... |
Other arguments passed to print. |
No value returned
Print MVMQ_CAViaR
## S3 method for class 'MVMQ_CAViaR' print(x, digits = 5, conf.level = 0.95, ...)## S3 method for class 'MVMQ_CAViaR' print(x, digits = 5, conf.level = 0.95, ...)
x |
|
digits |
number of decimals to display, passed to round. |
conf.level |
Confidence level to the coverage test. |
... |
Other arguments passed to print. |
No value returned
Summary CAViaR
## S3 method for class 'CAViaR_estim' summary(object, digits = 5, conf.level = 0.95, ...)## S3 method for class 'CAViaR_estim' summary(object, digits = 5, conf.level = 0.95, ...)
object |
|
digits |
number of decimals to display, passed to round. |
conf.level |
Confidence level to the coverage test. |
... |
Other arguments passed to print. |
No value returned
Summary MVMQ_CAViaR
## S3 method for class 'MVMQ_CAViaR' summary(object, digits = 5, conf.level = 0.95, ...)## S3 method for class 'MVMQ_CAViaR' summary(object, digits = 5, conf.level = 0.95, ...)
object |
|
digits |
number of decimals to display ,passed to round. |
conf.level |
Confidence level to the coverage test. |
... |
Other arguments passed to print. |
No value returned
Data used in Huang et al. (2009).
wti_datawti_data
An xts object of the WTI price daily returns
https://fred.stlouisfed.org/series/WTISPLC
Huang, D., Yu, B., Fabozzi, F. J., & Fukushima, M. (2009). CAViaR-based forecast for oil price risk. Energy Economics, 31(4), 511-518.