0% found this document useful (0 votes)
3 views23 pages

Chapter 3

The document discusses risk measures in finance, focusing on Value at Risk (V@R) and Expected Shortfall (ES), which are essential for assessing the risk of portfolios. It outlines their definitions, properties, and the regulatory framework established by the Basel Accord, emphasizing the importance of these measures for financial institutions. Additionally, the document covers methodologies for calculating these risk measures, including historical simulation and extreme value theory.

Uploaded by

lokakit0103
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views23 pages

Chapter 3

The document discusses risk measures in finance, focusing on Value at Risk (V@R) and Expected Shortfall (ES), which are essential for assessing the risk of portfolios. It outlines their definitions, properties, and the regulatory framework established by the Basel Accord, emphasizing the importance of these measures for financial institutions. Additionally, the document covers methodologies for calculating these risk measures, including historical simulation and extreme value theory.

Uploaded by

lokakit0103
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

All copyrights go to Wiley Finance

Abridged version
3
Risk Measures and Extreme Values

CONTENTS
3.1 Value at Risk (V@R) and Expected Shortfall (ES) . . . . . . . . . . . . . 113
3.2 Basel Accord and Properties of Risk Measures . . . . . . . . . . . . . . . . . . 116
3.3 Historical Simulation (Non-parametric Bootstrapping)
Approach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
3.4 Model Building Approach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
3.5 Approach via Extreme Value Theory (EVT) . . . . . . . . . . . . . . . . . . . . 126
3.6 Back Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
3.7 Estimation of Expected Shortfall . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133

Financial institutions are usually managing hundreds, or even thousands, of


portfolios of securities and derivatives everyday. It is important to have a sin-
gle number that summarizes the total risk in a portfolio of financial assets,
so as to measure the total risk to which the financial institution is exposed.
Value at Risk (V@R) is an attempt to provide such an index (measurement).
It was pioneered by J.P. Morgan [9] and has been used by the Basel Commit-
tee [3] in setting capital requirements for banks throughout the world. Closely
related to V@R is the Expected Shortfall (ES) which will be utilized in
accordance with Basel III1 . Definition and properties of these risk measures
will be introduced in this chapter. Other related issues such as back-testing,
historical simulation, and Extreme Value theory that provides a scientific ap-
proach on systematically studying very large tail values, will also be discussed.

3.1 Value at Risk (V@R) and Expected Shortfall (ES)


Consider a portfolio Q, we say that 1-day V@R(x) of Q is V means that we
are x percent certain that we shall not lose more than V dollars on the next
1 Basel III: international regulatory framework for banks. Retrieved from
[Link]

113
114Financial Data Analytics: with Machine Learning, Optimization and Statistics

day. In other words, V@R(x) is the lower (1 − x)-quantile of the distribution


of the change in Q (denoted by ∆Q). Mathematically speaking, let f be the
density (if exists) of ∆Q, or F be the CDF of ∆Q, then V@R(x) = V ⇒
RV
−∞
f (t)dt = F (V ) = 1 − x or V = F −1 (1 − x).

100 × (1 − x)%

Loss µ Profit
-V@R

Figure 3.1

Note that N -day V@R(x), denoted by V@R(N, x) = N V@R(x) assuming
that the daily changes are iid over the N -day period; besides, we implicitly
assume here that E(∆Q) = 0. Usually we work with the loss distribution of
Q (i.e. the positive amount of loss = −∆Q) so that the left tail becomes the
right tail.

Example 3.1.1. Assume that the daily loss distribution of a portfolio is nor-
mal with mean 0 and standard deviation $20 million. Find the 10-day 95%
V@R and 252-day 99% V@R.

Since 1-day V@R(x) = σΦ−1 (x) at any confidence level x, therefore 1-


day V@R(0.95) = ($20m)(1.645) = 32.9m and 1-day V@R(0.99) =
($20m)(2.326) = $46.52m.

Then the 10-day
√ V@R(0.95) is ( 10)($32.9m) = $104.04m and 252-day
V@R(0.99) is ( 252)($46.52m) = $738.48m.

V@R asks how bad the loss will be while Expected Shortfall (ES) asks: if
things do get bad, what is the expected loss?

100 × (1 − x)%

Loss Profit
-V@R

Figure 3.2

Mathematically speaking, let L be the loss of Q, ES(x) = E[L|L > V@R(x)].


Risk Measures and Extreme Values 115

ES is also known as Conditional V@R (CV@R) for this reason; for the con-
tinuous underlying distribution, it is equivalent to the tail conditional expec-
tation, i.e., with the equality in the conditional event.
Example 3.1.2. Consider a $10 million 1-year loan which has a 1.25% chance
of defaulting. If the loan default, the recovery of the loan principal is equally
likely from 0% to 100%. Find the 1-year 99% V@R and the 1-year 99% ES
respectively.

0.01 + 0.0025 = 0.0125

$0
1 25
0.0
1−
Q

0.0
12 5 u ∼ U (0, 1)
D −$10M × u Profit
-10 -V@R 0

If the loan is defaulted (with the probability of 0.0125), let x be the per-
centage of loan principal recovered. Then (0.0125)(x) = 0.01 or x = 0.8.
That is, 80% of $10m = $8m will be recovered with probability 0.01; or
V@R(0.99) = $10m − $8m = $2m. In other words, the probability of loss
greater than $2m is 80% of 1.25% = 1%.

Besides, the 1-year 99% ES is the expected loss given that the loss is greater
than $2m. Since the loss is uniformly distributed between $2m to $10m, the
mean is $6m. Note that an uniform distribution of X conditional on an event
of X > x is still another uniform distribution.
Example 3.1.3. Consider a portfolio consisting of two $10 million 1-year
loan as in Example 3.1.2. For simplicity, we further assume that if one loan
defaults then it is certain the other loans will not default. If the loan does not
default, a profit of $0.2 million is made. Find the 1-year 99% V@R and 1-year
99% ES of this portfolio.

0.01 + 0.015 = 0.025

5 $0.4M
.012
2 ×0
1−
Q

0.01
25 u ∼ U (0, 1)
D −$10M × u + $0.2M Profit
-9.8 -V@R 0.2

Each loan defaults with probability 1.25% and they never default together.
Therefore a default occurs with probability 2.5%. Let x be the percentage of
loan principal recovered. Then (0.025)(x) = 0.01 or x = 0.4. That is, 40% of
116Financial Data Analytics: with Machine Learning, Optimization and Statistics

$10m = $4m will be recovered with a probability of 0.01. However, there is


a profit of $0.2m is made on the other loan so that the 1-year 99% V@R is
$10m − $4m − $0.2m = $5.8m.

Moreover, the 1-year 99% ES of this portfolio is the expected loss given that
the loss is greater than $5.8. Since the loss is uniformly distributed between
$5.8m to $9.8m, the mean is $7.8m.

3.2 Basel Accord and Properties of Risk Measures


A risk measure is used for specifying capital requirement such as cash (or cap-
ital) that must be added to a bank or a financial institution to provide a buffer
for the underlying risk, which is also acceptable to the regulators, so that a
certain amount of redemption can be still be offered to the buyers in case of
bankruptcy. Since 1980, to keep a continuously monitoring on a healthy in-
vestment environment, supervisory authorities for Belgium, Canada, France,
Germany, Italy, Japan, Luxembourg, Netherlands, Sweden, Switzerland, UK
and US form a Committee on Banking Supervision, known as Bank for Inter-
national Settlements (BIS). They meet regularly in Basel of Switzerland (see
a map in Figure 3.3), and in 1996 Basel Committee issued an amendment to
the 1988 Accord which was then sometimes referred as “BIS 88” [2]. Banks
are required to calculate the 10-day 99% V@R measure. This means that it
focuses on the revaluation of loss over a 10-day period that expects to happen
with a probability no more than 1%. The Basel committee requires a bank
to hold k times this V@R measure. This regulatory multiplier k is chosen on
a bank-by-bank basis and must be at least 3. For a bank with an excellent
well-tested V@R model, it is likely that k = 3. For banks where their V@R
model does not perform well during the last 250 days, k may be as high as 4
[1].
There are some desirable properties that the risk measures ρ(·) : L2 (Ω; P) → R
should preferrably have:
1. Monotonicity: If a portfolio has a lower monetary value than another port-
folio for every possible outcome from the sample space, its risk measure
should be greater than that of the second. [RA ≤ RB ⇒ ρ(RA ) ≥ ρ(RB )].
2. Translational invariance: If we add $K cash to a portfolio, its risk measure
should go down by K units. [ρ(RA + K) = ρ(RA ) − K].
3. Homogeneity: Changing the size of a portfolio by a factor k should result
in the risk measure being multiplied by k. [ρ(kRA ) = kρ(RA )].

4. Subadditivity: The risk measure of two portfolios after they have been
Risk Measures and Extreme Values 117

Figure 3.3: The location of Basel, Switzerland.

merged should not be greater than the sum of their individual risk mea-
sures before they were merged. [ρ(RA + RB ) ≤ ρ(RA ) + ρ(RB )].
The first three conditions are straightforward while the fourth condition means
diversification helps to reduce the inherent risks. Risk measures satisfying all
these four conditions are said to be coherent. Let us recall the V@R and ES
in Examples 3.1.2 and 3.1.3, the 1-year 99% V@R of the two loans separately
is $2m + $2m = $4m which is less than $5.8m, the V@R of the portfolio. This
implies that V@R does not satisfy the subadditivity condition in general; yet
it still remains subadditive among elliptical distributions2 .

The 1-year 99% ES of the two loans separately is $6m + $6m = $12m which
is greater than $7.8m, the ES of the portfolio; indeed, ES generally fulfills the
subadditivity condition [5].
Theorem 3.2.1 (Subadditivity of ES). Let X and Y be two random vari-
ables, and let ESX (p) (resp. ESY (p)) denote the expected shortfall of X (resp.
Y ) at the lower (1 − p)-quantile. Then, for any p ∈ (0, 1),

ESX+Y (p) ≤ ESX (p) + ESY (p).

Proof. Note that ESX (p) admits the following expression:


1
ESX (p) = V@RX (p) + E[(X − V@RX (p))+ ].
1−p
n o
1
By Lemma 3.2 in [5], V@RX (p) ∈ arg min t + 1−p E[(X − t)+ ] for p ∈ (0, 1);
t∈R

2 An elliptical distribution is any member of a broad family that generalizes the multivari-

ate normal distribution. For example, this family includes the multivariate t-distribution.
118Financial Data Analytics: with Machine Learning, Optimization and Statistics

or to see this, assume for convenience that X is continuous with densify f


and tail function S, and consider the first-order condition of the function
1
g(t) := t + 1−p E[(X − t)+ ] as follows:
Z ∞ Z ∞
0 1 d 1 1
g (t) = 1+ (x−t)f (x)dx = 1+ −f (x)dx = 1− S(t) = 0,
1 − p dt t 1−p t 1−p
thennthe solution t = V@R(p)
o is obvious. Based on this, we have ESX (p) =
1
min t + 1−p E[(X − t)+ ] .
t∈R
Denote t1 := V@RX (p), t2 := V@RY (p) and t0 := t1 + t2 . Using the identity
(a + b)+ ≤ a+ + b+ for any real numbers a and b, we have
1
ESX (p) + ESY (p) = t1 + t2 + E[(X − t1 )+ + (Y − t2 )+ ]
1−p
1
≥ t0 + E[(X + Y − t0 )+ ]
1−p
 
1
≥ min t + E[(X + Y − t)+ ]
t∈R 1−p
= ESX+Y (p).

Although V@R is not coherent, it is easier to understand and use in the


back-testing than ES. Therefore, V@R has become the most popular risk
measure among the regulators and risk managers, as suggested by Basel II.
In fact, coherent risk measure is a rather commonly used concept within the
academia, though it is not as important in the actual practice before Basel III;
in accordance to the latter, the ES of the portfolio at a base liquidity horizon
of 10 days has to be provided [4].

3.3 Historical Simulation (Non-parametric Bootstrap-


ping) Approach
In the previous simplified examples, we calculate the V@R by assuming that
the return of the portfolio follows a uniform or normal distribution for sim-
plicity. There is another approach to calculate V@R based on the historical
data. Suppose that today is day n and we define vi as the value of a market
variable (stock price or index) on day i. Then (day n+1) tomorrow’s estimate,
based on the i − th scenario, is v̂n+1 (i) = vn × vi /vi−1 for i = 1, . . . , n. From
these, the portfolio values of these n scenarios are computed and the V@R
can be obtained. Let us illustrate this by the [Link] example. Suppose that
we spend $40,000 on buying HSBC, $30,000 on CLP and $30,000 on CK, re-
spectively on 31/12/2002 (resp. 31/8/2018). The following R codes compute
Risk Measures and Extreme Values 119

the 1-day V@R of this portfolio using historical simulation, see Figures 3.4
and 3.5 for 1999-2002 and 2014-2018, respectively.

d_old<-[Link]("stock_old.csv") # read in data


x_old<-[Link](d_old) # change to matrix
n_old<-nrow(x_old) # no. of obs

xn_old<-[Link](x_old[n_old,]) # select the last obs


w<-c(40000,30000,30000) # amount on each stock
p0_old<-sum(w) # total amount
ws_old<-w/xn_old # shares bought at day n
ns_old<-n_old-1 # [Link] scernarios
hsim_old<-NULL # initialize hsim
for (i in 1:ns_old) {
t_old<-xn_old*(x_old[i+1,]/x_old[i,]) # scenario i
hsim_old<-rbind(hsim_old,t_old # append t to hsim
}

hsim_old<-[Link](hsim_old) # change to matrix


ws_old<-[Link](ws_old)
ps_old<-[Link](hsim_old%*%ws_old) # portfolio value
loss_old<-p0_old-ps_old # loss
(VaRs_old<-quantile(loss_old,0.99)) # 1-day 99% V@R
> 3535.733

Figure 3.4
120Financial Data Analytics: with Machine Learning, Optimization and Statistics

d<-[Link]("stock_new.csv")
d_new=d[,2:4]
rownames(d_new)=d$Date
x_new<-[Link](d_new)
n_new<-nrow(x_new)

xn_new<-[Link](x_new[n_new,])
w<-c(40000,30000,30000)
p0_new<-sum(w)
ws_new<-w/xn_new
ns_new<-n_new-1
hsim_new<-NULL
for (i in 1:ns_new) {
t_new<-xn_new*(x_new[i+1,]/x_new[i,])
hsim_new<-rbind(hsim_new,t_new)
}

hsim_new<-[Link](hsim_new)
ws_new<-[Link](ws_new)
ps_new<-[Link](hsim_old%*%ws_old)
loss_new<-p0_new-ps_new
(VaRs_new<-quantile(loss_new,0.99))
> 2181.303

Figure 3.5
Risk Measures and Extreme Values 121

Note that the cost of the portfolio is $100,000 based on the closing price on
31/12/2002 (resp. 31/8/2018). Then we compute the stock prices of these n
scenarios and save them in hsim. Further, we compute the portfolio value of
ps and the losses of these n scenarios, and finally the 1-day 99% V@R is ob-
tained from the 99th percentile, V@R = $3535.733 (resp. 2181.303).

The above historical simulation method puts equal weight to each historical
data. This method can be modified by putting different weight depending
on the ratio of the (n + 1)-th and i-th volatilities. To this end, we assume
v −v
that σ1i i vi−1i−1 follows a common distribution for all i = 1, 2, . . . , n, e.g.
N (0, 1) or t(ν), the value of vn+1 can be estimated by the i − th scenario as
1 v̂n+1 (i) − vn = 1 vi − vi−1 which gives:
σn+1 vn σi vi−1
vi−1 + (vi − vi−1 )σn+1 /σi
v̂n+1 (i) = vn × vi−1 for i = 1, . . . , n,

where σi is the estimated volatility using the EWMA or GARCH(1, 1) model


introduced in Chapter 2, see Figure 3.6 (resp. 3.7).
122Financial Data Analytics: with Machine Learning, Optimization and Statistics

library(tseries)

d_old<-[Link]("stock_old.csv") # read in data


t_old<-[Link](d_old$HSBC) # change to matrix
xn_old <- t_old[length(t_old)]
n_old<-nrow(x_old) # no. of obs
u_old <- (lag(t_old)-t_old)/t_old # stock returns

vol_old <- garch(u_old,order=c(1,1)) # fit the GARCH(1,1) model


w <- 100000 # initial portfolio value
ws_old <- w/t_old[length(t_old)] # shares owned on day n
ns_old <- length(t_old)-1 # number of scenarios
hsim_old <- NULL # initialize hsim

# Fitted variance on day n


var.n_old <- (vol_old$coef[1]
+ vol_old$coef[2]*u_old[length(u_old)]^2
+ vol_old$coef[3]*vol_old$[Link][,1][length(u_old)]^2)

for(i in 3:ns_old){
vol.i_old <- vol_old$[Link][,1][i]
r_old <- xn_old*(t_old[i-1]+(t_old[i]-t_old[i-1])*
sqrt(var.n_old)/vol.i_old)/t_old[i-1]
hsim_old <- rbind(hsim_old,r_old)
}

portfolio_old <- hsim_old*ws_old # portfolio value


loss_old <- w - portfolio_old # loss
(VaRs_old <- quantile(loss_old,0.99)) # 1-day 99% VaR
99%
3115.264

Figure 3.6: For the 1999-2002 dataset.


Risk Measures and Extreme Values 123

d_new<-[Link]("stock_new.csv")
t_new<-[Link](d_new$HSBC) # change to matrix
xn_new <- t_new[length(t_new)]
n_new<-nrow(x_new) # no. of obs
u_new <- (lag(t_new)-t_new)/t_new # stock returns

vol_new <- garch(u_new,order=c(1,1)) # fit the GARCH(1,1) model


w <- 100000 # initial portfolio value
ws_new <- w/t_new[length(t_new)] # shares owned on day n
ns_new <- length(t_new)-1 # number of scenarios
hsim_new <- NULL # initialize hsim

# Fitted variance on day n


var.n_new <- (vol_new$coef[1]
+ vol_new$coef[2]*u_new[length(u_new)]^2
+ vol_new$coef[3]*vol_new$[Link][,1][length(u_new)]^2)

for(i in 3:ns_new){
vol.i_new <- vol_new$[Link][,1][i]
r_new <- xn_new*(t_new[i-1]+(t_new[i]-t_new[i-1])
*sqrt(var.n_new)/vol.i_new)/t_new[i-1]
hsim_new <- rbind(hsim_new,r_new)
}

portfolio_new <- hsim_new*ws_new # portfolio value


loss_new <- w - portfolio_new # loss
(VaRs_new <- quantile(loss_new,0.99)) # 1-day 99% VaR
99%
1986.788

Figure 3.7: For the 2014-2018 dataset.


124Financial Data Analytics: with Machine Learning, Optimization and Statistics

3.4 Model Building Approach


Another approach of calculating V@R is based on the assumption that
the corresponding relative returns of the p market variables ui,j = (vi,j −
vi,j−1 )/vi,j−1 at time j, and for i = 1, . . . , p, these market variables follow a p-
variate normal distribution Np (0, Σ). Assume that we have $w = (w1 , . . . , wp )
invested on the p market variables. We bought, for i = 1, . . . , p, wi /vi0 shares
of the i − th market variable at time 0. When the market price changes from
vi0 to vi1 , the newly acquired market value of each stock is wi vi1 /vi0 and the
monetary change is wi vi1 /vi0 − wi = wi (vi1 − vi0 )/vi0 = wi ui1 . Hence the
change in the portfolio value on the j-th period is ∆Pj = w1 u1j + . . . + √wp upj .
We estimate the standard deviation of the random change ∆P by w> Sw
where S is the sample covariance matrix of u = (u1 , . . . , up )> . Since we as-
sume that the mean√ of the random vector √ u is zero, therefore the 1-day 99%
V@R is z0.99 × w> Sw = 2.32635 × w> Sw. Let us illustrate this by the
[Link] example again with the R codes in Figures 3.8 (for 1999-2002) and
3.9 (for 2014-2018).

t1_old<-[Link](d_old$HSBC) # change to time series


t2_old<-[Link](d_old$CLP)
t3_old<-[Link](d_old$CK)
u1_old<-(lag(t1_old)-t1_old)/t1_old # compute u
u2_old<-(lag(t2_old)-t2_old)/t2_old
u3_old<-(lag(t3_old)-t3_old)/t3_old
u_old<-cbind(u1_old,u2_old,u3_old) # form matrix u
S_old<-var(u_old) # sample cov. matrix
dp_old<-[Link](u_old*w) # Delta P
sdp_old<-sd(dp_old) # sd of portfolio (empirical)
(VaRn_old<-qnorm(0.99)*sdp_old) # compute 1-day 99% V@R
3062.165

Figure 3.8
Risk Measures and Extreme Values 125

t1_new<-[Link](d_new$HSBC)
t2_new<-[Link](d_new$CLP)
t3_new<-[Link](d_new$CK)
u1_new<-(lag(t1_new)-t1_new)/t1_new
u2_new<-(lag(t2_new)-t2_new)/t2_new
u3_new<-(lag(t3_new)-t3_new)/t3_new
u_new<-cbind(u1_new,u2_new,u3_new)
S_new<-var(u_new)
dp_new<-[Link](u_new*w)
sdp_new<-sd(dp_new)
(VaRn_new<-qnorm(0.99)*sdp_new)
1990.264

Figure 3.9

Note that in the above R codes, we directly√ compute the sample standard
deviation of ∆P which is the same as w> Sw. The 1-day 99% V@R using
normal model is V aRn = $3062.165 which is less than V aRs = $3535.733.
The normality assumption may not be valid since most returns have a fatter
tail than that of the normal distribution. Hence the V aRn under the nor-
mality assumption is over-optimistic. Recall that we can model the return by
a student’s t-distribution in Section 1.7. Let us compute the sample excess
kurtosis of ∆P , ζˆ2 , and estimate the degrees of freedom by (6/ζˆ2 + 4) rounded
to the nearest integer. Refer to Figure 3.10 (resp. 3.11).

ku_old<-sum((dp_old/sdp_old)^4)/length(dp_old)-3
v_old<-round(6/ku_old+4)
# 1-day 99% V@R
VaRt_old<-qt(0.99,v_old)*sdp_old*sqrt((v_old-2)/v_old)
VaRt_old
3377.59

Figure 3.10: For the dataset of 1999-2002, with a t-distribution.


126Financial Data Analytics: with Machine Learning, Optimization and Statistics

ku_new<-sum((dp_new/sdp_new)^4)/length(dp_new)-3
v_new<-round(6/ku_new+4)
VaRt_new<-qt(0.99,v_new)*sdp_new*sqrt((v_new-2)/v_new)
VaRt_new
2195.275

Figure 3.11: For the dataset of 2014-2018, with a t-distribution.

3.5 Approach via Extreme Value Theory (EVT)


In modeling empirical data, one useful law is the Power Law, first properly
proposed by Pareto in 1897 [12]. This law states that the probability of a
random variable V > x, P(V > x) ∝ x−α for some α > 0. This law provides a
good model for estimating the tail probability of rare events. Let F (x) be the
cumulative distribution function of a random variable X, i.e. P(X ≤ u) = F (u)
or P(X > u) = 1 − F (u). Then

P(u < X ≤ u + y) = F (u + y) − F (u).


Now given X > u, the conditional probability of u < X ≤ u + y is
F (u + y) − F (u)
Fu (y) = P(u < X ≤ u + y |X > u) = .
1 − F (u)

Gnedenko (1943)[6] proved that Fu (y) → Gξ,β (y) = 1 − (1 + ξy/β)−1/ξ as


u → ∞, for some ξ and β, here Gξ,β (y) is called the generalized Pareto dis-
tribution with the shape parameter ξ and the scale parameter β. For most
financial data, ξ > 0 and falls in the range [0.1, 0.4] [8]. For further reading
on extreme value theory, we refer to Resnick (2008)[13] and De Haan (2011)[7].

Suppose that we sort the n observations xi in a decreasing order and find


that there are nu observations xi > u. For a large enough u, we can estimate
P(X > u + y|X > u) by 1 − Gξ,β (y) and 1 − F (u) by nu /n. Hence the
unconditional probability is:
nu  y −1/ξ
P(X > u + y) ≈ (1 − F (u)) (1 − Gξ,β (y)) = 1+ξ ,
n β
which implies that
nu  x − u −1/ξ nu  x − u −1/ξ
P(X > x) ≈ 1+ξ , and so P(X ≤ x) ≈ 1− 1+ξ .
n β n β

Note that if we take u = β/ξ, then P(X > x) ≈ (nu /n)(ξ/β)−1/ξ x−1/ξ , which
Risk Measures and Extreme Values 127

satisfies the Power Law. From the above equation, we can calculate 1-day
(100(1 − ε)) % V@Rε :

nu  V@Rε − u − ξ1 β h n · ε −ξ i
1−ε=1− 1+ξ ⇒ V@Rε = u + −1 .
n β ξ nu
Since the density of the generalized Pareto distribution is

gξ,β (y) = dGξ,β (y)/dy = (1/β)(1 + ξy/β)−1/ξ−1 ,

the log-likelihood function is


nu    h 
X 1 ξ(xi − u) i
l= − + 1 ln 1 + − ln β
i=1
ξ β
 Xnu  
1 ξ(xi − u)
= −nu ln β − +1 ln 1 + .
ξ i=1
β

We can find the MLEs ξˆ and β̂ by maximizing the log-likelihood function and
then calculating the 1-day (100(1 − ε)) % V@R by:

β̂  
ˆ u )−ξ̂ − 1 .
V @Rε = u + (n · ξ/n
ξˆ
The only question remains is how to choose the threshold value u. In practice,
we should first apply the standardized transformation zi = (xi − x̄)/s, set u
to be close to the lower 0.95-quantile of the empirical distribution of zi 3 and
find the V @Rε of z. Finally the V @Rε of x will be x̄ + sV @Rε .

Let us illustrate this by the previous example. Note that we use the R built-in
function optim() to minimize the negative of the log-likelihood function (See
help(optim) for details).

# EVT
u<-3.2 # threshold value
m<-mean(loss) # mean loss
s<-sd(loss) # sd loss
z<-(loss-m)/s # standardize loss
zx<-z[z>u] # select z>u
nu<-length(zx) # no. of zx

Figure 3.12

3A favorable practice is to choose some value between 2.7 and 3.2.


128Financial Data Analytics: with Machine Learning, Optimization and Statistics

log_lik<-function(p,dat) { # p=(xi,beta)
length(dat)*log(p[2])+(1/p[1]+1)*sum(log((1+p[1]*dat/p[2])))
}

p0<-c(0.2,0.01) # initial p0
res_old<-optim(p0,log_lik,dat=(zx_old-u)) # min -log_lik
(p_old<-res_old$par) # MLE p=(xi,beta)
[1] 0.6755755 0.3117039
-res_old$value # max value
[1] -3.058536
q<-0.99
(VaR_old<-u+(p_old[2]/p_old[1])*((length(z_old)*
(1-q)/nu_old)^(-p_old[1])-1))
[1] 3.056386
(VaRe_old<-m_old+VaR_old*s_old) # 1day 99% V@R by EVT
[1] 4000.848

Figure 3.13: For the dataset of 1999-2002, using EVT.

Now the 1-day 99% V@R using normal-model is V aRn = $3062.165 (resp.
$1990.264); that using t-model is V aRt = $3377.59 (resp. $2195.275); and
that using extreme value theory is V aRe = $4000.848. A natural question is
which V@R is more suitable? In general, the Extreme Value Theory (EVT) is
theoretically the most rigorous, and should be preferred if there is abundant
data, as EVT uses only data at the tail of the loss distribution. For small
datasets, the t-model is preferred over the normal-model as loss distributions
are more likely to have fat tails. We can actually test these V@R using the
previous data to see which one is more reasonable. This is called back-testing
and will be introduced in the next section.

3.6 Back Testing


V@R calculation is based on the knowledge of the loss distribution. It is im-
portant to test how accurate the V@R estimate really is. An important reality
check is back testing. Let the 1-day V@R at the level of (100X)% be $V . We
called an exception occur if the portfolio value is less than $V on a given day.
If the V@R model is accurate, the probability of the portfolio value less than
$V on any given day is p = 1 − X. Suppose that we look at a total of n days
and we observe that m exceptions occur in these n days, where the proportion
m/n > p. Should we reject the model for producing a low V@R value? This
Risk Measures and Extreme Values 129

can be tested formally by using the following binomial test [11]:

H0 : Probability of an exception on any given day is p.


H1 : Probability of an exception on any given day is greater than p (as we see
now mn > p!).

The probability of having at least m exceptions out of n days is


n  
X n k
P0 = p (1 − p)n−k ,
k
k=m

under H0 . We reject H0 if P0 < α, the significance level, say α = 0.05.

This probability can be computed using the R function 1-pbinom(m,n,p) or


using the EXCEL function 1-binomdist(m,n,p,TRUE). Let us set n = 250
days, X = 0.99 so that p = 0.01. We compute P0 for m = 0, . . . , 10.

> m<-0:10
> round(1-pbinom(m,250,0.01),4)
0.9189 0.7142 0.4568 0.2419 0.1078 0.0412 0.0137
0.0040 0.0011 0.0003 0.0001

Figure 3.14

It is clear that P0 > 0.05 if m < 5. The 1986 BIS Amendment requires V@R
models to be back tested. Banks should look at the number of exceptions m
during the previous 250 days. If m < 5, then the riskiness of the portfolio
is considered in the green zone, and the regulatory multiplier is set at its
minimum value (k = 3). If m is 5, 6, 7, 8, or 9, the riskiness of the portfolio
is considered in the yellow zone, and k is set at 3.4, 3.5, 3.65, 3.75 and 3.85,
respectively. Finally, if m ≥ 10, k will be set to 4 and the riskiness of the
portfolio is considered in the red zone [1]. Figure 3.16 shows that k possesses
a linear relationship with m in the yellow zone, and the other values of k in
this zone can be calculated by linear interpolation from the values of k for m
in the range of 4 to 10.
Now let us continue with the [Link] and back test the 1-day 99% V@R
using historical simulation and normal model. From the output in Figures 3.17
and 3.18 we found that the numbers of exceptions in the past 250 days for
all approach are less than 5; except that for the historical simulation, there
were 10 days resulting in exceptions. According to 1986 BIS, if the exceptions
found in the past 250 days less than 5, the regulatory multiplier should be
set to 3 for all, except setting to 4 by using V@Rs over the period of 2014 to
2018.
130Financial Data Analytics: with Machine Learning, Optimization and Statistics

Figure 3.15: Table 2 from [1].

Figure 3.16: The fitted line of k against m.


Risk Measures and Extreme Values 131

n_old<-nrow(d_old)-1 # no. of obs. of u


n1_old<-n_old-250+1 # starting index
x_old<-[Link](d_old[n1_old:n_old,]) # recent 250 days
ps_old<-[Link](x_old*ws_old) # portfolio value
ps_old<-c(ps_old,sum(w)) # add total amount
loss_old<-ps_old[1:250]-ps_old[2:251] # compute daily loss
sum(loss_old>VaRs_old) # no. of exceptions
0
sum(loss_old>VaRn_old)
0
sum(loss_old>VaRt_old)
0
sum(loss_old>VaRe_old)
0

Figure 3.17: For the financial data of 1999-2002.

n_new<-nrow(d_new)-1
n1_new<-n_new-250+1
x_new<-[Link](d_new[n1_new:n_new,2:4])
ps_new<-[Link](x_new*ws_new)
ps_new<-c(ps_new,sum(w))
loss_new<-ps_new[1:250]-ps_new[2:251]
sum(loss_new>VaRs_new)
2
sum(loss_new>VaRn_new)
2
sum(loss_new>VaRt_new)
1

Figure 3.18: For the financial data of 2014-2018.


132Financial Data Analytics: with Machine Learning, Optimization and Statistics

3.7 Estimation of Expected Shortfall


Recall that the Expected Shortfall at level ε is ESL (ε) = E[L | L > V@Rε ],
where L is the loss random variable and V@Rε is the value-at-risk of L at the
level (100(1 − ε)) %. Let qε be the (100(1 − ε)) % percentile from N (0, 1), for
instance, if ε = 0.01, qε = 2.3262.

1. If L ∼ N (µ, σ 2 ), then
 2
σ q σ
ESL (ε) = √ exp − ε + µ = φ(qε ) + µ, (3.1)
ε 2π 2 ε

where φ(·) is the standard normal density function. To see this formula,
for simplicity, we first assume that Z ∼ N (0, 1). The conditional density of
Z given Z > qε is √1 exp(−x2 /2) for qε < x < ∞. Then the expected
ε 2π
shortfall of Z is
Z ∞ Z ∞ 
x2 x2

1 1
ESZ (ε) = √ x exp(− )dx = √ d − exp(− )
qε ε 2π 2 ε 2π qε 2

1 x2 1 q2 1
= − √ exp(− ) = √ exp(− ε ) + 0 = φ(qε ).
ε 2π 2 ε 2π 2 ε

In general, when L ∼ N (µ, σ 2 ), after using the simple transformation of


L = µ + σZ, and noting that ESL (ε) = µ + σESZ (ε), we have
 2
σ q σ
ESL (qε ) = √ exp − ε + µ = φ(qε ) + µ,
ε 2π 2 ε

as desired. For example, when ε = 0.01, qε = 2.3262, ESL (qε ) ≈ 2.6652σ +


µ.
2. If we have enough data, the expected shortfall can be more accurately
determined by the generalized Pareto distribution. Recall that for an ar-
bitrary u > 0, the following cumulative probability function
 − ξ1
ξ
Gξ,β (x) = 1 − 1 + (x − u)
β

is the approximate conditional probability P(u < X < u + x|X > u)


in accordance with Gnedenko’s theorem, and the associated conditional
probability density function is then
 − ξ1
dGξ,β (x) 1 ξ
gξ,β (x) = = 1+ (x − u) .
dx β β
Risk Measures and Extreme Values 133

Hence,
Z ∞
E [X|X > u] = xgξ,β (x)dx
u

Z ∞
= x[Gξ,β (x) − 1] − (Gξ,β (x) − 1) dx
u u
"  −1/ξ  1−1/ξ #∞
ξ β ξ
= −x 1 + (x − u) − 1 + (x − u)
β 1−ξ β
u
" 1−1/ξ   #u
ξ βx β
= 1 + (x − u) + ,
β β + ξ(x − u) 1 − ξ

hξ i1−1/ξ
note that if ξ < 1, which is generally the case, lim 1+ (x−u) =0
x→∞ β
and hence
β
E[X|X > u] = u + .
1−ξ
Setting the threshold u = V@Rε at the level of (100(1 − ε)) %, we get the
expected shortfall
β
ESX = E [X|X > V@Rε ] = V@Rε + .
1−ξ
Given a plenty amount of data with losses greater than VaRε , the param-
eters ξ and β can be accurately estimated.
3. If we do not want to impose any distributional assumption on L, we can
estimate ESL (ε) by sorting the losses: L(1) , . . . , L(n) in descending order.
Then,
1 PK−1 
K −1 L ,

ESL (ε) = k=1 L(k) + 1 − εn (K)
εn
where K is the smallest integer greater than εn. We note that this formula
simply assigns equal weights in each node, with a continuity correction on
the final term.

These calculations can be easily done by using R, Python, or even EXCEL.

Bibliography
[1] Basel Committee on Banking Supervision. (1996). Supervisory framework
for the use of “backtesting” in conjunction with the internal models ap-
proach to market risk capital requirements. Basel: Bank for International
Settlements. Retrieved from [Link]
134Financial Data Analytics: with Machine Learning, Optimization and Statistics

[2] Basel Committee on Banking Supervision. (1996). Amendment to the


capital accord to incorporate market risks. Basel: Bank for International
Settlements. Retrieved from [Link]
[3] Basel Committee on Banking Supervision. (2016). Minimum capital re-
quirements for market risk. Basel: Bank for International Settlements.
Retrieved from [Link]

[4] Basel Committee on Banking Supervision. (2019). Minimum capital re-


quirements for market risk. Basel: Bank for International Settlements.
Retrieved from [Link]
[5] Embrechts, P., & Wang, R. (2015). Seven proofs for the subadditivity of
expected shortfall. Dependence Modeling, 3(1).

[6] Gnedenko, B. (1943). Sur La Distribution Limite Du Terme Maximum


D’Une Série Aléatoire. The Annals of Mathematics, 44 (3), 423. doi:
10.2307/1968974.
[7] Haan, L. de, & Ferreira, A. (2011). Extreme value theory: an introduction.
New York: Springer.

[8] Hull, J. (2012). Risk management and financial institutions,+ Web Site
(Vol. 733). John Wiley & Sons.
[9] J.P. Morgan. (1996). Risk Metrics: technical document. New York, N.Y.
[10] McNeil, A. J., Frey, R., & Embrechts, P. (2005). Quantitative risk man-
agement: concepts, techniques and tools. Princeton university press.
[11] Moreno-Montoya J. Benford´s Law with small sample sizes: A new exact
test useful in health sciences during epidemics. Salud UIS, 2020 52(2),
161-163.

[12] Pareto, V. (1897). Cours d’Économique Politique, Vol. 2. Macmillan,


Paris.
[13] Resnick, S. I. (2008). Extreme values, regular variation, and point pro-
cesses. New York, NY: Springer.

You might also like