The Expected Shortfall at level \(\alpha\) is defined as the expected value of the returns under the condition that the returns are smaller than the Value at Risk for the same \(\alpha\) level. Note that an absolutely continuous distribution of the returns is assumed. The three estimation methods are:
mean
the mean of the samples that fall under the corresponding VaR.median
the median of the samples that fall under the corresponding VaR.mc
Calculation of the expected value using Monte Carlo integration over the \(\alpha\) levels. One drawsmc_samples
Monte Carlo samples .
Usage
est_es(sample, alpha, method = c("mean", "median", "mc"), mc_samples = 100)
Arguments
- sample
Numeric vector representing the sample upon which the Expected Shortfall is calculated.
- alpha
Numeric vector with entries in (0,1) specifying the levels at which the ES is calculated.
- method
Method of estimation one of
mean
,median
,mc
. For more information see the Description section.- mc_samples
Number of Monte Carlo samples used for the
mc
method.
Examples
est_es(0:100, c(0.1, 0.2, 0.3))
#> [1] 5 10 15