ES {OCA} | R Documentation |
Expected Shortfall
Description
Computes the Expected Shortfall of a given amount of loss based on variance-covariance method.
Usage
ES(
variance,
alpha = 0.95,
weights = NULL,
model = c("normal", "t-student", "both"),
df = NULL,
percentage = FALSE
)
Arguments
variance |
It could be either a scalar or a matrix containing the variances and covariances of the losses. Provide a covariance matrix when analyzing correlated losses or a scalar when dealing with a single loss. |
alpha |
A numeric value (either a single one or a vector) consisting of the significance level at which ES has to be computed, it can either be a single numeric value or a vector of numeric values. |
weights |
A vector of weights of size N for weighting the variance of losses.
When |
model |
A character string indicating which distribution is to be used for computing the ES,
the default value is the |
df |
An integer indicating the degrees of freedom for the t-student distribution when setting
|
percentage |
Logical indicating whether the file names in the VaR table should be presented in percentage or decimal. |
Details
ES
computes the Expected Shortfall (ES) of a certaing amount of loss based upon the following general formulation:
where \(\alpha\) is the significance level, \(VaR_u(X)\) is the Value-at-Risk of \(X.\)
ES
for the normal case is based on the following expression:
Meanwhile, ES
for the t-student distribution takes comes from:
Author(s)
Jilber Urbina
References
Dhaene J., Tsanakas A., Valdez E. and Vanduffel S. (2011). Optimal Capital Allocation Principles. The Journal of Risk and Insurance. Vol. 00, No. 0, 1-28.
McNeil, A. J.; Frey, R. & Embrechts, P. Quantitative risk management: concepts, techniques and tools. Princeton University Press, 2005.
Urbina, J. (2013) Quantifying Optimal Capital Allocation Principles based on Risk Measures. Master Thesis, Universitat Politècnica de Catalunya.
Urbina, J. and Guillén, M. (2014). An application of capital allocation principles to operational risk and the cost of fraud. Expert Systems with Applications. 41(16):7023-7031.
Examples
# Exercise 2.21, page 46 in McNeil et al (2005)
alpha <- c(.90, .95, .975, .99, .995)
(ES(variance=(0.2/sqrt(250))^2, alpha=alpha, model='normal'))*10000
(ES(variance=(0.2/sqrt(250))^2, alpha=alpha, model='t-student', df=4))*10000
# Both type of models at once.
(ES(variance=(0.2/sqrt(250))^2, alpha=alpha, model='both', df=4))*10000
# A vector of losses
variance <- matrix(c(100,150,150,900), 2) # covariance matrix
w <- c(0.5, 0.5) # a vector weights
ES(variance=variance, weights=w, alpha=0.95)