25
Chapter 4 Expected Shortfall Expected Shortfall (ES) is a risk measure computed by averating potential losses above a certain level given by the Value at Risk (VaR). It can be shown that the Expected Shortfall at the confidence level p coincides with the Tail Value at Risk (TVaR) defined as the average of losses suffered in the worst (1 - p)% of events. This chapter presents the concept of coherent risk measure, including Expected Shortfall and Tail Value at Risk (TVaR), together with experiments based on financial data sets. 4.1 Tail Value at Risk (TVaR) ...................... 77 4.2 Conditional Tail Expectation (CTE) ............. 78 4.3 Expected Shortfall (ES) ........................ 81 4.4 Market Data vs Gaussian Risk Measures ......... 88 Exercises ........................................... 97 4.1 Tail Value at Risk (TVaR) A natural shortcoming of Value at Risk is failing to provide information on the behavior of probability distribution tails beyond V p X . The next figure illustrates the limitations of Value at Risk, namely its inability to capture the properties of a probability distribution beyond V p X . “Value at Risk is like an airbag that works all the time, except when you have a car accident”. - D. Einhorn, hedge fund manager. " 77 This version: June 13, 2021 https://personal.ntu.edu.sg/nprivault/indext.html

Expected Shortfall - Nanyang Technological UniversityChapter 4 Expected Shortfall Expected Shortfall (ES) is a risk measure computed by averating potential losses above a certain level

  • Upload
    others

  • View
    10

  • Download
    0

Embed Size (px)

Citation preview

  • Chapter 4Expected Shortfall

    Expected Shortfall (ES) is a risk measure computed by averating potentiallosses above a certain level given by the Value at Risk (VaR). It can beshown that the Expected Shortfall at the confidence level p coincides withthe Tail Value at Risk (TVaR) defined as the average of losses suffered inthe worst (1− p)% of events. This chapter presents the concept of coherentrisk measure, including Expected Shortfall and Tail Value at Risk (TVaR),together with experiments based on financial data sets.

    4.1 Tail Value at Risk (TVaR) . . . . . . . . . . . . . . . . . . . . . . 774.2 Conditional Tail Expectation (CTE) . . . . . . . . . . . . . 784.3 Expected Shortfall (ES) . . . . . . . . . . . . . . . . . . . . . . . . 814.4 Market Data vs Gaussian Risk Measures . . . . . . . . . 88Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97

    4.1 Tail Value at Risk (TVaR)

    A natural shortcoming of Value at Risk is failing to provide information onthe behavior of probability distribution tails beyond V pX . The next figureillustrates the limitations of Value at Risk, namely its inability to capturethe properties of a probability distribution beyond V pX .†

    † “Value at Risk is like an airbag that works all the time, except when you have a caraccident”. - D. Einhorn, hedge fund manager.

    " 77

    This version: June 13, 2021https://personal.ntu.edu.sg/nprivault/indext.html

    https://personal.ntu.edu.sg/nprivault/indext.html

  • N. Privault

    Fig. 4.1: Two distributions having the same Value at Risk V 95%X = 2.145.

    The Tail Value at Risk (or Conditional Value at Risk) aims at providing asolution to the tail distribution problem observed with Value at Risk at thelevel p, by averaging over confidence levels ranging from p to 1.Definition 4.1. The Tail Value at Risk of a random variable X at the levelp ∈ (0, 1) is defined by the average

    TVpX :=1

    1− pw 1pV qXdq. (4.1)

    Note that since the function p 7−→ V pX is non-decreasing, we always have

    TVpX =1

    1− pw 1pV qXdq >

    11− p

    w 1pV pXdq = V

    pX .

    4.2 Conditional Tail Expectation (CTE)

    Recall that by Lemma 10.14, given an event A such that P(A) > 0, theconditional expectation of X : Ω −→N given the event A satisfies

    E[X | A] = 1P(A)

    E [X1A] ,

    see Section 3.2 for an example.Definition 4.2. Consider a random variable X such that P

    (X > V pX

    )> 0.

    The Conditional Tail Expectation of X at the level p ∈ (0, 1) is the quantity

    CTEpX := E[X | X > V pX

    ]=

    1P(X > V pX

    )E[X1{X>V pX}].

    The use of the strict inequality “>” in the definition of the Conditional TailExpectation allows us to avoid any dependence on P(X = V pX ), and to con-sider risky values strictly beyond V pX . The Conditional Tail Expectation is

    78 "

    This version: June 13, 2021https://personal.ntu.edu.sg/nprivault/indext.html

    https://personal.ntu.edu.sg/nprivault/indext.html

  • Notes on Financial Risk and Analytics

    also called Conditional Value at Risk (CVaR).

    Examples of Conditional Tail Expectations can be computed as in the fol-lowing R code.

    1 library(quantmod)2 getSymbols("^HSI",from="2013-06-01",to="2014-10-01",src="yahoo")

    returns

    V pX with, more precisely,

    CTEpX = E[X | X > V pX

    ]= V pX + E

    [(X − V pX

    )+ | X > V pX].Proof. We have

    E[X | X > V pX

    ]=

    1P(X > V pX

    )E[X1{X>V pX}]

    =1

    P(X > V pX

    )(E[(X − V pX)1{X>V pX}]+ V pXE[1{X>V pX}])=

    1P(X > V pX

    )(E[(X − V pX)+]+ V pXP(X > V pX))= V pX +

    1P(X > V pX

    )E[(X − V pX)+]= V pX + E

    [(X − V pX

    )+ ∣∣X > V pX].See Exercise 4.2-(d) for a proof of CTEpX > E[X ]. �

    Next, we check that when P(X = V pX

    )= 0, the Conditional Tail Expectation

    coincides with the Tail Value at Risk. Note that in this case we have P(X >

    V pX)> 0 by Proposition 3.9-(b).

    Proposition 4.4. Assume that P(X = V pX

    )= 0. Then we have CTEpX =

    TVpX , i.e.

    CTEpX = E[X | X > V pX

    ]= E

    [X | X > V pX

    ]=

    11− p

    w 1pV qXdq = TV

    pX .(4.2)

    Proof. By Lemma 3.13 we construct X as X = V UX where U is uniformlydistributed on [0, 1], with

    " 79

    This version: June 13, 2021https://personal.ntu.edu.sg/nprivault/indext.html

    https://personal.ntu.edu.sg/nprivault/indext.html

  • N. Privault

    U > p =⇒ V UX > VpX =⇒ X > V

    pX ,

    andX > V pX =⇒ V

    UX > V

    pX =⇒ U > p.

    Since P(X = V pX

    )= 0 we find that, with probability 1,

    U > p⇐⇒ U > p⇐⇒ V UX > VpX ⇐⇒ X > V

    pX ⇐⇒ X > V

    pX ,

    hence

    CTEpX = E[X | X > V pX

    ]= E

    [V UX | V UX > V

    pX

    ]= E

    [V UX | U > p

    ]=

    1P(U > p)

    E[V UX 1{U>p}

    ]=

    11− p

    w 1pV qXdq.

    The next figure shows the location of Value at Risk and Conditional TailExpectation on a data set. Note that the sign of the data has been changedaccording to Proposition 3.10.

    Fig. 4.2: Value at Risk and Conditional Tail Expectation.

    The Conditional Tail Expectation of a Gaussian N (µ,σ2) random variableis computed in the next proposition.

    Proposition 4.5. Gaussian CTE. Given X ' N (µ,σ2) we have

    CTEpX = µ+σ

    (1− p)φ(VpZ ) = µ+

    σ

    (1− p)√

    2πe−(V

    pZ)2/2, (4.3)

    80 "

    This version: June 13, 2021https://personal.ntu.edu.sg/nprivault/indext.html

    https://personal.ntu.edu.sg/nprivault/indext.html

  • Notes on Financial Risk and Analytics

    where V pZ is the Value at Risk of Z ' N (0, 1) at the level p and

    φ(z) =1√2π

    e−z2/2, x ∈ R,

    is the standard normal probability density function.

    Proof. Using the relation P(X > V pX

    )= P

    (X > V pX

    )= 1− p, cf. Proposi-

    tion 3.9, we have

    CTEpX = TVpX

    = E[X | X > V pX

    ]=

    1P(X > V pX

    )E[X1{X>V pX}]

    =1

    1− pw∞V pX

    xe−(x−µ)2/(2σ2) dx√2πσ2

    1− pw∞V pX

    e−(x−µ)2/(2σ2) dx√2πσ2

    +1

    1− pw∞V pX

    (x− µ)e−(x−µ)2/(2σ2) dx√2πσ2

    1− pP(X > VpX ) +

    σ2

    (1− p)√

    2πσ2[−e−(x−µ)2/(2σ2)

    ]∞V pX

    = µ+σ2

    (1− p)√

    2πσ2e−((V

    pX−µ)/σ)2/2

    = µ+σ

    (1− p)√

    2πe−(V

    pZ)2/2

    = µ+σ

    (1− p)φ(VpZ ),

    due to the rescaling relation V pX = µ+ σqpZ , cf. (3.7). �

    4.3 Expected Shortfall (ES)

    There are several variants for the definition of the Expected Shortfall ESpX .Next is a frequently used definition.

    Definition 4.6. The Expected Shortfall ESpX of a random variable X at thelevel p ∈ (0, 1) is defined by

    ESpX := VpX +

    11− pE

    [(X − V pX

    )1{X>V p

    X}]. (4.4)

    We also have

    ESpX = VpX +

    P(X > V pX

    )1− p E

    [X − V pX

    ∣∣X > V pX]" 81

    This version: June 13, 2021https://personal.ntu.edu.sg/nprivault/indext.html

    https://personal.ntu.edu.sg/nprivault/indext.html

  • N. Privault

    = V pX +1

    1− p(E[X1{X>V p

    X}]− V pXE

    [1{X>V p

    X}])

    = V pX +1

    1− p(E[X1{X>V p

    X}]− V pXP

    (X > V pX

    ))=

    11− pE

    [X1{X>V p

    X}]+

    V pX1− p

    (1− p−P

    (X > V pX

    )),

    and

    ESpX =

    1

    1− pE[X1{X>V p

    X}]= E

    [X | X > V pX

    ]= TVpX if P

    (X = V pX

    )= 0,

    11− pE

    [X1{X>V p

    X}]+

    V pX1− p

    (1− p−P

    (X > V pX

    ))if P

    (X = V pX

    )> 0,

    as shown in the next proposition. Note that by Proposition 3.9-(b) we haveP(X > V pX

    )> 0 when P

    (X = V pX

    )= 0.

    Proposition 4.7. When P(X = V pX

    )= 0 the Expected Shortfall ESpX co-

    incides with the Conditional Tail Expectation CTEpX and the Tail Value atRisk TVpX , i.e., we have

    ESpX = E[X | X > V pX

    ]= E

    [X | X > V pX

    ]= TVpX .

    Proof. By Proposition 3.9, when P(X = V pX

    )= 0 we have

    p = P(X 6 V pX ) and 1− p = P(X > VpX ) = P(X > V

    pX ),

    hence

    ESpX =1

    1− pE[X1{X>V p

    X}]

    =1

    1− pE[X1{X>V p

    X}]

    =1

    P(X > V pX

    )E[X1{X>V pX}]

    = E[X | X > V pX

    ]= TVpX ,

    by Proposition 4.4. �

    When P(X = V pX

    )= 0, we also have

    ESpX =1

    1− pE[X1{X>V p

    X}]+ V pX −

    V pX1− pP

    (X > V pX

    )=

    11− pE

    [X1{X>V p

    X}]+

    V pX1− p

    (1− p−P

    (X > V pX

    )).

    82 "

    This version: June 13, 2021https://personal.ntu.edu.sg/nprivault/indext.html

    https://personal.ntu.edu.sg/nprivault/indext.html

  • Notes on Financial Risk and Analytics

    Proposition 4.8. The Expected Shortfall ESpX can be written as the dis-torted risk measure

    ESpX =1

    1− pE[XfX (X)] =w 1

    0V qXfX (V

    qX )dq, (4.5)

    where fX is the distortion function defined by

    fX (x) :=1

    1− p1{x>VpX} + 1{P(X=V p

    X)>0}

    1− p−P(X > V pX

    )(1− p)P

    (X = V pX

    ) 1{x=V pX},

    x ∈ R.

    Proof. We have

    ESpX =1

    1− pE[X1{X>V p

    X}]+

    V pX1− p

    (1− p−P

    (X > V pX

    ))=

    11− pE

    [X1{X>V p

    X}]+ 1{P(X=V p

    X)>0}

    V pX1− p

    (1− p−P

    (X > V pX

    ))=

    11− pE

    [X

    (1{X>V p

    X} + 1{P(X=V p

    X)>0}

    1− p−P(X > V pX

    )P(X = V pX

    ) 1{X=V pX}

    )].

    Note that the distortion function fX is a non-decreasing function that satisfies

    E[fX (X)] =1

    1− pE[1{X>V p

    X} + 1{P(X=V p

    X)>0}

    1− p−P(X > V pX

    )P(X = V pX

    ) 1{X=V pX}

    ]

    =1

    1− p

    (E[1{X>V p

    X}]+ 1− p−P

    (X > V pX

    ))=

    11− p

    (P(X > V pX

    )+ 1− p−P

    (X > V pX

    ))= 1, x ∈ R. (4.6)

    The following proposition, see Acerbi and Tasche (2001), shows that in gen-eral, the Expected Shortfall at the level p ∈ (0, 1) coincides with the TailValue at Risk TVpX .

    Proposition 4.9. The Expected Shortfall ESpX coincides with the Tail Valueat Risk TVpX for any p ∈ (0, 1), i.e. we have

    ESpX = TVpX =

    11− p

    w 1pV qXdq.

    Proof. Constructing X as X = V UX where U is uniformly distributed on [0, 1]as in Lemma 3.13, by Proposition 3.8 we have

    " 83

    This version: June 13, 2021https://personal.ntu.edu.sg/nprivault/indext.html

    https://personal.ntu.edu.sg/nprivault/indext.html

  • N. Privault

    U > p =⇒ V UX > VpX =⇒ X > V

    pX

    and (U < p and X > V pX

    )=⇒

    (V UX 6 V

    pX and X > V

    pX

    )=⇒

    (X 6 V pX and X > V

    pX

    )=⇒ X = V pX .

    Hence by (4.4) and the relations

    1− p = E[1{U>p}

    ]and P

    (X > V pX

    )= E

    [1{X>V p

    X}],

    we have

    V pX(1− p−P

    (X > V pX

    ))= −V pXE

    [1{X>V p

    X} − 1{U>p}

    ]= −V pXE

    [1{X>V p

    X}\{U>p}

    ]= −V pXE

    [1{X>V p

    X}∩{UV p

    X}∩{UV p

    X}]+

    V pX1− p

    (1− p−P

    (X > V pX

    ))=

    11− pE

    [X1{X>V p

    X}]− 11− pE

    [X1{X>V p

    X}∩{UV p

    X}]− 11− pE

    [V UX 1{V U

    X>V p

    X}∩{UV p

    X}∩{U>p}

    ]=

    11− pE

    [V UX 1{U>p}

    ]=

    11− p

    w 1pV qXdq,

    which is the Tail Value at Risk TVpX . �

    As a consequence of Propositions 4.4-4.5 and Proposition 4.9, the GaussianExpected Shortfall at the level p is also given by

    ESpX = µ+σ

    (1− p)φ(VpZ ).

    84 "

    This version: June 13, 2021https://personal.ntu.edu.sg/nprivault/indext.html

    https://personal.ntu.edu.sg/nprivault/indext.html

  • Notes on Financial Risk and Analytics

    Proposition 4.10. The Expected Shortfall ESpX and the Tail Value at RiskTVpX are coherent risk measures.

    Proof. As ESpX coincides with TVpX for all p ∈ (0, 1) from Proposition 4.9,

    we can use either Relation (4.4) in Definition 4.6 or Relation (4.1) in Defini-tion 4.1.

    (i) Monotonicity. If X 6 Y , since Value at Risk is monotone we have

    ESpX = TVpX

    =1

    1− pw 1pV qXdq

    61

    1− pw 1pV qY dq

    = TVpY6 ESpY

    for all p ∈ (0, 1).

    (ii) Homogeneity and translation invariance. Similarly, since Value at Risk issatisfies the homogeneity and translation invariance properties, for all µ ∈ Rand λ > 0 we have monotone we have

    ESpµ+λX = TVpµ+λX

    =1

    1− pw 1pV qµ+λXdq

    =1

    1− pw 1p

    (µ+ λV qX

    )dq

    = µ+ λ1

    1− pw 1pV qXdq

    = µ+ λTVpY6 µ+ λESpY

    for all p ∈ (0, 1).

    (iii) Sub-additivity. We have

    (1− p)(ESpX+Y −ES

    pX −ES

    pY

    )= E[(X + Y )fX+Y (X + Y )]−E[XfX (X)]−E[Y fY (Y )]= E[X(fX+Y (X + Y )− fX (X))]−E[Y (fX+Y (X + Y )− fY (Y ))]> V pXE[fX+Y (X + Y )− fX (X)]− V

    pY E[fX+Y (X + Y )− fY (Y )]

    = V pX (1− p− (1− p))− VpY (1− p− (1− p))

    = 0,

    where we have used (4.6) and the facts that, for x < V pX ,

    " 85

    This version: June 13, 2021https://personal.ntu.edu.sg/nprivault/indext.html

    https://personal.ntu.edu.sg/nprivault/indext.html

  • N. Privault

    (1− p)(fX+Y (x+ y)− fX (x)) = 1{x+y>V pX+Y }

    − 1{x>V pX}

    +1{P(X+Y =V pX+Y )>0}

    1− p−P(X + Y > V pX+Y )P(X + Y = V pX+Y )

    1{x+y=V pX+Y }

    −1{P(X=V pX)>0}

    1− p−P(X > V pX

    )P(X = V pX

    ) 1{x=V pX}

    = 1{x+y>V pX+Y }

    + 1{P(X+Y =V pX+Y )>0}

    1− p−P(X + Y > V pX+Y )P(X + Y = V pX+Y )

    1{x+y=V pX+Y }

    > 0, x < V pX ,

    and, for x > V pX ,

    (1− p)(fX+Y (x+ y)− fX (x)) = 1{x+y>V pX+Y }

    − 1{x>V pX}

    +1{P(X+Y =V pX+Y )>0}

    1− p−P(X + Y > V pX+Y )P(X + Y = V pX+Y )

    1{x+y=V pX+Y }

    −1{P(X=V pX)>0}

    1− p−P(X > V pX

    )P(X = V pX

    ) 1{x=V pX}

    = 1{x+y>V pX+Y }

    − 1{x>V pX}

    +1{P(X+Y =V pX+Y )>0}

    1− p−P(X + Y > V pX+Y )P(X + Y = V pX+Y )

    1{x+y=V pX+Y }

    6 1{x+y>V pX+Y }

    − 1{x>V pX}

    +1{x+y=V pX+Y }

    = 1{x+y>V pX+Y }

    − 1{x>V pX}

    > 0, x < V pX .

    Note that in general, the Conditional Tail Expectation is not a coherent riskmeasure when P

    (X = V pX

    )> 0.

    Performance analytics in R - Expected Shortfall (ES)

    1 library(PerformanceAnalytics)2 ES(returns, p=.95, method="historical")

    The 95% Expected Shortfall is ES95%X = −0.02087832. The historical Ex-pected Shortfall can be exactly recovered by the empirical Condtional TailExpectation (CTE) as

    86 "

    This version: June 13, 2021https://personal.ntu.edu.sg/nprivault/indext.html

    https://personal.ntu.edu.sg/nprivault/indext.html

  • Notes on Financial Risk and Analytics

    1 mean(returns[returns source("comparison.R")Number of samples= 265VaR 95 = -0.03420879 , Threshold= 0.9433962CTE 95 = -0.04646176ES 95 = -0.04623058Historical VaR 95 0= -0.03316604Gaussian VaR 95 = -0.03209374Historical ES 95 = -0.04552403Gaussian ES 95 = -0.04043227

    Fig. 4.3: Value at Risk and Expected Shortfall.

    " 87

    This version: June 13, 2021https://personal.ntu.edu.sg/nprivault/indext.html

    library(quantmod)

    getSymbols("0700.HK",from="2015-01-03",to="2016-02-01",src="yahoo")stock=Ad(`0700.HK`)stock.rtn=as.numeric((stock-lag(stock))/stock);stock.rtn

  • N. Privault

    Value at Risk vs Expected Shortfall

    1 chart.VaRSensitivity(ts(returns),methods=c("HistoricalVaR","HistoricalES"),colorset=bluefocus, lwd=2)

    0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99

    Confidence Level

    −0.12

    −0.10

    −0.08

    −0.06

    −0.04

    Historical VaRHistorical ES

    Value at

    Risk

    Risk Confidence Sensitivity of 1800.HK.Adjusted

    Fig. 4.4: Value at Risk vs Expected Shortfall.

    4.4 Market Data vs Gaussian Risk Measures

    Market returns vs Gaussian and power tails

    Consider for example the market returns data obtained from fetching DJI andSTI index data using the R package Quantmod and the following scripts.1 library(quantmod)

    getSymbols("^STI",from="1990-01-03",to="2015-01-03",src="yahoo");stock=Ad(`STI`);3 getSymbols("^DJI",from="1990-01-03",to=Sys.Date(),src="yahoo");stock=Ad(`DJI`);

    stock.rtn=diff(log(stock));returns 3*s])/length(stock.rtn)13 length(y[abs(y-m)>3*s])/length(y);2*(1-pnorm(3*s,0,s))

    Figure 4.5 shows the mismatch between the distributional properties of mar-ket log-returns vs standardized Gaussian returns, which tend to underesti-mate the probabilities of extreme events. Note that when X ' N (0,σ2),

    88 "

    This version: June 13, 2021https://personal.ntu.edu.sg/nprivault/indext.html

    https://personal.ntu.edu.sg/nprivault/indext.html

  • Notes on Financial Risk and Analytics

    99.73% of samples of X are falling within the interval [−3σ,+3σ], i.e.P(|X| 6 3σ) = 0.9973002.

    1995 2000 2005 2010 2015

    −0.05

    0.00

    0.05

    Fig. 4.5: Market returns vs normalized Gaussian returns.

    1 stock.ecdf=ecdf(as.vector(stock.rtn));x

  • N. Privault

    1 dev.new(width=16,height=8)qqnorm(returns, col = "blue", xaxs="i", yaxs="i", las=1, cex.lab=1.4, cex.axis=1, lwd=3)

    3 grid(lwd = 2)

    −3 −2 −1 0 1 2 3

    −0.10

    −0.05

    0.00

    0.05

    0.10

    Normal Q−Q Plot

    Theoretical Quantiles

    Sam

    ple

    Qua

    ntile

    s

    Fig. 4.7: Quantile-Quantile plot.

    1 ks.test(y,"pnorm",mean=m,sd=s)ks.test(returns,"pnorm",mean=m,sd=s)

    The Kolmogorov-Smirnov test clearly rejects the null (normality) hypothesis.

    One-sample Kolmogorov-Smirnov test

    data: returnsD = 0.075577, p-value < 2.2e-16alternative hypothesis: two-sided

    This mismatch can be further illustrated by the empirical probability densityplot in Figure 4.8, which is obtained from the following R code.

    1 dev.new(width=16,height=8)2 x

  • Notes on Financial Risk and Analytics

    −0.10 −0.05 0.00 0.05 0.100

    10

    20

    30

    40

    50

    60

    x

    Empirical densityGaussian density

    Fig. 4.8: Empirical density vs normalized Gaussian density.

    Power tail distributions

    We note that the empirical density has significantly higher kurtosis and nonzero skewness in comparison with the Gaussian probability density. On theother hand, power tail probability densities of the form ϕ(x) ' Cα/xα,x → ∞, can provide a better fit of empirical probability density functions,as shown in Figure 4.9.

    −0.10 −0.05 0.00 0.05 0.100

    10

    20

    30

    40

    50

    60Empirical densityPower density

    Fig. 4.9: Empirical density vs power density.

    The above fitting of empirical probability density function is using a powerprobability density function defined by a rational fraction obtained by thefollowing R script.

    " 91

    This version: June 13, 2021https://personal.ntu.edu.sg/nprivault/indext.html

    https://personal.ntu.edu.sg/nprivault/indext.html

  • N. Privault

    1 install.packages("pracma")2 library(pracma); x

  • Notes on Financial Risk and Analytics

    Hn(x) :=(−1)nϕ(x)

    ∂nϕ

    ∂xn(x), x ∈ R,

    denote the Hermite polynomial of degree n, with H0(x) = 1.

    Given X a random variable, the sequence (κXn )n>1 of cumulants of Xhas been introduced in Thiele (1899). In the sequel we will use the MomentGenerating Function (MGF) of the random variable X, defined as

    MX (t) := E[etX]= 1 +

    ∑n>1

    tn

    n!E[Xn], t ∈ R. (4.7)

    Definition 4.11. The cumulants of a random variable X are defined to bethe coefficients (κXn )n>1 appearing in the series expansion

    log(E[etX])

    = log

    1 +∑n>1

    tn

    n!E[Xn]

    =∑n>1

    κXntn

    n!, t ∈ R, (4.8)

    of the logarithmic moment generating function (log-MGF) of X.

    The cumulants of X were originally called “semi-invariants” due to the prop-erty κX+Yn = κXn + κYn , n > 1, when X and Y are independent randomvariables. Indeed, in this case we have∑

    n>1κX+Yn

    tn

    n!= log

    (E[et(X+Y )

    ])= log

    (E[etX]E[etY])

    = log E[etX]+ log E

    [etY]

    =∑n>1

    κXntn

    n!+∑n>1

    κYntn

    n!

    =∑n>1

    (κXn + κ

    Yn

    ) tnn!

    , t ∈ R,

    showing that κX+Yn = κXn + κYn , n > 1.

    a) First moment and cumulant. Taking n = 1 and π = {1}, we find κX1 =E[X ].

    b) Variance and second cumulant. We have

    κX2 = E[X2]− (E[X ])2 = E

    [(X −E[X ])2

    ],

    and√κX2 is the standard deviation of X.

    c) The third cumulant of X is given as the third central moment

    " 93

    This version: June 13, 2021https://personal.ntu.edu.sg/nprivault/indext.html

    https://personal.ntu.edu.sg/nprivault/indext.html

  • N. Privault

    κX3 = E[(X −E[X ])3],

    and the coefficient

    SkX :=κX3

    (κX2 )3/2 =

    E[(X −E[X ])3

    ](E[(X −E[X ])2])3/2

    is the skewness of X.d) Similarly, we have

    κX4 = E[(X −E[X ])4]− 3(κX2 )2

    = E[(X −E[X ])4]− 3(E[(X −E[X ])2

    ])2,and the excess kurtosis of X is defined as

    EKX :=κX4

    (κX2 )2 =

    E[(X −E[X ])4](E[(X −E[X ])2])2

    − 3.

    The next proposition summarizes the Gram-Charlier expansion method toobtain series expansion of a probability density function, see Gram (1883),Charlier (1914) and § 17.6 of Cramér (1946).

    Proposition 4.12. (Proposition 2.1 in Tanaka et al. (2010)) The Gram-Charlier expansion of the continuous probability density function φX (x) of arandom variable X is given by

    φX (x) =1√κX2

    ϕ

    x− κX1√κX2

    + 1√κX2

    ∞∑n=3

    cnHn

    x− κX1√κX2

    ϕx− κX1√

    κX2

    ,where c0 = 1, c1 = c2 = 0, and the sequence (cn)n>3 is given from thecumulants (κXn )n>1 of X as

    cn =1

    (κX2 )n/2

    [n/3]∑m=1

    ∑l1+···+lm=nl1,...,lm>3

    κXl1 · · ·κXlm

    m!l1! · · · lm!, n > 3.

    The coefficients c3 and c4 can be expressed from the skweness κX3 /(κX2 )3/2and the excess kurtosis κX4 /(κX2 )2 as

    c3 =κX3

    3!(κX2 )3/2and c4 =

    κX44!(κX2 )2

    .

    a) The first-order expansion

    94 "

    This version: June 13, 2021https://personal.ntu.edu.sg/nprivault/indext.html

    https://personal.ntu.edu.sg/nprivault/indext.html

  • Notes on Financial Risk and Analytics

    φ(1)X (x) =

    1√κX2

    ϕ

    x− κX1√κX2

    corresponds to normal moment matching approximation.

    b) The third-order expansion is given by

    φ(3)X (x) =

    1√κX2

    1 + c3H3x− κX1√

    κX2

    ϕx− κX1√

    κX2

    .c) The fourth-order expansion is given by

    φ(4)X (x) =

    1√κX2

    1 + c3H3x− κX1√

    κX2

    + c4H4x− κX1√

    κX2

    ϕx− κX1√

    κX2

    .1 install.packages("SimMultiCorrData");install.packages("PDQutils")2 library(quantmod);library(SimMultiCorrData);library(PDQutils)

    dev.new(width=16,height=8)4 plot(stock.dens$x,stock.dens$y, xlab = 'x', type = 'l', lwd=4, col="red",ylab = '', main = '',

    xlim =c(-0.1,0.1), ylim=c(0,65), xaxs="i", yaxs="i", las=1, cex.lab=1.8, cex.axis=1.8)lines(x, qx, type="l", lty=2, lwd=4, col="blue")

    6 m

  • N. Privault

    Historical and Gaussian risk measures

    1 dev.new(width=16,height=8)chart.VaRSensitivity(stock.rtn[,1,drop=FALSE],methods=c("HistoricalVaR","GaussianVaR"),

    colorset=bluefocus, lwd=4)

    The next Figure 4.11 uses the above R code to compare the historical andGaussian values at risk.

    0.89 0.9 0.905 0.915 0.925 0.935 0.945 0.955 0.965 0.975 0.985

    Confidence Level

    −0.

    030

    −0.

    025

    −0.

    020

    −0.

    015

    −0.

    010

    Historical VaRGaussian VaR

    Val

    ue a

    t Ris

    k

    Risk Confidence Sensitivity of DJI.Adjusted

    Fig. 4.11: Historical vs Gaussian estimates of Value at Risk.

    1 dev.new(width=16,height=8)2 chart.VaRSensitivity(stock.rtn[,1,drop=FALSE],methods=c("HistoricalES","GaussianES"),

    colorset=bluefocus, lwd=4)

    In the next Figure 4.12 we compare the Gaussian and historical estimates ofExpected Shortfall.

    0.89 0.9 0.905 0.915 0.925 0.935 0.945 0.955 0.965 0.975 0.985

    Confidence Level

    −0.

    045

    −0.

    040

    −0.

    035

    −0.

    030

    −0.

    025

    −0.

    020

    Historical ESGaussian ES

    Val

    ue a

    t Ris

    k

    Risk Confidence Sensitivity of DJI.Adjusted

    Fig. 4.12: Quantile function.

    96 "

    This version: June 13, 2021https://personal.ntu.edu.sg/nprivault/indext.html

    https://personal.ntu.edu.sg/nprivault/indext.html

  • Notes on Financial Risk and Analytics

    In Table 4.1 we summarize some properties of risk measures.

    Risk Measure Additivity Homogeneity Subadditivity Coherence

    V pX X X 7 7

    CTEpX X X 7 7

    TVpX X X X X

    ESpX X X X X

    Table 4.1: Summary of Risk Measures.

    Note that Value at Risk V pX is coherent on Gaussian random variables ac-cording to Remark 3.12. Similarly, the Conditional Tail Expectation CTEpXis coherent on random variables having a continuous CDF by Propositions 4.4and 4.10.

    Exercises

    Exercise 4.1 LetX denote an exponentially distributed random variable withparameter λ > 0, i.e. the distribution of X has the cumulative distributionfunction (CDF)

    FX (x) = P(X 6 x) = 1− e−λx, x > 0,

    and the probability density function (PDF)

    fX (x) = F′X (x) = λe−λx, x > 0.

    " 97

    This version: June 13, 2021https://personal.ntu.edu.sg/nprivault/indext.html

    https://personal.ntu.edu.sg/nprivault/indext.html

  • N. Privault

    0 1 2 4 5 6

    qX0

    .95

    0.0

    0.1

    0.2

    0.3

    0.4

    0.5

    0.6

    0.7

    0.8

    0.9

    1.0

    p=0.95

    (a) Exponential quantile and PDF.

    q0.95

    X

    0 1 2 3 4 5 60

    0.10.20.30.40.50.60.70.80.91

    Probabilitydensity

    (b) Exponential PDF.

    a) Compute the conditional tail expectation

    E[X | X > VaRpX ] =1

    P(X > VaRpX )

    w∞VaRp

    X

    xfX (x)dx.

    b) Compute the tail value at risk

    TVpX =1

    1− pw 1pV qXdq.

    Exercise 4.2 Consider X an (integrable) random variable and z ∈ R suchthat P(X > z) > 0.a) Show that E[X | X > z] > z.b) Show that E[X | X > z] > E[X ].c) Show that E[X | X > z] > E[X ] if P(X 6 z) > 0.d) Show that CTEpX > E[X ].

    Exercise 4.3 Consider the following data set.

    Find the Value at Risk VaRpX and the Conditional Tail Expectation CTEpX =

    E[X | X > VaRpX

    ]and mark their values on the graph in the following cases.

    a) p = 0.9.

    98 "

    This version: June 13, 2021https://personal.ntu.edu.sg/nprivault/indext.html

    https://personal.ntu.edu.sg/nprivault/indext.html

  • Notes on Financial Risk and Analytics

    b) p = 0.8.

    Exercise 4.4

    Let p = 0.9. For the above data set represented by the random variable X,compute the numerical values of the following quantities.

    a) VaR90X ,b) E

    [X1{X>V 90

    X}],

    c) P(X > V 90X

    ),

    d) CTE90X = E[X | X > V 90X

    ]= E

    [X1{X>V 90

    X}]/P(X > V 90X

    ),

    e) E[X1{X>V 90

    X}],

    f) P(X > V 90X

    ),

    g) ES90X =1

    1− p(E[X1{X>V 90

    X}]+ V 90X

    (1− p−P

    (X > V 90X

    ))),

    h) TV90X =1

    1− pw 1pV qXdq,

    and mark the values of VaR90%X , CTE90%X , ES

    90%X , TV

    90%X on the above

    graph.

    Exercise 4.5 Consider a random variable X ∈ {10, 100, 150} with the distri-bution

    P(X = 10) = 96%, P(X = 100) = 3%, P(X = 150) = 1%.

    Compute

    a) the Value at Risk V 98%X ,b) the Tail Value at Risk TV98%X ,c) the Conditional Tail Expectation E

    [X | X > V 98%X

    ], and

    d) the Expected Shortfall E98%X .

    " 99

    This version: June 13, 2021https://personal.ntu.edu.sg/nprivault/indext.html

    https://personal.ntu.edu.sg/nprivault/indext.html

  • N. Privault

    Exercise 4.6 Consider two independent random variables X and Y withsame distribution given by

    P(X = 0) = P(Y = 0) = 90% and P(X = 100) = P(Y = 100) = 10%.

    a) Plot the cumulative distribution function of X on the following graph:

    0.88

    0.90

    0.92

    0.94

    0.96

    0.98

    1.00

    1.02

    0 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 190 200 210−10−20 x

    FX(x)

    0

    Fig. 4.14: Cumulative distribution function of X.

    b) Plot the cumulative distribution function ofX+Y on the following graph:

    0.800.820.840.860.880.900.920.940.960.981.00

    0 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 190 200 210−10−20 x

    FX+Y (x)

    0

    Fig. 4.15: Cumulative distribution function of X + Y .

    c) Give the values at risk V 99%X+Y , V95%X+Y , V

    90%X+Y .

    d) Compute the Tail Value at Risk

    TV90%X :=1

    1− pw 1pV qXdq

    at the level p = 90%.e) Compute the Tail Value at Risk

    TVpX+Y :=1

    1− pw 1pV qX+Y dq

    at the levels p = 90% and p = 80%.

    Exercise 4.7 (Exercise 3.2 continued).

    a) Compute the Tail Value at Risk

    TVpX :=1

    1− pw 1pV qXdq

    100 "

    This version: June 13, 2021https://personal.ntu.edu.sg/nprivault/indext.html

    https://personal.ntu.edu.sg/nprivault/indext.html

  • Notes on Financial Risk and Analytics

    for all p in the interval [0.99, 1], and give the value of TV99%X .b) Taking p = 0.98, compute the Conditional Tail Expectation

    CTE98%X = E[X | X > V 98%X

    ]=

    1P(X > V pX

    )E [X1{X>V pX}

    ].

    " 101

    This version: June 13, 2021https://personal.ntu.edu.sg/nprivault/indext.html

    https://personal.ntu.edu.sg/nprivault/indext.html

    pbs@ARFix@91: pbs@ARFix@92: pbs@ARFix@93: pbs@ARFix@94: pbs@ARFix@95: pbs@ARFix@96: pbs@ARFix@97: pbs@ARFix@98: pbs@ARFix@99: pbs@ARFix@100: pbs@ARFix@101: pbs@ARFix@102: pbs@ARFix@103: pbs@ARFix@104: pbs@ARFix@105: pbs@ARFix@106: pbs@ARFix@107: pbs@ARFix@108: pbs@ARFix@109: pbs@ARFix@110: pbs@ARFix@111: pbs@ARFix@112: pbs@ARFix@113: pbs@ARFix@114: pbs@ARFix@115: