ES: Expected Shortfall

View source: R/ES.R

ESR Documentation

Expected Shortfall

Description

\loadmathjax

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 weights=NULL variances used to compute ES are the original values supplied to variance with no weighting scheme.

model

A character string indicating which distribution is to be used for computing the ES, the default value is the normal distribution, the other alternative is t-student distribution with υ degrees of freedom. When model='both' 'normal' as well as 't-student' are used when computing the ES, see examples.

df

An integer indicating the degrees of freedom for the t-student distribution when setting model='t-student' and model='both'. df must be greater than 2.

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:

\mjtdeqn

ES_\alpha = \frac11-\alpha\int_\alpha^1 VaR_u(X)du = E[X|X > F_X^-1(\alpha)]ES_\alpha = \dfrac11-\alpha\int_\alpha^1 VaR_u(X)du = E[X|X > F_X^-1(\alpha)]

where \mjteqn\alpha\alpha is the significance level, \mjteqnVaR_u(X)VaR_u(X) is the Value-at-Risk of \mjteqnX.X.

ES for the normal case is based on the following expression:

\mjtdeqn

ES_\alpha = \mu + \sigma \frac\phi(\Phi^-1(\alpha))1-\alphaES_\alpha = \mu + \sigma \frac\phi(\Phi^-1(\alpha))1-\alpha

Meanwhile, ES for the t-student distribution takes comes from:

\mjtdeqn

ES_\alpha(\tildeX) = \fracg_\upsilon(t_\upsilon^-1(\alpha))1-\alpha \left( \frac\upsilon+(t_\upsilon^-1(\alpha))^2\upsilon - 1 \right)ES_\alpha(\tildeX) = \fracg_\upsilon(t_\upsilon^-1(\alpha))1-\alpha \left( \frac\upsilon+(t_\upsilon^-1(\alpha))^2\upsilon - 1 \right)

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)


OCA documentation built on Feb. 16, 2023, 8:27 p.m.

Related to ES in OCA...