riskmeasures | R Documentation |
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, ...)
level |
|
qmix |
see |
loc |
|
scale |
|
control |
|
verbose |
|
... |
additional arguments (for example, parameters) passed to
the underlying mixing distribution when |
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
\int_k^{\infty} x\phi(x)dx=\phi(k)
where \phi(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.
VaR_nvmix()
and ES_nvmix()
return
a numeric
n
-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).
Erik Hintz, Marius Hofert and Christiane Lemieux
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 R: The R Package nvmix. Journal of Statistical Software, \Sexpr[results=rd]{tools:::Rd_expr_doi("10.18637/jss.v102.i02")}.
dnvmix()
, pnvmix()
, qnvmix()
,
rnvmix()
, get_set_param()
## Example for inverse-gamma mixture (resulting in a t distribution) for
## which the expected shortfall admits a closed formula
set.seed(42) # reproducibility
level <- seq(from = 0.9, to = 0.95, by = 0.01)
df <- 4
## If 'qmix' is provided as string, ES_nvmix() uses the closed formula
ES1 <- ES_nvmix(level, qmix = "inverse.gamma", df = df)
## If 'qmix' is provided as function, the expected shortfall is estimated
ES2 <- 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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.