Estimation of value-at-risk and expected shortfall for univariate normal variance mixtures
VaR_nvmix(level, qmix, loc =0, scale =1, control = list(), verbose =TRUE,...)ES_nvmix(level, qmix, loc =0, scale =1, control = list(), verbose =TRUE,...)
Arguments
level: n-vector of confidence levels.
qmix: see pnvmix().
loc: numeric location, see also pnvmix()
scale: numeric scale, see also pnvmix()
control: list specifying algorithm specific parameters; see get_set_param().
verbose: logical
indicating whether a warning is given if the required precision has not been reached.
...: additional arguments (for example, parameters) passed to the underlying mixing distribution when qmix is a character string or function, see also pnvmix()
Returns
VaR_nvmix() and ES_nvmix() return a numericn-vector with the computed risk measures and in case of ES_nvmix() corresponding attributes "abs. error" and "rel. error"(error estimates of the RQMC estimator) and "numiter" (number of iterations).
Details
VaR_nvmix calls qnvmix().
The function ES_nvmix() estimates the expected shortfall using a randomized quasi Monte Carlo procedure by sampling from the mixing variable specified via qmix and and using the identity ∫k∞xϕ(x)dx=ϕ(k) where ϕ(x) denotes the density of a standard normal distribution. Algorithm specific paramaters (such as tolerances) can be conveniently passed via the control argument, see get_set_param() for more details.
Author(s)
Erik Hintz, Marius Hofert and Christiane Lemieux
References
Hintz, E., Hofert, M. and Lemieux, C. (2021), Normal variance mixtures: Distribution, density and parameter estimation. Computational Statistics and Data Analysis 157C, 107175.
Hintz, E., Hofert, M. and Lemieux, C. (2022), Multivariate Normal Variance Mixtures in : The Package nvmix. Journal of Statistical Software, tools:::Rd_expr_doi("10.18637/jss.v102.i02") .
## Example for inverse-gamma mixture (resulting in a t distribution) for## which the expected shortfall admits a closed formulaset.seed(42)# reproducibilitylevel <- seq(from =0.9, to =0.95, by =0.01)df <-4## If 'qmix' is provided as string, ES_nvmix() uses the closed formulaES1 <- ES_nvmix(level, qmix ="inverse.gamma", df = df)## If 'qmix' is provided as function, the expected shortfall is estimatedES2 <- ES_nvmix(level, qmix =function(u, df)1/qgamma(1-u, shape = df/2, rate = df/2), df = df)stopifnot(all.equal(ES1, ES2, tol =1e-2, check.attributes =FALSE))