0% found this document useful (0 votes)
73 views365 pages

Financial Risk Analytics

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)
73 views365 pages

Financial Risk Analytics

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
You are on page 1/ 365

Nicolas Privault

Notes on
Financial Risk and Analytics

0.10

0.05

0.00

−0.05

−0.10

2020 2021

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

Preface

The topics covered in these notes include an introduction to stochastic


modeling with discrete-valued stochastic processes, a basic coverage of Value
at Risk and Expected Shortfall, as well as structures of random dependence.
Various types of risk, see e.g. Gourieroux and Jasiak (2001), can be classified
into market risk, liquidity risk, credit risk, counterparty risk, model risk,
estimation risk. For insurance businesses, a more detailed classification can
be set as follows.
a) Financial risk
Investment risk
Credit risk,
Market risk (e.g. depreciation),
Counterparty risk.
Liability risk
Catastrophe risk,
Non-catastrophe risk (e.g. claim volatility).
b) Operational risk
Business risk (e.g. lower production),
Event risk (e.g. system failure),
Policy risk ...
Part I introduces tools of stochastic modeling, with applications in op-
tion pricing, porftolio allocation, and insurance, starting with the use of ran-
dom walks and geometric Brownian motion for financial modeling in Chap-
ter 1. This is followed by the discrete and continuous-time modeling of time-
dependent events using time series and processes with jumps. In particular,
the risk theory considered in Chapter 3 is relevant to liability, catastrophe
and operational risks such as business or event risk. Chapters 2 and 3 re-
spectively. Correlation and dependence are treated via the used of copulas in
Chapter 4.
Financial, investment, market and non-catastrophe risks are dealt with
in Part II which focuses on risk measures. This includes the superhedging
" v

This version: June 9, 2023


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

risk measure in Chapter 5, and Value at Risk and Expected Shortfall in


Chapter 6 and 7. Chapter 8 is devoted to credit scoring, using discriminant
analysis and logistic regression. Risk theory and credit scoring are presented
with illustrative examples in R.
Credit risk is considered Part III, including the structural and reduced-
form approaches to credit risk and valuation in Chapters 9 and 10. Credit
default is treated via defaultable bonds, Credit Default Swaps (CDS) and
collateralized debt obligations (CDOs) in Chapter 11 on credit derivatives.
Parts of this material have been used for teaching in the Masters of Sci-
ence in Financial Engineering (MFE), in Analytics (MSA), and in Business
Analytics (MSBA) at the Nanyang Technological University in Singapore.
The pdf file contains external links and 154 figures, including 9 animated
figures and an embedded video in Figure 1.8, that may require using Acrobat
Reader for viewing on the complete pdf file. It also contains 5 Python codes
and 51 codes.
This text also includes 62 exercises with solutions. Clicking on an exercise
number inside the solution section will send to the original problem text in-
side the file. Conversely, clicking on the problem number sends the reader to
the corresponding solution, however this feature should not be misused.

Nicolas Privault
June 2023

vi "

This version: June 9, 2023


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

Part I Stochastic Modeling

1 Modeling Market Returns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3


1.1 Random Walks and Brownian Motion . . . . . . . . . . . . . . . . . . . . . 3
1.2 Geometric Brownian Motion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.3 Distribution of Market Returns . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
1.4 Gram-Charlier Expansions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

2 Time Series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
2.1 Autoregressive Moving Average . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
2.2 Autoregressive Heteroskedasticity . . . . . . . . . . . . . . . . . . . . . . . . . 38
2.3 Time Series Stationarity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
2.4 Fitting Time Series to Financial Data . . . . . . . . . . . . . . . . . . . . . 48
2.5 Application: Pair Trading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61

3 Processes with Jumps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65


3.1 The Poisson Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
3.2 Compound Poisson Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
3.3 Claim and Reserve Processes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
3.4 Ruin Probabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87

4 Correlation and Dependence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91


4.1 Joint Bernoulli Distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
4.2 Joint Gaussian Distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
4.3 Copulas and Dependence Structures . . . . . . . . . . . . . . . . . . . . . . 94
4.4 Examples of Copulas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105

vii
N. Privault

Part II Risk Measures

5 Superhedging Risk Measure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111


5.1 Historical Sketch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
5.2 Financial Derivatives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
5.3 Black-Scholes Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132

6 Value at Risk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137


6.1 Risk Measures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
6.2 Quantile Risk Measures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
6.3 Value at Risk (VaR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
6.4 Numerical estimates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155

7 Expected Shortfall . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159


7.1 Tail Value at Risk (TVaR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
7.2 Conditional Tail Expectation (CTE) . . . . . . . . . . . . . . . . . . . . . . 160
7.3 Expected Shortfall (ES) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
7.4 Numerical Estimates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173

8 Credit Scoring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179


8.1 Discriminant Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
8.2 Decision Rule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
8.3 Logistic Regression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
8.4 ROC Curve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194

Part III Credit Risk

9 Credit Risk - Structural Approach . . . . . . . . . . . . . . . . . . . . . . . . 199


9.1 Merton Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
9.2 Default Bonds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
9.3 Black-Cox Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
9.4 Correlated Default Times . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211

10 Credit Risk - Reduced-Form Approach . . . . . . . . . . . . . . . . . . . 213


10.1 Survival Probabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
10.2 Stochastic Default . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
10.3 Defaultable Bonds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222

viii "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

11 Credit Derivatives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227


11.1 Credit Default Swaps (CDS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
11.2 Collateralized Debt Obligations (CDO) . . . . . . . . . . . . . . . . . . . . 231
11.3 Credit Valuation Adjustment (CVA) . . . . . . . . . . . . . . . . . . . . . . 237
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241

Part IV Appendix

Background on Probability Theory . . . . . . . . . . . . . . . . . . . . . . . . . . . 245


12.1 Probability Sample Space and Events . . . . . . . . . . . . . . . . . . . . . 245
12.2 Probability Measures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249
12.3 Conditional Probabilities and Independence . . . . . . . . . . . . . . . . 250
12.4 Random Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
12.5 Probability Distributions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254
12.6 Expectation of Random Variables . . . . . . . . . . . . . . . . . . . . . . . . 262
12.7 Conditional Expectation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280

Exercise Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283


Chapter 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
Chapter 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
Chapter 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
Chapter 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
Chapter 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
Chapter 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306
Chapter 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310
Chapter 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318
Chapter 9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322
Chapter 10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
Chapter 11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329
Background on Probability Theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337

Author index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343

References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345

" ix

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
List of Figures

1.1 Graph of 120 = (10 7 ) paths with n = 5 and k = 2



................ 4
1.2 Two sample paths of one-dimensional Brownian motion . . . . . . . . . . . . 5
1.3 Sample paths of a one-dimensional Brownian motion . . . . . . . . . . . . . . . 6
1.4 Brownian motion as a random walk∗ . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.5 Statistics of one-dimensional Brownian paths vs Gaussian distribution . 8
1.6 Returns vs cumulative returns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.7 Statistics of S&P 500 yearly returns from 1950 to 2022 . . . . . . . . . . . . . 11
1.8 “As if a whole new world was laid out before me.”∗ . . . . . . . . . . . . . . . . 11
1.9 Geometric Brownian motion started at S0 = 1∗ . . . . . . . . . . . . . . . . . . 13
1.10 Ten sample paths of geometric Brownian motion . . . . . . . . . . . . . . . . . . 14
1.11 Underlying market prices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1.12 Simulated geometric Brownian motion . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1.13 Graph of the Gaussian Cumulative Distribution Function (CDF) . . . . . 16
1.14 Statistics of geometric Brownian paths vs lognormal distribution . . . . . 18
1.15 Market returns vs normalized Gaussian returns . . . . . . . . . . . . . . . . . . . 19
1.16 Empirical vs Gaussian CDF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
1.17 Quantile-Quantile plot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
1.18 Empirical density vs normalized Gaussian density . . . . . . . . . . . . . . . . . 22
1.19 Empirical density vs normalized lognormal density . . . . . . . . . . . . . . . . 22
1.20 Empirical density vs power density . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
1.21 Gram-Charlier expansions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
1.22 Sample path of a geometric Brownian motion . . . . . . . . . . . . . . . . . . . . 27

2.1 MA(2) Samples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31


2.2 AR(2) Samples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
2.3 ARMA(2) Samples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
2.4 ARIMA(1, 2, 3) Samples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
2.5 ARCH(2) Samples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
2.6 GARCH(2, 1) Samples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
2.7 Autocovariances of AR(2) Samples . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
2.8 Nonstationarity of AR(2) time series with a1 = 1 and a2 = −1 . . . . . . . 46

xi
N. Privault

2.9 Hypothesis testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47


2.10 Stock returns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
2.11 ARIMA(0, 0, 3) samples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
2.12 ARIMA(2, 0, 2) samples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
2.13 GARCH samples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
2.14 Cumulative stock returns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
2.15 ARIMA(2, 1, 2) Samples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
2.16 MSFT vs APPL graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
2.17 Comparison graph before linear regression . . . . . . . . . . . . . . . . . . . . . . . 55
2.18 Comparison graph after linear regression . . . . . . . . . . . . . . . . . . . . . . . . 56
2.19 Spread graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
2.20 Pair trading signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
2.21 Pair trading returns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
2.22 Pair trading performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
2.23 Pair trading performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61

3.1 Sample path of a counting process (Nt )t∈R+ . . . . . . . . . . . . . . . . . . . . . 66


3.2 Sample path of the Poisson process (Nt )t∈R+ . . . . . . . . . . . . . . . . . . . . 69
3.3 Sample path of the Poisson process (Nt )t∈R+ . . . . . . . . . . . . . . . . . . . . 72
3.4 Sample path of the compensated Poisson process (Nt − λt)t∈R+ . . . . . . 73
3.5 Probability density function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
3.6 Sample path of a compound Poisson process (Yt )t∈R+ . . . . . . . . . . . . . 75
3.7 Sample path of a compensated compound Poisson process . . . . . . . . . . . 79
3.8 Sample path (without ruin) of a reserve process (Rx (t))t∈R+ . . . . . . . . 80
3.9 Sample path (with ruin) of a reserve process (Rx (t))t∈R+ . . . . . . . . . . . 81
3.10 Sample paths of reserve process∗ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84

4.1 Joint Gaussian probability density . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93


4.2 Different Gaussian copula graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
4.3 Different Gaussian copula density graphs . . . . . . . . . . . . . . . . . . . . . . . . 100
4.4 Samples with uniform marginals and given copulas . . . . . . . . . . . . . . . . 102
4.5 Samples with Gaussian marginals and given copulas . . . . . . . . . . . . . . . 102
4.6 Joint densities with Gaussian marginals and given copulas . . . . . . . . . . 103
4.7 Joint density contour plots with Gaussian marginals and given copulas . 104
4.8 Samples with exponential marginals and given copulas . . . . . . . . . . . . . 105
4.9 Truncated two-dimensional Gaussian density . . . . . . . . . . . . . . . . . . . . . 107

5.1 Comparison of WTI vs Keppel price graphs . . . . . . . . . . . . . . . . . . . . . . 112


5.2 Hang Seng index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
5.3 Two put option scenarios . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
5.4 Payoff function of a put option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
5.5 Two call option scenarios . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
5.6 Payoff function of a call option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
5.7 Brent and WTI price graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
5.8 Price map of a four-way collar option . . . . . . . . . . . . . . . . . . . . . . . . . . 118

xii "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

5.9 Payoff function of a four-way call collar option . . . . . . . . . . . . . . . . . . . 119


5.10 Four-way call collar payoff as a combination of call and put options∗ . . 119
5.11 Implied probabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
5.12 Implied probabilities according to bookmakers . . . . . . . . . . . . . . . . . . . 124
5.13 Implied probabilities according to polling . . . . . . . . . . . . . . . . . . . . . . . 125
5.14 One hundred sample price paths used for the Monte Carlo method . . . . 126
5.15 Graph of the Gaussian Cumulative Distribution Function (CDF) . . . . . 128
5.16 Black-Scholes call price map∗ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
5.17 Time-dependent solution of the Black-Scholes PDE (call option)∗ . . . . . 129
5.18 Delta of a European call option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
5.19 Black-Scholes put price function∗ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
5.20 Time-dependent solution of the Black-Scholes PDE (put option)∗ . . . . . 131
5.21 Delta of a European put option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
5.22 Graphs of call/put payoff functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . 135

6.1 Estimating liabilities by a conditional mean over 346 returns . . . . . . . . 140


6.2 Cumulative distribution functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
6.3 Cumulative distribution function with discontinuities∗ . . . . . . . . . . . . . 143
6.4 Example of quantiles given as percentiles . . . . . . . . . . . . . . . . . . . . . . . 144
6.5 Gaussian quantile qZ p
= 1.644854 at p = 0.95 . . . . . . . . . . . . . . . . . . . . . 145
6.6 Exponential quantile qX p
= 2.995732 at p = 0.95 . . . . . . . . . . . . . . . . . . 145
6.7 Empirical cumulative distribution functions . . . . . . . . . . . . . . . . . . . . . . 146
6.8 Cumulative distribution function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
6.9 Symmetric and nonsymmetric VaR . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
6.10 Cumulative distribution function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
6.11 Cumulative distribution function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
6.12 Market returns vs Value at Risk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
6.13 Cumulative distribution function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155

7.1 Two distributions having the same Value at Risk VX 95%


= 2.145 . . . . . . 160
7.2 Value at Risk and Conditional Tail Expectation . . . . . . . . . . . . . . . . . . 163
7.3 Value at Risk and Expected Shortfall . . . . . . . . . . . . . . . . . . . . . . . . . . 171
7.4 Value at Risk vs Expected Shortfall . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
7.5 Historical vs Gaussian estimates of Value at Risk . . . . . . . . . . . . . . . . . 172
7.6 Quantile function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
7.8 Cumulative distribution function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
7.9 Cumulative distribution function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176

8.1 Probability default curve x 7→ P(B | X = x) . . . . . . . . . . . . . . . . . . . . . 181


8.2 Probability acceptance curve x 7→ P(G | X = x) . . . . . . . . . . . . . . . . . . 182
8.3 Animated graph of optimal decision rule∗ . . . . . . . . . . . . . . . . . . . . . . 185
8.4 Logistic CDF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
8.5 Logistic regression output on 5 criteria . . . . . . . . . . . . . . . . . . . . . . . . . 188
8.6 Logistic regression output on 61 criteria . . . . . . . . . . . . . . . . . . . . . . . . 189
8.7 Gaussian ROC curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191

" xiii

This version: June 9, 2023


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

8.8 ROC curves based on 5 criteria and 61 criteria . . . . . . . . . . . . . . . . . . . 193



9.1 Graph of the function x 7−→ Φ Φ−1 (x) + (µ − r ) T − t/σ . . . . . . . . . 202


11.1 CDS price evolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229


11.2 A representation of CDO tranches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
11.3 A Titanic-style representation of cumulative tranche losses . . . . . . . . . . 233
11.4 Function fk (x) = min((x − N αk−1 )+ , N pk ) . . . . . . . . . . . . . . . . . . . . . 236
11.5 Internal Ratings-Based (IRB) formula . . . . . . . . . . . . . . . . . . . . . . . . . . 237
12.6 Probability density function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
12.7 Exponential CDF and PDF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
12.8 Probability computed as a volume integral . . . . . . . . . . . . . . . . . . . . . . 259

S.1 Exponential copula function u, v 7→ C (u, b) . . . . . . . . . . . . . . . . . . . . . . 296


S.2 Survival copula graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300
S.3 Survival copula density graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
S.4 Pareto cumulative and probability density functions . . . . . . . . . . . . . . . 306
S.5 Cumulative distribution function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
S.6 Value at Risk and Expected Shortfall for small data . . . . . . . . . . . . . . . 313
S.7 Cumulative distribution function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314
S.8 Cumulative distribution function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
S.9 Cumulative distribution function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
S.10 Cashflow data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329
S.11 CDS Price data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330
S.12 CDS Market data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331


Animated figures (work in Acrobat Reader).

xiv "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
List of Tables

5.1 Call and put options on the Hang Seng Index (HSI). . . . . . . . . . . . . . . . 136

7.1 Summary of Risk Measures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173

10.1 Mortality table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214


10.2 Cumulative historic default rates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222

13.1 CDS Market data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330


13.2 Spread and survival probabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332

xv
Part I
Stochastic Modeling
Chapter 1
Modeling Market Returns

This chapter reviews the constructions of Brownian motion and geometric


Brownian motion for the modeling of risky asset price processes. We also
include a benchmarking of such Gaussian-based models to actual market
returns.

1.1 Random Walks and Brownian Motion . . . . . . . . . . . 3


1.2 Geometric Brownian Motion . . . . . . . . . . . . . . . . . . . . 8
1.3 Distribution of Market Returns . . . . . . . . . . . . . . . . . 18
1.4 Gram-Charlier Expansions . . . . . . . . . . . . . . . . . . . . . . 24
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

1.1 Random Walks and Brownian Motion

We consider the random walk (Sn )n⩾0 , also called the Bernoulli random walk
and defined by S0 := 0 and
n
X
Sn := Xk = X1 + · · · + Xn , n ⩾ 0,
k =1

where the increments (Xk )k⩾1 form a sequence of independent and identically
distributed (i.i.d.) Bernoulli random variables, with distribution

 P(Xk = +1) = p,

P(Xk = −1) = q, k ⩾ 1,

with p + q = 1. In other words, the random walk (Sn )n⩾0 can only evolve by
going up or down by one unit within the finite state space {0, 1, . . . , S}. We
have

" 3

This version: June 9, 2023


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

P(Sn+1 = k + 1 | Sn = k ) = p and P(Sn+1 = k − 1 | Sn = k ) = q,

k ∈ Z. We also have
n n
" #
X X
E[Sn | S0 = 0] = E Xk = E [Xk ] = n(2p − 1) = n(p − q ),
k =1 k =1

and the variance can be computed as


" n # n
X X
Var [Sn | S0 = 0] = Var Xk = Var [Xk ] = 4npq.
k =1 k =1

The probability distribution of S2n is given by

2n
 
P(S2n = 2k | S0 = 0) = pn+k q n−k , −n ⩽ k ⩽ n, (1.1)
n+k

and we note that in an even number of time steps, (Sn )n∈N can only reach
an even state in Z starting from 0. Similarly, in an odd number of time steps,
(Sn )n∈N can only reach
 an  oddstate
 in Z starting from 0. In Figure 1.1 we
10 10
enumerate the 120 = = possible paths corresponding to n = 5
7 3
and k = 2.
7
Path number 19 out of 120
6

-1

-2

-3
0 1 2 3 4 5 6 7 8 9 10

   
10 10
Fig. 1.1: Graph of 120 = = paths with n = 5 and k = 2.∗
7 3


Animated figure (works in Acrobat Reader).

4 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

Brownian Motion

The modeling of random assets in finance is mainly based on stochastic pro-


cesses, which are families (Xt )t∈I of random variables indexed by a time
interval I. Brownian motion is a fundamental example of a stochastic pro-
cess.
Brown (1828) observed the movement of pollen particles as described in “A
brief account of microscopical observations made in the months of June, July
and August, 1827, on the particles contained in the pollen of plants; and on
the general existence of active molecules in organic and inorganic bodies.”
Phil. Mag. 4, 161-173, 1828.

0.8

0.6

0.4

0.2

-0.2

-0.4
0 0.2 0.4 0.6 0.8 1

Fig. 1.2: Two sample paths of one-dimensional Brownian motion.

Einstein received his 1921 Nobel Prize in part for investigations on the theory
of Brownian motion: “... in 1905 Einstein founded a kinetic theory to account
for this movement”, presentation speech by S. Arrhenius, Chairman of the
Nobel Committee, Dec. 10, 1922.

Einstein (1905) “Über die von der molekularkinetischen Theorie der Wärme
geforderte Bewegung von in ruhenden Flüssigkeiten suspendierten Teilchen”,
Annalen der Physik 17.
Bachelier (1900) used Brownian motion for the modeling of stock prices in
his PhD thesis “Théorie de la spéculation”, Annales Scientifiques de l’Ecole
Normale Supérieure 3 (17): 21-86, 1900.
Wiener (1923) is credited, among other fundamental contributions, for the
mathematical foundation of Brownian motion, published in 1923. In partic-
ular he constructed the Wiener space and Wiener measure on C0 ([0, 1]) (the
space of continuous functions from [0, 1] to R vanishing at 0).
Itô constructed the Itô integral with respect to Brownian motion, cf. Itô,
Kiyoshi, Stochastic integral. Proc. Imp. Acad. Tokyo 20 (1944), 519-524. He
also constructed the stochastic calculus with respect to Brownian motion,

" 5

This version: June 9, 2023


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

which laid the foundation for the development of calculus for random pro-
cesses, see Itô (1951) “On stochastic differential equations”, in Memoirs of
the American Mathematical Society.
Definition 1.1. The standard Brownian motion is a stochastic process
(Bt )t∈R+ such that
1. B0 = 0 almost surely,
2. The sample paths t 7→ Bt are (almost surely) continuous.
3. For any finite sequence of times t0 < t1 < · · · < tn , the increments

Bt1 − Bt0 , Bt2 − Bt1 , . . . , Btn − Btn−1

are independent.
4. For any times 0 ⩽ s < t, Bt − Bs is normally distributed with mean
zero and variance t − s.

Bt3
Bt2

Bt1
0 t1 t2 t3

-1
0 0.2 0.4 0.6 0.8 1

Fig. 1.3: Sample paths of a one-dimensional Brownian motion.

See e.g. Chapter 1 of Revuz and Yor (1994) and Theorem 10.28 in Folland
(1999) for proofs of existence of Brownian motion as a stochastic process
(Bt )t∈R+ satisfying the Conditions 1-4 of Definition 1.1.

Brownian motion as a random walk

We will informally regard Brownian motion as a random walk over infinites-


imal time intervals of length ∆t, whose increments

∆Bt := Bt+∆t − Bt ≃ N (0, ∆t)

over the time interval [t, t + ∆t] will be approximated by the Bernoulli random
variable √
∆Bt = ± ∆t (1.2)
with equal probabilities (1/2, 1/2), hence
6 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

1√ 1√
E[∆Bt ] = ∆t − ∆t = 0,
2 2
and
1 1
Var[∆Bt ] = E (∆Bt )2 = ∆t + ∆t = ∆t.
 
2 2
Figure 1.4 presents a simulation of Brownian motion as a random walk with
∆t = 0.1.
3

2.5

1.5
Bt
1

0.5

-0.5

-1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0
t

Fig. 1.4: Construction of Brownian motion as a random walk.∗

In order to recover the Gaussian distribution property of the random variable


BT , we can split the time interval [0, T ] into N subintervals

k−1
 
k
T, T , k = 1, 2, . . . , N ,
N N

of same length ∆t = T /N , with N “large”.

0 T 2T T
N N

We can write
X X1 + X2 + · · · + XN
BT ≃ ∆Bt ≃ √ ,
0<t<T
N
√ √
where Xk := ± N ∆t = ± T with equal probabilities (1/2, 1/2) and
Var(Xk ) = T , hence by the central limit theorem we recover the fact that
BT has the centered Gaussian distribution N (0, T ) with variance T , cf. point
4 of the above Definition 1.1 of Brownian motion, and the illustration given
in Figure 1.5.

The animation works in Acrobat Reader on the entire pdf file.

" 7

This version: June 9, 2023


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

Remark 1.2.
i) The choice of the square root in (1.2) is in fact not fortuitous. Indeed,
any choice of ±(∆t)α with a power α > 1/2 would lead to explosion of
the process as dt tends to zero, whereas a power α ∈ (0, 1/2) would lead
to a vanishing process, as can be checked from the following code.
ii) According to this representation, the paths of Brownian motion are not
differentiable, although they are continuous by Property 2, as we have

dBt ± dt 1
≃ = ± √ ≃ ±∞. (1.3)
dt dt dt

nsim=100; N=1000; t <- 0:N; dt <- 1.0/N; dev.new(width=16,height=7); # Using Bernoulli


samples
X <- matrix((dt)^0.5*(rbinom( nsim * N, 1, 0.5)-0.5)*2, nsim, N)
X <- cbind(rep(0, nsim), t(apply(X, 1, cumsum))); H<-hist(X[,N],plot=FALSE);
layout(matrix(c(1,2), nrow =1, byrow = TRUE));par(mar=c(2,2,2,0), oma = c(2, 2, 2, 2))
plot(t*dt, X[1, ], xlab = "", ylab = "", type = "l", ylim = c(-2, 2), col = 0,xaxs='i',las=1,
cex.axis=1.6)
for (i in 1:nsim){lines(t*dt, X[i, ], type = "l", ylim = c(-2, 2), col = i)}
lines(t*dt,sqrt(t*dt),lty=1,col="red",lwd=3);lines(t*dt,-sqrt(t*dt), lty=1, col="red",lwd=3)
lines(t*dt,0*t, lty=1, col="black",lwd=2)
for (i in 1:nsim){points(0.999, X[i,N], pch=1, lwd = 5, col = i)}
x <- seq(-2,2, length=100); px <- dnorm(x);par(mar = c(2,2,2,2))
plot(NULL , xlab="", ylab="", xlim = c(0, max(px,H$density)), ylim = c(-2,2),axes=F)
rect(0, H$breaks[1:(length(H$breaks) - 1)], col=rainbow(20,start=0.08,end=0.6), H$density,
H$breaks[2:length(H$breaks)]); lines(px,x, lty=1, col="black",lwd=2)

−1

−2
0.0 0.2 0.4 0.6 0.8 1.0

Fig. 1.5: Statistics of one-dimensional Brownian paths vs Gaussian distribution.

1.2 Geometric Brownian Motion

8 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

Financial Data with

The package quantmod can be used to fetch financial data from various
sources such as Yahoo! Finance or the Federal Reserve Bank of St. Louis
(FRED). It can be installed and run via the following command.

install.packages("quantmod")
library(quantmod)
getSymbols("DEXJPUS",src="FRED") # Japan/U.S. Foreign Exchange Rate
getSymbols("CPIAUCNS",src='FRED') # Consumer Price Index
getSymbols("GOOG",src="yahoo") # Google Stock Price

The market returns of an asset priced (St )t∈R+ over time can be estimated
in various ways.
Definition 1.3. 1. Standard returns are defined as
St+dt − St S
= t+dt − 1. (1.4)
St St
2. Log-returns are defined as
 
St+dt S − St
d log St ≃ log St+dt − log St = log = log 1 + t+dt , t ⩾ 0.
St St
(1.5)
The following R script allows us to fetch market price data using Quant-
mod package. Market returns can be estimated using either standard returns
(St+dt − St )/St or log-returns d log St ≃ log St+dt − log St , t ⩾ 0, which can
be computed by the command diff(log(stock)), with dt = 1/365.

getSymbols("^DJI",from="2007-01-03",to=Sys.Date(),src="yahoo")
stock=Ad(`DJI`)
chartSeries(stock,up.col="blue",theme="white")
stock.logrtn=diff(log(stock)); # log returns
stock.rtn=(stock-lag(stock))/lag(stock); # standard returns
chartSeries(stock.rtn,up.col="blue",theme="white")
n = length(!is.na(stock.rtn))

The adjusted close price Ad() is the closing price after adjustments for ap-
plicable splits and dividend distributions.

" 9

This version: June 9, 2023


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

stock.rtn [2007−01−04/2022−12−23] stock [2007−01−03/2022−12−23]


Last 0.00531387123927578 Last 33203.929688
0.10

35000

0.05
30000

25000
0.00

20000

−0.05

15000

−0.10

10000

−0.15

Jan 04 Jul 01 Apr 01 Jan 04 Oct 01 Jul 01 Apr 02 Jan 02 Oct 01 Jul 01 Apr 01 Jan 04 Oct 03 Jul 03 Apr 02 Jan 02 Oct 01 Jul 01 Apr 01 Jan 03 Jan 03 Jul 01 Apr 01 Jan 04 Oct 01 Jul 01 Apr 02 Jan 02 Oct 01 Jul 01 Apr 01 Jan 04 Oct 03 Jul 03 Apr 02 Jan 02 Oct 01 Jul 01 Apr 01 Jan 03
2007 2008 2009 2010 2010 2011 2012 2013 2013 2014 2015 2016 2016 2017 2018 2019 2019 2020 2021 2022 2007 2008 2009 2010 2010 2011 2012 2013 2013 2014 2015 2016 2016 2017 2018 2019 2019 2020 2021 2022

(a) Stock returns. (b) Cumulative stock returns.

Fig. 1.6: Returns vs cumulative returns.

The next code recovers cumulative returns from market returns.

stock<-stock[!is.na(stock.rtn)];stock.rtn<-stock.rtn[!is.na(stock.rtn)]
times=index(stock);dev.new(width=16,height=7);par(mfrow=c(1,2))
plot(times,stock.rtn,pch=19,xaxs="i",yaxs="i",cex=0.03,col="blue", ylab="", xlab="", main
= 'Asset returns', las=1, cex.lab=1.8, cex.axis=1.8, lwd=3)
segments(x0 = times, x1 = times, y0 = 0, y1 = stock.rtn,col="blue")
plot(times,100 * cumprod(1 + as.numeric(stock.rtn)),type='l',col='black',main = "Asset
prices",ylab="", cex=0.1,cex.axis=1,las=1)

The following code plots the yearly returns of the S&P 500 index from
1950 to 2022, see Figure 1.7, together with their histogram.

library(quantmod); getSymbols("^GSPC",from="1950-01-01",to="2022-12-31",src="yahoo")
stock<-Cl(`GSPC`); s=0;y=0;j=0;count=0;N=250;nsim=72; X = matrix(0, nsim, N)
for (i in 1:nrow(GSPC)){if (s==0 && grepl('-01-0',index(stock[i]))) {if (count==0 ||
X[y,N]>0) {y=y+1;j=1;s=1;count=count+1;}}
if (j<=N) {X[y,j]=as.numeric(stock[i]);};if (grepl('-02-0',index(stock[i]))) {s=0;};j=j+1;}
t <- 0:(N-1); dt <- 1.0/N;dev.new(width=16,height=7);
layout(matrix(c(1,2), nrow =1, byrow = TRUE));par(mar=c(2,2,2,0), oma = c(2, 2, 2, 2))
plot(t*dt, X[1,]/X[1,1]-1, xlab = "", ylab = "", type = "l", ylim = c(-0.5, 0.5), col = 0,
xaxs='i',las=1, cex.axis=1.6)
for (i in 1:nsim){lines(t*dt, X[i,]/X[i,1]-1, type = "l", col = i)}
m=mean(X[,N-10]/X[,1]-1);sigma=sd(X[,N-10]/X[,1]-1)
lines(t*dt,sigma*sqrt(t*dt),lty=1,col="red",lwd=3);lines(t*dt,-sigma*sqrt(t*dt), lty=1,
col="red",lwd=3)
lines(t*dt,0*t, lty=1, col="black",lwd=2)
for (i in 1:nsim){points(0.999, X[i,N]/X[i,1]-1, pch=1, lwd = 5, col = i)}
x <- seq(-2,2, length=100); px <- dnorm(x,m,sigma);par(mar = c(2,2,2,2))
H<-hist(X[,N-10]/X[,1]-1,plot=FALSE);
plot(NULL , xlab="", ylab="", xlim = c(0, max(px,H$density)), ylim = c(-2,2),axes=F)
rect(0, H$breaks[1:(length(H$breaks) - 1)], col=rainbow(20,start=0.08,end=0.6), H$density,
H$breaks[2:length(H$breaks)]); lines(px,x, lty=1, col="black",lwd=2)

10 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

0.4

0.2

0.0

−0.2

−0.4

0.0 0.2 0.4 0.6 0.8

Fig. 1.7: Statistics of S&P 500 yearly returns from 1950 to 2022.

Geometric Brownian Motion

Samuelson (1965) rediscovered Bachelier’s ideas and proposed geometric


Brownian motion as a model for stock prices. In an interview he stated “In
the early 1950s I was able to locate by chance this unknown Bachelier (1900)
book, rotting in the library of the University of Paris, and when I opened it
up it was as if a whole new world was laid out before me.” We refer to “Ra-
tional theory of warrant pricing” by Paul Samuelson, Industrial Management
Review, p. 13-32, 1965.

Fig. 1.8: Clark (2000) “As if a whole new world was laid out before me.”∗


Click on the figure to play the video (works in Acrobat Reader on the entire pdf file).

" 11

This version: June 9, 2023


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

The evolution of a riskless bank account value (At )t∈R+ is constructed from
standard returns, as follows:
At+dt − At dAt
= rdt, = rdt, A′t = rAt , t ⩾ 0,
At At
with the solution
At = A0 ert , t ⩾ 0, (1.6)
where r > 0 is the risk-free interest rate.∗
In what follows, we will model the risky asset price process (St )t∈R+ using
standard returns, from the equation
St+dt − St dSt
≃ = µdt + σdBt , t ⩾ 0, (1.7)
St St

which can be solved numerically according to the following code.


N=2000; t <- 0:N; dt <- 1.0/N;mu=0.5; sigma=0.2; nsim <- 10; X <- matrix(0, nsim, N+1)
Z <- matrix(rnorm(nsim*N,mean=0,sd=sqrt(dt)), nsim, N+1)
for (i in 1:nsim){X[i,1]=1.0;
for (j in 1:N+1){X[i,j]=X[i,j-1]+mu*X[i,j-1]*dt+sigma*X[i,j-1]*Z[i,j]}}
plot(t*dt, rep(0, N+1), xlab = "Time", ylab = "Geometric Brownian motion", lwd=2, ylim
= c(min(X),max(X)), type = "l", col = 0,las=1, cex.axis=1.5,cex.lab=1.5, xaxs='i',
yaxs='i')
for (i in 1:nsim){lines(t*dt, X[i, ], lwd=2, type = "l", col = i)}

The following proposition gives the explicit solution to (1.7).


Proposition 1.4 (Geometric Brownian motion). The solution of the stochas-
tic differential equation

dSt = µSt dt + σSt dBt (1.8)

is given by

1
   
St = S0 exp σBt + µ − σ 2 t , t ⩾ 0. (1.9)
2

Proof. Using (1.7), the log-returns (1.5) of an asset priced (St )t∈R+ satisfy

dSt S − St
= t+dt = µdt + σdBt ,
St St
hence

“Anyone who believes exponential growth can go on forever in a finite world is either
a madman or an economist”, K. E. Boulding (1973), page 248.

12 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

St+dt
d log St ≃ log St+dt − log St = log
S
 t 
S − St
= log 1 + t+dt
St
 
dSt
= log 1 +
St
= log(1 + µdt + σdBt )
1
≃ µdt + σdBt − (µdt + σdBt )2
2
σ2
≃ µdt − dt + σdBt , t ⩾ 0.
2

The next Figure 1.9 presents an illustration of the geometric Brownian pro-
cess of Proposition 1.4.

4
St
3.5
ert
3
St 2.5
2
1.5
S0=1
0.5
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0
t

Fig. 1.9: Geometric Brownian motion started at S0 = 1, with µ = r = 1 and σ 2 = 0.5.∗

N=1000; t <- 0:N; dt <- 1.0/N; sigma=0.2; mu=0.5


Z <- rnorm(N,mean=0,sd=sqrt(dt));
plot(t*dt, exp(mu*t*dt), xlab = "time", ylab = "Geometric Brownian motion", type = "l",
ylim = c(0.75, 2), col = 1,lwd=3)
lines(t*dt, exp(sigma*c(0,cumsum(Z))+mu*t*dt-sigma*sigma*t*dt/2),xlab = "time",type =
"l",ylim = c(0, 4), col = 4)

The solution (1.9) of (1.8) can also be simulated by the following code.

The animation works in Acrobat Reader on the entire pdf file.

" 13

This version: June 9, 2023


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

N=2000; t <- 0:N; dt <- 1.0/N; mu=0.5;sigma=0.2; nsim <- 10; par(oma=c(0,1,0,0))
X <- matrix(rnorm(nsim*N,mean=0,sd=sqrt(dt)), nsim, N)
X <- cbind(rep(0, nsim), t(apply(X, 1, cumsum)))
for (i in 1:nsim){X[i,] <- exp(mu*t*dt+sigma*X[i,]-sigma*sigma*t*dt/2)}
plot(t*dt, rep(0, N+1), xlab = "Time", ylab = "Geometric Brownian motion", lwd=2, ylim
= c(min(X),max(X)), type = "l", col = 0,las=1,cex.axis=1.5,cex.lab=1.6, xaxs='i',
yaxs='i')
for (i in 1:nsim){lines(t*dt, X[i, ], lwd=2, type = "l", col = i)}

The next Figure 1.10 presents sample paths of geometric Brownian motion.

2.0
Geometric Brownian motion

1.8

1.6

1.4

1.2

1.0

0.0 0.2 0.4 0.6 0.8 1.0


Time

Fig. 1.10: Ten sample paths of geometric Brownian motion (St )t∈R+ .

The next code. compares to geometric Brownian motion simulations to


asset price data.

library(quantmod); getSymbols("0005.HK",from="2016-02-15",to="2017-05-11",src="yahoo")
Marketprices<-Ad(`0005.HK`); myPars <- chart_pars();myPars$cex<-1.2
returns=(Marketprices-lag(Marketprices))/Marketprices
sigma=sd(as.numeric(returns[-1])); r=mean(as.numeric(returns[-1]))
N=length(Marketprices); t <- 0:N; dt <- 1.0/N;
a=(1+r)*(1-sigma)-1;b=(1+r)*(1+sigma)-1
X <- matrix((a+b)/2+(b-a)*rnorm( N-1, 0, 1)/2, 1, N-1)
X <- as.numeric(Marketprices[1])*cbind(0,t(apply((1+X),1,cumprod))); X[,1]=1;
x=seq(100,100+N-1); dates <- index(Marketprices)
GBM<-xts(x =X[1,], order.by = dates)
myPars <- chart_pars();myPars$cex<-1.4
myTheme <- chart_theme();myTheme$col$line.col <- "blue"
myTheme$rylab <- FALSE;
chart_Series(Marketprices,pars=myPars, theme = myTheme);
dexp<-as.numeric(Marketprices[1])*exp(r*seq(1,305)); ddexp<-xts(x =dexp, order.by = dates)
dev.new(width=16,height=8); par(mfrow=c(1,2));
add_TA(exp(log(ddexp)), on=1, col="black",layout=NULL, lwd=4 ,legend=NULL)
graph <- chart_Series(GBM,theme=myTheme,pars=myPars); myylim <- graph$get_ylim()
graph <- add_TA(exp(log(ddexp)), on=1, col="black",layout=NULL, lwd=4 ,legend=NULL)
myylim[[2]] <- structure(c(min(Marketprices),max(Marketprices)), fixed=TRUE)
graph$set_ylim(myylim); graph

The adjusted close price Ad() is the closing price after adjustments for ap-
plicable splits and dividend distributions.

14 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

The next Figure 1.11 presents a graph of underlying asset price market
data, which is compared to the geometric Brownian motion simulation of
Figure 1.10.

2016−02−15 / 2017−05−10 2016−02−15 / 2017−05−10 60


0005.HK 0005.HK
56 58
ert
56
54 55
54
52
52
50
50 50
48
48
46
46
44 45
44
42 42
40 40 40
38 38

35
Feb 15 May 03 Aug 01 Nov 01 Feb 01 May 02 Feb 15 May 03 Aug 01 Nov 01 Feb 01 May 02
2016 2016 2016 2016 2017 2017 2016 2016 2016 2016 2017 2017

Fig. 1.11: Graph of underlying market prices.

2016−02−15 / 2017−05−10 2016−02−15 / 2017−05−10


Geometric Brownian Motion Geometric Brownian Motion
60 60 60
ert
58 58

56 56
55
54 54

52 52

50 50 50

48 48

46
46 45
44
44
42
42
40 40
40
38

Feb 15 May 03 Aug 01 Nov 01 Feb 01 May 02 Feb 15 May 03 Aug 01 Nov 01 Feb 01 May 35
02
2016 2016 2016 2016 2017 2017 2016 2016 2016 2016 2017 2017

Fig. 1.12: Graph of simulated geometric Brownian motion.

The package Sim.DiffProc can be used to estimate the coefficients of a


geometric Brownian motion fitting observed market data.

library("Sim.DiffProc")
fx <- expression( theta[1]*x ); gx <- expression( theta[2]*x )
fitsde(data = as.ts(Marketprices), drift = fx, diffusion = gx, start = list(theta1=0.01,
theta2=0.01),pmle="euler")

In the next proposition, we compute the probability distribution of geometric


Brownian motion at any given time.
Proposition 1.5. At any time T > 0, the random variable
2 /2)T
ST := S0 eσBT +(µ−σ

has the lognormal distribution with probability density function

" 15

This version: June 9, 2023


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

1 2 2 2
x 7−→ f (x) = √ e−(−(µ−σ /2)T +log(x/S0 )) /(2σ T ) , x > 0,
xσ 2πT

with log-variance σ 2 and log-mean (µ − σ 2 /2)T + log S0 , see Figure 1.14.

Proof. For all x ∈ R, we have


2
P(ST ⩽ x) = P S0 eσBT +(µ−σ /2)T ⩽ x


σ2
   
x
= P σBT + µ − T ⩽ log
2 S0
1 σ2
    
x
= P BT ⩽ log − µ− T
σ S0 2
w (log(x/S0 )−(µ−σ2 /2)T )/σ 2 dy
= e−y /(2T ) √
−∞ 2πT
w (log(x/S0 )−(µ−σ2 /2)T )/(σ√T )
−z 2 /2 dz
= e √
−∞ 2π
1 σ2
    
x
=Φ √ log − µ− T ,
σ T S0 2

where wx 2 /2 dy
Φ (x) : = e−y √ , x ∈ R,
−∞ 2πT
denotes the standard Gaussian Cumulative Distribution Function (CDF) of
a standard normal random variable X ≃ N (0, 1), with the relation

Φ(−x) = 1 − Φ(x), x ∈ R.

1.2
1
1 Gaussian CDF Φ(x)

0.8
Φ(x)
0.6

0.4

0.2

0
-4 -3 -2 -1 0 1 2 3 4
x

Fig. 1.13: Graph of the Gaussian Cumulative Distribution Function (CDF).

16 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

After differentiation with respect to x, we find the lognormal probability


density function

dP(ST ⩽ x)
f (x) =
dx
∂ w (log(x/S0 )−(µ−σ2 /2)T )/σ −y2 /(2T ) dy
= e √
∂x −∞ 2πT
1 σ2
    
∂ x
= Φ √ log − µ− T
∂x σ T S0 2
1 1 2
    
x σ
= √ φ √ log − µ− T
xσ T σ T S0 2
1 2 2 2
= √ e−(−(µ−σ /2)T +log(x/S0 )) /(2σ T ) , x > 0,
xσ 2πT
where
1 2
φ(y ) = Φ′ (y ) := √ e−y /2 , y ∈ R,

denotes the standard Gaussian probability density function. □
N=1000; t <- 0:N; dt <- 1.0/N; nsim <- 100 # using Bernoulli samples
sigma=0.2;r=0.5;a=(1+r*dt)*(1-sigma*sqrt(dt))-1;b=(1+r*dt)*(1+sigma*sqrt(dt))-1
X <- matrix(a+(b-a)*rbinom( nsim * N, 1, 0.5), nsim, N)
X<-cbind(rep(0,nsim),t(apply((1+X),1,cumprod))); X[,1]=1;H<-hist(X[,N],plot=FALSE);
dev.new(width=16,height=7);
layout(matrix(c(1,2), nrow =1, byrow = TRUE)); par(mar=c(2,2,2,0), oma = c(2, 2, 2, 2))
plot(t*dt,X[1,],xlab="time",ylab="",type="l",ylim=c(0.8,3), col = 0,xaxs='i',las=1,
cex.axis=1.6)
for (i in 1:nsim){lines(t*dt, X[i, ], xlab = "time", type = "l", col = i)}
lines((1+r*dt)^t, type="l", lty=1, col="black",lwd=3,xlab="",ylab="", main="")
for (i in 1:nsim){points(0.999, X[i,N], pch=1, lwd = 5, col = i)}; x <- seq(0.01,3,
length=100);
px <- exp(-(-(r-sigma^2/2)+log(x))^2/2/sigma^2)/x/sigma/sqrt(2*pi); par(mar = c(2,2,2,2))
plot(NULL , xlab="", ylab="", xlim = c(0, max(px,H$density)),ylim=c(0.8,3),axes=F, las=1)
rect(0, H$breaks[1:(length(H$breaks) - 1)], col=rainbow(20,start=0.08,end=0.6), H$density,
H$breaks[2:length(H$breaks)])
lines(px,x, type="l", lty=1, col="black",lwd=3,xlab="",ylab="", main="")

" 17

This version: June 9, 2023


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

3.0

2.5

2.0

1.5

1.0

0.0 0.2 0.4 0.6 0.8 1.0


time

Fig. 1.14: Statistics of geometric Brownian paths vs lognormal distribution.

library(quantmod)
getSymbols("^STI",from="1990-01-03",to="2015-01-03",src="yahoo");stock=Ad(`STI`);
getSymbols("^DJI",from="1990-01-03",to=Sys.Date(),src="yahoo");stock=Ad(`DJI`);
stock.rtn=diff(log(stock));returns <- as.vector(stock.rtn)
m=mean(returns,na.rm=TRUE);s=sd(returns,na.rm=TRUE);times=index(stock.rtn)

1.3 Distribution of Market Returns

Market returns vs Gaussian and power tails

Consider for example the market returns data obtained from fetching DJI and
STI index data using the package Quantmod and the following scripts.
library(quantmod)
getSymbols("^STI",from="1990-01-03",to="2015-01-03",src="yahoo");stock=Ad(`STI`);
getSymbols("^DJI",from="1990-01-03",to=Sys.Date(),src="yahoo");stock=Ad(`DJI`);
stock.rtn=diff(log(stock));returns <- as.vector(stock.rtn)
m=mean(returns,na.rm=TRUE);s=sd(returns,na.rm=TRUE);times=index(stock.rtn)
n = sum(is.na(returns))+sum(!is.na(returns));x=seq(1,n);y=rnorm(n,mean=m,sd=s)
dev.new(width=16,height=8)
plot(times,returns,pch=19,xaxs="i",yaxs="i",cex=0.03,col="blue", ylab="", xlab="", main
= '', las=1, cex.lab=1.8, cex.axis=1.8, lwd=3)
segments(x0 = times, x1 = times, y0 = 0, y1 = returns,col="blue")
points(times,y,pch=19,cex=0.3,col="red")
abline(h = m+3*s, col="black", lwd =1);abline(h = m, col="black", lwd =1);abline(h =
m+-3*s, col="black", lwd =1)
length(returns[abs(returns-m)>3*s])/length(stock.rtn)
length(y[abs(y-m)>3*s])/length(y);2*(1-pnorm(3*s,0,s))

Figure 1.15 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 ),
99.73% of samples of X are falling within the interval [−3σ, +3σ ], i.e.
P(|X| ⩽ 3σ ) = 0.9973002.

18 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

0.05

0.00

−0.05

1995 2000 2005 2010 2015

Fig. 1.15: Market returns (blue) vs normalized Gaussian returns (red).

stock.ecdf=ecdf(as.vector(stock.rtn));x <- seq(-0.25, 0.25, length=100);px <- pnorm((x-m)/s)


dev.new(width=16,height=8)
plot(stock.ecdf, xlab = '', col="blue",ylab = '', ylim=c(-0.002,1.002), main = '', xaxs="i",
yaxs="i", las=1, cex.lab=1.8, cex.axis=1.8, lwd=3)
lines(x, px, type="l", lty=2, col="red",xlab="",ylab="", main="")
legend("topleft", legend=c("Empirical CDF", "Gaussian CDF"),col=c("blue", "red"), lty=1:2,
cex=2);grid(lwd = 2)

1.0
Empirical CDF
Gaussian CDF
0.8

0.6

0.4

0.2

0.0
−0.15 −0.10 −0.05 0.00 0.05 0.10

Fig. 1.16: Empirical vs Gaussian CDF.

The following Quantile-Quantile plot is plotting the normalized empirical


quantiles against the standard Gaussian quantiles, and is obtained with the
qqnorm(returns) command.

" 19

This version: June 9, 2023


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

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)
grid(lwd = 2)

Normal Q−Q Plot

0.10

0.05
Sample Quantiles

0.00

−0.05

−0.10

−3 −2 −1 0 1 2 3

Theoretical Quantiles

Fig. 1.17: Quantile-Quantile plot.

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

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


hypothesis of market returns.
n = sum(is.na(returns))+sum(!is.na(returns));x=seq(1,n);y=rnorm(n,mean=m,sd=s)
ks.test(y,"pnorm",mean=m,sd=s)
ks.test(returns,"pnorm",mean=m,sd=s)

One-sample Kolmogorov-Smirnov test

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

Skewness and kurtosis

Given X a random variable, the sequence (κX


n )n⩾1 of cumulants of X has
been introduced in Thiele (1899).
a) First moment and cumulant. We have κX1 = E[X ].
b) Variance and second cumulant. We have

20 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

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

q
and 2 is the standard deviation of X.
κX
c) The third cumulant of X is given as the third central moment κX
3 =
E[(X − E[X ])3 ].
d) Similarly, the fourth cumulant of X satisfies

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


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


Definition 1.6. i) The coefficient

E (X − E[X ])3
 
κX
SkX := 3
=
(κX
2 )
3/2 (E[(X − E[X ])2 ])3/2

is the skewness of X.
ii) The excess kurtosis of X is defined as

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


EKX := 4
= − 3.
(κX
2 ) 2 ( E [(X − E[X ])2 ])2

The mismatch in distributions observed in Figures 1.15-1.17 can be further


illustrated by the empirical probability density plot in Figure 1.18, which is
obtained from the following code.

dev.new(width=16,height=8)
x <- seq(-0.25, 0.25, length=100);qx <- dnorm(x,mean=m,sd=s)
stock.dens=density(stock.rtn,na.rm=TRUE)
plot(stock.dens, xlab = 'x', 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",xlab="x value",ylab="Density", main="")
legend("topleft", legend=c("Empirical density", "Gaussian density"),col=c("red", "blue"),
lty=1:2, cex=1.5);grid(lwd = 2)

" 21

This version: June 9, 2023


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

Empirical density
60 Gaussian density

50

40

30

20

10

0
−0.10 −0.05 0.00 0.05 0.10
x

Fig. 1.18: Empirical density vs normalized Gaussian density.

Form the above figure, we note that market returns have kurtosis higher
than that of the normal distribution, i.e. their distribution is leptokurtic, in
addition to showing some negative skewness.
The next code and graph present a comparison of market prices to a
calibrated lognormal distribution.

x <- seq(0, max(stock), length=100);qx <- dlnorm(x,mean=mean(log(stock)),


sd=sd(log(stock)))
stock.dens=density(stock,na.rm=TRUE);dev.new(width=10, height=5)
plot(stock.dens, xlab = 'x', lwd=3, col="red",ylab = '', main = '',panel.first = abline(h = 0,
col='grey', lwd =0.2), las=1, cex.axis=1, cex.lab=1, xaxs='i', yaxs='i')
lines(x, qx, type="l", lty=2, lwd=3, col="blue",xlab="x value",ylab="Density", main="")
legend("topright", legend=c("Empirical density", "Lognormal density"),col=c("red", "blue"),
lty=1:2, cex=1.2)

0.00012
Empirical density
Lognormal density
0.00010

0.00008

0.00006

0.00004

0.00002

5000 10000 15000 20000 25000 30000 35000

Fig. 1.19: Empirical density vs normalized lognormal density.

22 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

Power tail distributions

We note that the empirical density has significantly higher kurtosis and non
zero skewness in comparison with the Gaussian probability density. On the
other 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 1.20.

Empirical density
60 Power density

50

40

30

20

10

0
−0.10 −0.05 0.00 0.05 0.10

Fig. 1.20: Empirical density vs power density.

The above fitting of empirical probability density function is using a power


probability density function defined by a rational fraction obtained by the
following script.

install.packages("pracma")
library(pracma); x <- seq(-0.25, 0.25, length=1000)
stock.dens=density(returns,na.rm=TRUE, from = -0.1, to = 0.1, n = 1000)
a<-rationalfit(stock.dens$x, stock.dens$y, d1=2, d2=2)
dev.new(width=16,height=8)
plot(stock.dens$x,stock.dens$y, lwd=4, type = "l",xlab = '', 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,(a$p1[3]+a$p1[2]*x+a$p1[1]*x^2)/(a$p2[3]+a$p2[2]*x+a$p2[1]*x^2),
type="l",lty=2,col="blue",xlab="x value",lwd=4, ylab="Density",main="")
legend("topleft", legend=c("Empirical density", "Power density"),col=c("red", "blue"),
lty=1:2, cex=1.5);grid(lwd = 2)

The output of the rationalfit command is


$p1
[1] -0.184717249 -0.001591433 0.001385017

$p2
[1] 1.000000e+00 -6.460948e-04 1.314672e-05
which yields a rational fraction of the form

" 23

This version: June 9, 2023


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

0.001385017 − 0.001591433 × x − 0.184717249 × x2


x 7−→
1.314672 10−5 − 6.460948 10−4 × x + x2
0.001591433 0.001385017
≃ −0.184717249 − + ,
x x2
which approximates the empirical probability density function of DJI returns
in the least squares sense.

A solution to this tail problem is to use stochastic processes with jumps, that
will account for sudden variations of the asset prices. On the other hand,
such jump models are generally based on the Poisson distribution which has
a slower tail decay than the Gaussian distribution. This allows one to assign
higher probabilities to extreme events, resulting in a more realistic modeling
of asset prices. Stable distributions with parameter α ∈ (0, 2) provide typical
examples of probability laws with power tails, as their probability density
functions behave asymptotically as x 7→ Cα /|x|1+α when x → ±∞.

1.4 Gram-Charlier Expansions


Let
1 2
φ(x) := √ e−x /2 , x ∈ R,

denote the standard normal density function, and let
wx
Φ (x) : = φ(y )dy, x ∈ R,
−∞

denote the standard normal cumulative distribution function. Let also


(−1)n ∂ n φ
Hn ( x ) : = (x), x ∈ R,
φ(x) ∂xn

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


We will also need the definition of higher order cumulants. For this, we use
the Moment Generating Function (MGF) of the random variable X, defined
as
X tn
MX (t) := E etX = 1 + E[X n ], t ∈ R. (1.10)
 
n!
n⩾1

Definition 1.7. The cumulants of a random variable X are defined to be


the coefficients (κX
n )n⩾1 appearing in the series expansion
 
X tn X tn
log E e = log 1 + E[X n ] = , t ∈ R, (1.11)
 tX 
κX
n
n! n!
n⩾1 n⩾1

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


24 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

The cumulants of X were originally called “semi-invariants” due to the prop-


erty κX +Y = κX + κY , n ⩾ 1, when X and Y are independent random
n n n
variables. Indeed, in this case we have

+Y tn
= log E et(X +Y )
X
κX
 
n
n!
n⩾1

= log E etX E etY


   

= log E etX + log E etY


   

X tn X tn
= κX
n + κYn
n! n!
n⩾1 n⩾1
X  tn
= κX Y
n + κn , t ∈ R,
n!
n⩾1

showing that κX +Y = κX + κY , n ⩾ 1.
n n n

The next proposition summarizes the Gram-Charlier expansion method to


obtain series expansion of a probability density function, see Gram (1883),
Charlier (1914) and § 17.6 of Cramér (1946).
Proposition 1.8. (Proposition 2.1 in Tanaka et al. (2010)) The Gram-
Charlier expansion of the continuous probability density function ϕX (x) of a
random variable X is given by
     

1 x − κ X
1 1 X x − κX
1 x − κX
1 ,
ϕX ( x ) = q φ  q + q cn Hn  q φ q
κX2 κX
2 κX2 n=3 κX
2 κX
2

where c0 = 1, c1 = c2 = 0, and the sequence (cn )n⩾3 is given from the


cumulants (κX
n )n⩾1 of X as

[n/3]
1 X X κX X
l1 · · · κlm
cn = , n ⩾ 3.
(κX
2 ) n/2
m=1 l
m!l1 ! · · · lm !
1 +···+lm =n
l1 ,...,lm ⩾3

The coefficients c3 and c4 can be expressed from the skweness κX X 3/2


3 / (κ2 )
and the excess kurtosis κX
4 / (κ2 ) as
X 2

κX κX
c3 = 3
and c4 = 4
.
3!(κX
2 )
3/2 4!(κX
2 )
2

a) The first-order expansion

" 25

This version: June 9, 2023


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

 
(1) 1 x − κX
1
ϕX ( x ) =q φ q 
κX2 κX
2

corresponds to normal moment matching approximation.


b) The third-order expansion is given by
    
(3) 1  x − κX x − κX
ϕX ( x ) = q 1 + c3 H3  q 1  φ  q 1  .
κX
2 κX
2 κX
2

c) The fourth-order expansion is given by


      
(4) 1  x − κX x − κ X x − κX
ϕX ( x ) = q 1 + c3 H3  q 1  + c 4 H4  q 1  φ  q 1 .
κX
2 κX
2 κX
2 κX
2

install.packages("SimMultiCorrData");install.packages("PDQutils")
library(SimMultiCorrData);library(PDQutils)
dev.new(width=16,height=8);m<-calc_moments(returns[!is.na(returns)]);
x <- stock.dens$x; qx <- dnorm(x,mean=m[1],sd=m[2])
plot(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")
cumulants<-c(m[1],m[2]**2);d2 <- dapx_edgeworth(x, cumulants)
lines(x, d2, type="l", lty=2, lwd=4, col="blue")
cumulants<-c(m[1],m[2]**2,m[3]*m[2]**3);d3 <- dapx_edgeworth(x, cumulants)
lines(x, d3, type="l", lty=2, lwd=4, col="green")
cumulants<-c(m[1],m[2]**2,0.5*m[3]*m[2]**3,0.2*m[4]*m[2]**4)
d4 <- dapx_edgeworth(x, cumulants);lines(x, d4, type="l", lty=2, lwd=4, col="purple")
legend("topleft", legend=c("Empirical density", "Gaussian density", "Third order
Gram-Charlier", "Fourth order Gram-Charlier"),col=c("red", "blue", "green",
"purple"), lty=1:2,cex=1.5);grid(lwd = 2)

Empirical density
60 Gaussian density
Third order Gram−Charlier
Fourth order Gram−Charlier
50

40

30

20

10

0
−0.10 −0.05 0.00 0.05 0.10
x

Fig. 1.21: Gram-Charlier expansions

26 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

Exercises

Exercise 1.1 Let c > 0. Using the definition of Brownian motion (Bt )t∈R+ ,
show that:
a) (Bc+t − Bc )t∈R+ is a Brownian motion.
b) (cBt/c2 )t∈R+ is a Brownian motion.

Exercise 1.2 Solve the stochastic differential equation

dSt = µSt dt + σSt dBt , (1.12)

defining geometric Brownian motion (St )t∈R+ , where µ, σ ∈ R.


4
St
ert
3.5

2.5
St
2

1.5

0.5

0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0
t

Fig. 1.22: Sample path of (1.12) with r = 1 and σ 2 = 0.5.

" 27

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Chapter 2
Time Series

Time series are sequences of data points indexed in discrete time. This chap-
ter reviews the Moving Average (MA), Autoregressive (AR), Autoregressive
Moving Average (ARMA), and Autoregressive Integrated Moving Average
(ARIMA) time series models. The stationarity properties of time series are
considered via their autocovariance graph and unit root testing. Several ex-
amples are considered, including the fitting of time series models to financial
data in . We conclude with an application to a pair trading algorithm on
a financial market, which relies the Dickey-Fuller stationarity test.

2.1 Autoregressive Moving Average . . . . . . . . . . . . . . . . . 29


2.2 Autoregressive Heteroskedasticity . . . . . . . . . . . . . . . 38
2.3 Time Series Stationarity . . . . . . . . . . . . . . . . . . . . . . . . 41
2.4 Fitting Time Series to Financial Data . . . . . . . . . . . 48
2.5 Application: Pair Trading . . . . . . . . . . . . . . . . . . . . . . . 54
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61

2.1 Autoregressive Moving Average

White noise

Let Z = {. . . , −3, −2, −1, 0, 1, 2, 3, . . .}. A white noise sequence is a sequence


(Zn )n∈Z of independent, centered and identically distributed random vari-
ables with unit variance, with

E[Zn ] = 0, and Cov(Zn , Zm ) = 1{n=m} , n, m ∈ Z.

Zn<-rnorm(100,0,1)
Zn

" 29

This version: June 9, 2023


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

Moving Average (MA) model

Definition 2.1. In the MA(q ) model of order q ⩾ 1, the current state Xn


of the system is expressed as the linear combination

Xn := Zn + β1 Zn−1 + · · · + βq Zn−q
Xq
= Zn + βk Zn−k , n ⩾ 0, (2.1)
k =1

of the q previous values Zn−1 , . . . , Zn−q . Here, β1 , . . . , βq is a sequence of


deterministic coefficients.
We will use the “lag operator” or “backward time shift operator” L defined
as
LZn := Zn−1 , n ⩾ 1. (2.2)

library(zoo)
N=5; Zn<-zoo(rnorm(N,0,1))
Zn
lag(Zn,-1, na.pad = TRUE)

Using the lag operator L, we can rewrite (2.1) as

Xn = Zn + β1 LZn + · · · + βq Lq Zn
Xq
= Zn + βk Lk Zn
k =1
= Zn + ψ ( L ) Zn , n ⩾ q,

where
q
X
ψ (L) = β1 L + · · · + βq Lq = βk Lk
k =1
is the moving average operator given by the function
q
X
ψ ( x ) = β1 x + · · · + βq x q = βk x k .
k =1

Example: generating MA(2) samples in

30 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

n=41
ma.sim<-arima.sim(model=list(ma=c(-.7,.1)),n.start=100,n)
x=seq(100,100+n-1);dev.new(width=12, height=6)
plot(x,ma.sim,pch=19, ylab="", xlab="n",main = 'MA(2) Samples',col='blue',cex.axis=1.8,
cex.lab=1.5,las=1)
lines(x,ma.sim,col='blue');grid()

The ARIMA command uses a parameter “n.start”, here taken equal to 100,
which creates a “burn-in” initial time interval which ensures sufficient ran-
domness in the behavior of Xn .
MA(2) Samples

−1

−2

−3
100 110 120 130 140
n

Fig. 2.1: MA(2) Samples.

Autoregressive (AR) model

In the simplest AR(1) model, the current state Xn of the system is expressed
in feedback form as

Xn := Zn + α1 Xn−1 , n ⩾ 1, (2.3)

Definition 2.2. In the AR(p) model, p ⩾ 1, the state Xn of the system is


expressed as the linear feedback combination

Xn := Zn + α1 Xn−1 + · · · + αp Xn−p (2.4)


Xp
= Zn + αk Xn−k , n ⩾ p,
k =1

of the p previous values Xn−1 , . . . , Xn−p of the process, where α1 , . . . , αp ∈ R


is a sequence of deterministic coefficients.
Using again the lag operator L defined in (2.2) we can rewrite (2.4) as

Xn = Zn + α1 LXn + · · · + αp Lp Xn
Xp
= Zn + αk Lk Xn
k =1

" 31

This version: June 9, 2023


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

= Zn + ϕ(L)Xn , n ⩾ p,

where
p
X
ϕ(L) = α1 L + · · · + αp Lp = αk Lk
k =1
is the operator given by the function
p
X
ϕ(x) = α1 x + · · · + αp xp = α k xk .
k =1

Proposition 2.3. The equation

Xn := Zn + α1 Xn−1 , n ∈ Z, (2.5)
defines an AR(1) process (Xn )n∈Z , and can be solved recursively in the fol-
lowing cases:
a) When |α1 | < 1, (2.5) admits the converging causal moving average solution
X
Xn = α1k Zn−k , n ∈ Z, (2.6)
k⩾0

with X 1
Var[Xn ] = |α1 |2k = ⩾ 1, n ∈ Z. (2.7)
1 − |α1 |2
k⩾0

b) When |α1 | > 1, (2.5) admits the converging non-causal moving average
solution X 1
Xn = − Zn + k , n ⩾ 0, (2.8)
αk
k ⩾1 1

with X 1
Var[Xn ] = |α1 |−2k = , n ⩾ 0. (2.9)
|α1 |2 − 1
k⩾1

No such converging solution exists when |α1 | = 1.

Proof.
a) When |α1 | < 1 we may write, using backward induction,

Xn = Zn + α1 Xn−1
= Zn + α1 (Zn−1 + α1 Xn−2 )
= Zn + α1 (Zn−1 + α1 (Zn−2 + α1 Xn−3 ))

32 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

= Zn + α1 (Zn−1 + α1 (Zn−2 + α1 (Zn−3 + α1 Xn−4 )))


= Zn + α1 Zn−1 + α12 Zn−2 + α13 Zn−3 + α14 Xn−4
= ···
X
= α1k Zn−k ,
k ⩾0

which converges when the solution z = 1/α1 of the equation ϕ(z ) = α1 z = 1


satisfies |α1 | < 1, i.e. |z| > 1.

b) When |α1 | > 1, we write

Xn = −α1−1 Zn+1 + α1−1 Xn+1 , n ⩾ 0,

which can be solved by forward induction as

Xn = −α1−1 Zn+1 + α1−1 Xn+1


= −α1−1 Zn+1 + α1−1 (−α1−1 Zn+2 + α1−1 Xn+2 )
= −α1−1 Zn+1 + α1−1 (−α1−1 Zn+2 + α1−1 (−α1−1 Zn+3 + α1−1 Xn+3 ))
= −α1−1 Zn+1 − α1−2 Zn+2 − α1−3 Zn+3 + α1−4 Xn+3
= ···
X 1
=− Zn + k ,
αk
k⩾1 1

when the solution z = 1/α1 of the equation ϕ(z ) = α1 z = 1 satisfies |z| < 1.

Example: generating AR(2) samples in

Consider the AR(2) times series

Xn := Zn + 0.9 × Xn−1 − 0.2 × Xn−2 . (2.10)

n=41; ar.sim<-arima.sim(model=list(ar=c(.9,-.2)),n.start=100,n)
x=seq(100,100+n-1)
dev.new(width=12, height=6)
plot(x,ar.sim,pch=19, ylab="", xlab="n", main = 'AR(2) Samples',col='blue',cex.axis=1.8,
cex.lab=1.5,las=1)
lines(x,ar.sim,col='blue');grid()

" 33

This version: June 9, 2023


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

AR(2) Samples

−1

−2

100 110 120 130 140


n

Fig. 2.2: AR(2) Samples.

Autoregressive Moving Average (ARMA) model

Definition 2.4. In the ARMA(p, q ) model with orders p ⩾ 1 and q ⩾ 1, the


current state Xn of the system is expressed as the linear combination

Xn := Zn + α1 Xn−1 + · · · + αp Xn−p + β1 Zn−1 + · · · + βp Zn−q


Xp Xq
= Zn + αk Xn−k + βk Zn−k , (2.11)
k =1 k =1

of the p previous values Xn−1 , . . . , Xn−p and Zn−1 , . . . , Zn−p , n ⩾ Max(p, q ).


Using again the lag operator L defined in (2.2) we can rewrite (2.11) as
p
X q
X
Xn = Zn + αk Lk Xn + βk Lk Zn
k =1 k =1
= Zn + ϕ(L)Xn + ψ (L)Zn , n ⩾ 1.

Example: generating ARMA(2) samples in

n=41
arma.sim<-arima.sim(model=list(ar=c(.9,-.2),ma=c(-.7,.1)),n.start=100,n)
x=seq(100,100+n-1);dev.new(width=12, height=6)
plot(x,arma.sim,pch=19, ylab="", xlab="n", main = 'ARMA(2)
Samples',col='blue',cex.axis=1.8, cex.lab=1.5,las=1)
lines(x,arma.sim,col='blue');grid()

34 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

ARMA(2) Samples

−1

−2
100 110 120 130 140
n

Fig. 2.3: ARMA(2) Samples.

Autoregressive Integrated Moving Average

Consider the difference operator ∇ defined as

∇ := I − L

where I is the identity operator and L is the lag operator, so that

∇Xn := Xn − Xn−1 , n ⩾ 1.

In addition, the operation ∇Xn = Xn − Xn−1 can be iterated as follows:

∇2 Xn = ∇∇Xn
= ∇(Xn − Xn−1 )
= ∇Xn − ∇Xn−1
= Xn − Xn−1 − (Xn−1 − Xn−2 )
= Xn − 2Xn−1 + Xn−2 ,

and

∇3 Xn = ∇∇2 Xn
= ∇Xn − 2∇Xn−1 + ∇Xn−2
= Xn − Xn−1 − 2(Xn−1 − Xn−2 ) + Xn−2 − Xn−3
= Xn − 3Xn−1 + 3Xn−2 − Xn−3 .

The time series (Xn )k⩾1 can be recovered by integrating (∇Xk )k⩾1 using
the telescoping identity
n
X n
X
Xn = X0 + (Xk − Xk−1 ) = X0 + ∇Xk , n ⩾ 1. (2.12)
k =1 k =1

" 35

This version: June 9, 2023


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

More generally, the process (Xn )n⩾0 can be recovered by successive appli-
cations of the discrete integration formula (2.12) as in the next proposition,
where we use the convention ∇0 = I.
Proposition 2.5. a) The iterated operator ∇d satisfies
d  
X d
∇d Xn = (−1)k Xn−k , n ⩾ d ⩾ 0.
k
k =0

b) The time series (Xn )n⩾d can be recovered from ∇Xn , ∇2 Xn , . . . , ∇d Xn as

d  
X d
Xn = Xn−d + ∇k Xn+k−d , n ⩾ d ⩾ 0.
k
k =1

Proof. (a) This is a consequence of the binomial operator identity

∇d = ( I − L ) d
d  
X d
= (I)n−k (−L)k
k
k =0
d  
X d
= (−1)k Lk .
k
k =0

(b) Apply the binomial operator identity


d  
X d d−k k
I = (I − L + L)d = (L + ∇)d = L ∇ .
k
k =0

Definition 2.6. In the ARIMA(p, d, q ) model, the iterated difference process


(∇d Xn )n⩾0 is modeled as the ARMA(p, q ) time series

∇d Xn := Zn + α1 ∇d Xn−1 + · · · + αp ∇d Xn−p
+β1 Zn−1 + · · · + βq Zn−q
Xp X q
= Zn + αk ∇d Xn−k + βk Zn−k , (2.13)
k =1 k =1

n ⩾ Max(p + d, q + d), based on the p previous values ∇d Xn−1 , . . . , ∇d Xn−p


and Zn−1 , . . . , Zn−q .
Using the backward time shift operator L we can rewrite (2.13) as

36 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

∇d Xn = Zn + ϕ(L)∇d Xn + ψ (L)Zn ,

n ⩾ Max(p + d, q + d), where the functions ϕ(z ) and ψ (z ) are given by


p
X p
X
ϕ(z ) = αk z k and ψ (z ) = βk z k .
k =1 k =1

In other words, we have

(I − ϕ(L))∇d Xn = Zn + ψ (L)Zn ,

n ⩾ Max(p + d, q + d). The process (Xn )n⩾0 can then be recovered by suc-
cessive applications of the discrete integration formula (2.12) as in Proposi-
tion 2.5-(b). Alternatively, we can start by recovering ∇d−1 Xn from ∇d Xn
as
n 
X 
∇d−1 Xn = ∇d−1 X0 + ∇d−1 Xk − ∇d−1 Xk−1
k =1
X n
= ∇d−1 X0 + ∇d Xk ,
k =1

followed by
∇d−2 Xn , ∇d−3 Xn , . . . , ∇2 Xn , ∇Xn , Xn ,
by induction on n ⩾ d.

Example: generating ARIMA(1, 2, 3) samples in

n=41;d=2
arima.sim<-arima.sim(model=list(ar=c(0.5),ma=c(0.5, 0.5, -0.5), order=c(1,d,3)),
n.start=100,n)
x=seq(100,100+n+d-1); dev.new(width=12, height=6)
plot(x,arima.sim,pch=19, ylab="", xlab="n", main = paste("ARIMA(1,",d,",3)
Samples",sep=" "),cex.axis=1.8, cex.lab=1.5,las=1)
lines(x,arima.sim,col='blue');grid()

" 37

This version: June 9, 2023


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

ARIMA(1, 2 ,3) Samples

80

60

40

20

0
100 110 120 130 140
n

Fig. 2.4: ARIMA(1, 2, 3) Samples.

Note that the ARIMA graph of Figure 2.4 has more potential for prediction
than the ARMA graph of Figure 2.3 due to increased dependence on past
samples in the considered model, or longer memory.

2.2 Autoregressive Heteroskedasticity

As above, we consider a white noise sequence (Zn )n∈Z of independent, cen-


tered and identically distributed with unit variance.

Autoregressive Conditional Heteroskedasticity (ARCH) model

Heteroskedasticity refers to time-dependent variance in a time series.


Definition 2.7. In the ARCH(q ) model of order q ⩾ 1, the current state Xn
of the system is expressed by the equation

Xn := σn Zn , n ⩾ 0, (2.14)

where
p
X
σn2 = α0 + 2
αk Xn−k , n ⩾ p, (2.15)
k =1
and α0 , . . . , αp ⩾ 0 is a sequence of nonnegative deterministic coefficients.
Using the lag operator L, we can rewrite (2.15) as
p
X
σn2 = α0 + αk Lk Xn2
k =1
= α0 + ψ (L)Xn2 , n ⩾ p,

where

38 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

p
X
ψ (L) = α1 L + · · · + αp Lp = αk Lk .
k =1
In particular, using the independence of σn and Zn , we have

E[Xn2 ] = E[σn2 Zn2 ]


= E[Zn2 ]E[σn2 ]
= E[σn2 ]
X p
= α0 + αk E[Xn−k
2
]
k =1
X p
= α0 + αk E[σn−k
2
]
k =1

Example: generating ARCH(2) samples in

Consider the ARCH(2) times series with variance process given by

σn2 = α0 + 0.2 × Xn−1


2
+ 0.4 × Xn−2
2
, n ⩾ 2. (2.16)

library(fGarch)
arch.spec<-garchSpec(model=list(omega = 10E-6,alpha=c(0.2,0.4),beta = 0))
n=100; arch.sim<-garchSim(arch.spec,n); x=seq(1,n); dev.new(width=12, height=6)
plot(x,arch.sim,pch=19, ylab="", xlab="n", main = 'ARCH(2) Samples', col='blue',
cex.axis=1.5, cex.lab=1.7, las=1)
lines(x,arch.sim,col='blue');grid()

ARCH(2) Samples

0.03

0.02

0.01

0.00

−0.01

−0.02

−0.03

0 20 40 60 80 100
n

Fig. 2.5: ARCH(2) Samples.

" 39

This version: June 9, 2023


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

Generalized Autoregressive Conditional Heteroskedasticity


(GARCH) model

Definition 2.8. In the GARCH(p, q ) model with orders p ⩾ 1 and q ⩾ 1,


the current state Xn of the system is expressed by the equation (2.14), where
p
X q
X
σn2 = α0 + 2
αk Xn−k + 2
βk σn−k , n ⩾ Max(p, q ), (2.17)
k =1 k =1

and α0 , . . . , αp ⩾ 0, β1 , . . . , βq ⩾ 0 are sequences of nonnegative deterministic


coefficients.
Using the lag operator L, we can rewrite (2.17) as
p
X q
X
σn2 = α0 + αk Lk Xn2 + βk Lk σn2
k =1 k =1
= α0 + ϕ(L)Xn2 + ψ (L)σn2 , n ⩾ Max(p, q ),

where
q
X
ϕ(L) = α1 L + · · · + αq Lq = αk Lk
k =1
and
q
X
ψ ( L ) = β1 L + · · · + βq L q = βk Lk .
k =1
In particular, we have

E[Xn2 ] = E[σn2 Zn2 ]


= E[Zn2 ]E[σn2 ]
= E[σn2 ]
X p q
X
= α0 + αk E[Xn−k
2
]+ βk E[σn−k
2
], n ⩾ Max(p, q ).
k =1 k =1

Example: generating GARCH(2, 1) samples in

Consider the GARCH(2, 1) times series with variance process given by

σn2 = α0 + 0.2 × Xn−1


2
+ 0.4 × Xn−2
2
+ 0.3 × σn−1
2
, n ⩾ 2. (2.18)

40 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

library(fGarch)
garch.spec<-garchSpec(model=list(omega = 10E-6,alpha=c(0.2,0.4),beta = c(0.3)))
n=100; garch.sim<-garchSim(garch.spec,n); x=seq(1,n); dev.new(width=12, height=6)
plot(x,garch.sim,pch=19, ylab="", xlab="n", main = 'GARCH(2,1) Samples', col='blue',
cex.axis=1.5, cex.lab=1.7, las=1)
lines(x,garch.sim,col='blue');grid()

ARCH(2) Samples

0.010

0.005

0.000

−0.005

−0.010

0 20 40 60 80 100
n

Fig. 2.6: GARCH(2, 1) Samples.

Similarly to Proposition 2.3, we have the following result.


Proposition 2.9. The equations Xn = σn Zn and

σn2 := α0 + α1 Xn−1
2 2
+ β1 σn−1 , n ∈ Z,
define a GARCH(1, 1) process (Xn )n∈Z , and can be solved when α1 + β1 < 1
as
X n−1Y
σn2 = α0 α1 Zl2 + β1 , n ⩾ 1, (2.19)


k ⩽n l = k

with
X α0
E[σn2 ] = α0 (α1 + β1 )k = , n ⩾ 1. (2.20)
1 − α1 − β1
k⩾0

No such converging solution exists when α1 + β1 ⩾ 1.

2.3 Time Series Stationarity

Strict stationarity

Definition 2.10. A time series (Xn )n∈Z is strictly stationary if the equality

" 41

This version: June 9, 2023


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

d
(Xn , Xn−1 , . . . , Xn−p ) ≃ (Xn+m , Xn+m−1 , . . . , Xn+m−p ),

holds in distribution for all n ∈ Z and m, p ⩾ 0.


In other words, Definition 2.10 states that the random vectors

(Xn , Xn−1 , . . . , Xn−p ) and (Xn+m , Xn+m−1 , . . . , Xn+m−p )

have same distribution for all m ∈ Z and p ⩾ 1.

Example. The MA(q ) time series (Xn )n⩾0 is strictly stationary since

Xn+m = Zn+m + β1 Zn+m−1 + · · · + βq Zn+m−q


q
X
= Zn + m + βk Zn+m−k , n ⩾ q,
k =1

satisfies the equality


d
Xn+m ≃ Zn + β1 Zn−1 + · · · + βq Zn−q
Xq
= Zn + βk Zn−k
k =1
= Xn , n ⩾ q,

in distribution, as (Zn )n⩾0 is an i.i.d. sequence.

Weak stationarity

Definition 2.11. A time series (Xn )n⩾0 is weakly stationary if


i) E[Xn ] = E[X0 ], n ⩾ 0, and

ii) the autocovariance ∗

(n, m) 7−→ Cov(Xn , Xm )

depends only on the absolute difference |n − m|, n, m ⩾ 0.


The autocovariances Cov(Xn , Xn+l ) and cross-covariances Cov(Yn , Xn+l ) of
time series with lag parameter l ∈ Z can be respectively estimated as follows:


The covariance Cov(X, Y ) is defined as Cov(X, Y ) := E[XY ] − E[X ]E[Y ].

42 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

dev.new(width=12, height=6)
n=1000; ar.sim<-arima.sim(model=list(ar=c(.9,-.2)),n.start=100,n)
ar.acf<-acf(ar.sim,type="covariance",plot=T,col='blue',lwd=4)
dev.new(width=12, height=6)
ar.ccf<-ccf(ar.sim,ar.sim,type="covariance",plot=T,lwd=4,col='blue',main='',cex.axis=1.8,
cex.lab=1.5,las=1);grid()

2.0

1.5
ACF (cov)

1.0

0.5

0.0
−30 −20 −10 0 10 20 30
Lag
Fig. 2.7: Autocovariances of AR(2) Samples.

By representing an AR(q ) series as a vector-valued AR(1) series we can


obtain the following result, see e.g. Theorem 3.1.1 page 89 of Davis (1991)
and Theorem 4.4 page 119 of Pourahmadi (2001).
Theorem 2.12. Consider the AR(q ) time series (Xn )n⩾0 solution of

Xn := Zn + ϕ(L)Xn = Zn + α1 Xn−1 + · · · + αq Xn−q ,

with
ϕ(z ) = α1 z + · · · + αq z q , z ∈ C.
1) Unit root test. The AR(q ) time series (Xn )n⩾0 is weakly stationary if
and only if no (complex) solution of the equation ϕ(z ) = 1 lies on the
complex unit circle {z ∈ C : |z| = 1} in the complex plane C.∗
2) Causality. The AR(q ) time series is causal if and only if the equation
ϕ(z ) = 1 has no solution inside the complex unit disk {z ∈ C : |z| ⩽ 1}.
Examples.
i) In the AR(1) example

Xn := Zn + α1 Xn−1 = Zn + ϕ(L)Xn , n ⩾ 1,

with ϕ(z ) = α1 z, the unique solution z = 1/α1 of the equation ϕ(z ) =


α1 z = 1 lies on the complex unit circle if and only if α1 ̸= ±1, i.e.

See (MOE and UCLES 2016, page 15) and (MOE and UCLES 2020, page 20).

" 43

This version: June 9, 2023


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

|α1 | ̸= 1. Hence, by Theorem 2.12 the time series (Xn )n⩾2 is (weakly)
stationarity if and only if |α1 | ̸= 1.
In this case, by Proposition 2.3 we have the series representations
 X
Xn =

 α1k Zn−k , |α1 | < 1, (2.21a)

 k ⩾0
X 1
Xn = − Zn + k , |α1 | > 1, (2.21b)


αk

 1
k ⩾1

which converge when |α1 | ̸= 1, with


1
Var[Xn ] = E Xn2 = , n ⩾ 1,
 
|1 − |α1 |2 |

see (2.7) and (2.9).


a) In the case of (2.21a) with |α1 | < 1, the causal solution
X
Xn = α1k Zn−k , n ⩾ 0,
k⩾0

satisfies
 
X X
Cov(Xn , Xm ) = E  α1k Zn−k αl1 Zm−l 
k⩾0 l ⩾0
X
= α1n−m |α1 |2k
k⩾0
α1n−m
= , n ⩾ m ⩾ 0.
1 − |α1 |2

b) In the case of (2.21b) with |α2 | > 1, the non-causal solution


X 1
Xn = − Zn + k , n ⩾ 0,
αk
k⩾1 1

satisfies
 
X 1 X 1
Cov(Xn , Xm ) = E  Zn + k Zm + l 
αk
k⩾1 1
αl
l ⩾1 1

α1m−n
= , n ⩾ m ⩾ 0.
|α1 |2 − 1

44 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

We note that the expressions (2.6)-(2.7) in the case |α1 | < 1 correspond
to strictly stationary times series, while (2.8)-(2.9) in the case |α1 | > 1
correspond to weakly, but not strictly, stationary times series.
ii) In the AR(2) example

Xn := Zn + 0.9 × Xn−1 − 0.2 × Xn−2

of Figure 2.2 with ϕ(z ) = 0.9z − 0.2z 2 , the solutions


√ √
0.9 + 0.92 − 4 × 0.2 5 0.9 − 0.92 − 4 × 0.2
z+ = = , z− = =2
2 × 0.2 2 2 × 0.2
of the equation ϕ(z ) = 1 do not lie on the complex unit circle, hence by
Theorem 2.12 the time series (Xn )n⩾2 is (weakly) stationarity.
iii) Consider the AR(2) time series

Xn := Zn + Xn−1 − Xn−2 = Zn + ϕ(L)Xn , n ⩾ 2,

with ϕ(z ) = z − z2.


ℑ(z )

√ 1+ℑ 3
3/2 2

ℜ(z )

−1 −0.5 0.5 1

√ √
− 3/2 1−ℑ 3
2


The solutions z = (1 ± i 3)/2 of the equation ϕ(z ) = 1 lie on the unit
circle, hence by Theorem 2.12 the time series (Xn )n⩾2 is not (weakly)
stationarity. The next Figure 2.8 presents a simulation of non-stationary
time series according to the attached code.∗


Right-click to save as attachment (may not work on .

" 45

This version: June 9, 2023


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

10

200
5
100

0 0

−100
−5

−200

−10
0 10 20 30 40 50 0 5000 10000 15000 20000
n n

(a) 50 time steps. (b) 20000 time steps.

Fig. 2.8: Nonstationarity of AR(2) time series with a1 = 1 and a2 = −1.

Stationarity test

The Dickey-Fuller test allows us to test the null (nonstationarity) hypothesis


H0 , i.e. “|α1 | = 1”, against the alternative (stationarity) hypothesis “|α1 | ̸=
1”.
a) Under the null (nonstationarity) hypothesis H0 , i.e. |α1 | = 1, the test
statistic
Xn
Xt−1 Zt
t=1
t̂n := v
u n n
uX X
nt X2 t−1 (Xt − ρbk Xk−1 )2 /(n − k )
t=1 k =1
r1 r1
has the asymptotic distribution of 0 Bs dBs / 0 Bs2 ds, where (Bs )s∈[0,1]
is a standard Brownian motion, see § 17.4 of Hamilton (1989). This distri-
bution can be used to test the null hypothesis H0 , i.e. “|α1 | = 1”, against
the alternative stationarity hypothesis “|α1 | ̸= 1”.
b) Consider the residual
n
(Xt − α1 Xt−1 )2
X

t=1

representing the quadratic distance between (Xt )t=1,2,...,n and (α1 Xt−1 )t=1,2,...,n .
By Ordinary Linear Regression (OLS), the value of α1 that minimizes this
distance is given by
n
X
Xt−1 Xt
t=1
ρbn := n , n ⩾ 1,
X
2
Xt−1
t=1

46 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

which can be rewritten as


n
X n
X
Xt−1 (Zt + α1 Xt−1 ) Xt−1 Zt
t=1 t=1
ρbn = n = α1 + n .
X X
2 2
Xt−1 Xt−1
t=1 t=1

Under the alternative (stationarity) hypothesis |α1 | ̸= 1, by (2.7), (2.9)


and the Central Limit Theorem the renormalized test statistics
n
X
Xt−1 Zt
√ √
n(ρbn − α1 ) ≃ n t=1n
X
2
Xt−1
t=1
n
|1 − |α1 |2 | X
≃ √ Xt−1 Zt
n
t=1
n
r
|1 − |α1 |2 | X
≃ Zt
n
t=1

converges in distribution to N (0, 1 − |α1 |2 ) as n tends to infinity, see


Chapters 8 and 17 of Hamilton (1994).
The (Augmented) Dickey-Fuller stationarity test uses an additional lag pa-
rameter and is implemented in the ’tseries’ package, as follows:

install.packages('tseries')
library('tseries')
adf.test(ar.sim)
adf.test(arima.sim)

0.3 Most likely observation


Observed data point
Probability density

0.2

0.1

p value
0
−5 −4 −3 −2 −1 0 1 2 3 4 5 6 7 8 9 10 11
Possible results

Fig. 2.9: Hypothesis testing.

" 47

This version: June 9, 2023


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

The output of the adf.test command leads us to reject the nonstationarity


(null) hypothesis H0 at the level 1% for the AR(2) time series (2.10) of Fig-
ure 2.2:

Augmented Dickey-Fuller Test


data: ar.sim
Dickey-Fuller = -13.765, Lag order = 16, p-value = 0.01
alternative hypothesis: stationary
Warning message:
In adf.test(ar.sim) : p-value smaller than printed p-value

Applying the Augmented Dickey-Fuller Test to the ARIMA time series of Fig-
ure 2.4 would not allow us to reject the nonstationarity (null) hypothesis H0 .
Other stationarity tests for time series include the Kwiatkowski–Phillips–Schmidt–Shin
(KPSS) test.

2.4 Fitting Time Series to Financial Data

Market data can be fitted to an ARIMA(p, d, q ) model using the auto.arima


command in .

Fitting market returns

arima(data,order=c(p,d,q))

For an example based on market returns, we can use the following data set.

library(quantmod)
getSymbols("1800.HK",from="2013-01-01",to="2014-11-30",src="yahoo")
stock=Ad(`1800.HK`); stock=stock[!is.na(stock)];
stock.rtn=(stock-lag(stock))/lag(stock)[-1]; dev.new(width=12, height=6)
stock.rtn=stock.rtn[!is.na(stock.rtn)];
chartSeries(stock.rtn,up.col="blue",theme="white")
n = length(stock.rtn)

48 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

stock.rtn [2013−01−03/2014−11−28]
Last 0.0128866473351509

0.10

0.05

0.00

−0.05

Jan 03 Mar 01 May 02 Jul 02 Aug 01 Oct 02 Dec 02 Feb 04 Apr 01 Jun 03 Aug 01 Oct 03 Nov 28
2013 2013 2013 2013 2013 2013 2013 2014 2014 2014 2014 2014 2014

Fig. 2.10: Graph of stock returns.

library(forecast)
auto.arima(stock.rtn)

The output of the auto.arima command identifies these data to a white noise,
as ARIMA(0,0,0).

Series: stock.rtn
ARIMA(0,0,0) with zero mean
sigma2 estimated as 0.0003266: log likelihood=1219.37
AIC=-2436.74 AICc=-2436.73 BIC=-2432.58
We can also fit these data to an MA(3) time series using the command

arima(stock.rtn,order=c(0,0,3))

which yields the output:

Coefficients:
ma1 ma2 ma3
0.0029 0.0470 -0.0416
s.e. 0.0452 0.0467 0.0465

and AIC=-2430.19. Sample data from this time series can be generated (up
to rescaling) from

" 49

This version: June 9, 2023


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

n=length(stock.rtn);
arima.sim<-arima.sim(model=list(ma=c(0.0029, 0.0470,
-0.0416),order=c(0,0,3)),n.start=100,n)
x=seq(100,100+n-1); dates <- index(stock.rtn)
ma<-xts(x =arima.sim, order.by = dates)*sd(stock.rtn);
myPars <- chart_pars();myPars$cex<-1.4
myTheme <- chart_theme();myTheme$col$line.col <- "blue"
myTheme$rylab <- FALSE; dev.new(width=16,height=8)
par(mfrow=c(1,2));chart_Series(stock.rtn,theme=myTheme,pars=myPars)
graph <-chart_Series(ma,theme=myTheme,pars=myPars); myylim <- graph$get_ylim()
myylim[[2]] <- structure(c(min(stock.rtn),max(stock.rtn)), fixed=TRUE)
graph$set_ylim(myylim); graph

stock.rtn 2013−01−03 / 2014−11−28 ma 2013−01−03 / 2014−11−28

0.10 0.10

0.08 0.08

0.06 0.06

0.04 0.04

0.02 0.02

0.00 0.00

−0.02 −0.02

−0.04 −0.04

−0.06 −0.06

−0.08 −0.08

Jan 03 Apr 02 Jul 02 Oct 02 Jan 02 Apr 01 Jul 02 Oct 03 Jan 03 Apr 02 Jul 02 Oct 02 Jan 02 Apr 01 Jul 02 Oct 03
2013 2013 2013 2013 2014 2014 2014 2014 2013 2013 2013 2013 2014 2014 2014 2014

Fig. 2.11: ARIMA(0, 0, 3) samples.

Next, we fit these data to an ARMA(2,2) time series using the command

arima(stock.rtn,order=c(2,0,2))

with the following output:

Coefficients:
ar1 ar2 ma1 ma2
-1.0593 -0.9048 1.0509 0.9508
s.e. 0.0679 0.0444 0.0474 0.0273

and AIC=-2432.57. Sample data from this time series can be generated (up
to rescaling) from

50 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

n=length(stock.rtn);
arima.sim<-arima.sim(model=list(ar=c(-1.0593,-0.9048),ma=c(1.0509,0.9508),order=c(2,0,2)),
n.start=100,n)
x=seq(100,100+n-1); dates <- index(stock.rtn)
ar<-xts(x =arima.sim, order.by = dates)*sd(stock.rtn);
myPars <- chart_pars();myPars$cex<-1.4
myTheme <- chart_theme();myTheme$col$line.col <- "blue"
myTheme$rylab <- FALSE; dev.new(width=16,height=8); par(mfrow=c(1,2));
chart_Series(stock.rtn,theme=myTheme,pars=myPars)
graph <-chart_Series(ar,theme=myTheme,pars=myPars); myylim <- graph$get_ylim()
myylim[[2]] <- structure(c(min(stock.rtn),max(stock.rtn)), fixed=TRUE)
graph$set_ylim(myylim); graph

stock.rtn 2013−01−03 / 2014−11−28 ar 2013−01−03 / 2014−11−28

0.10 0.10

0.08 0.08

0.06 0.06

0.04 0.04

0.02 0.02

0.00 0.00

−0.02 −0.02

−0.04 −0.04

−0.06 −0.06

−0.08 −0.08

Jan 03 Apr 02 Jul 02 Oct 02 Jan 02 Apr 01 Jul 02 Oct 03 Jan 03 Apr 02 Jul 02 Oct 02 Jan 02 Apr 01 Jul 02 Oct 03
2013 2013 2013 2013 2014 2014 2014 2014 2013 2013 2013 2013 2014 2014 2014 2014

Fig. 2.12: ARIMA(2, 0, 2) samples.

These data can also be fit to a GARCH(1,1) time series using the following
command.

library(fGarch)
garchFit(~ garch(1,1), data = stock.rtn, trace = FALSE)

with the following output.


Coefficients:
mu omega alpha1 beta1
-1.593e-04 9.124e-06 4.522e-02 9.308e-01

Sample data from this time series can be generated (up to rescaling) from

" 51

This version: June 9, 2023


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

n=length(stock.rtn);
garch.spec<-garchSpec(model=list(omega = 9.124e-06, alpha=c(4.522e-02),beta =
c(9.308e-01)))
garch.sim<-garchSim(garch.spec,n);
x=seq(100,100+n-1); dates <- index(stock.rtn)
garch<-xts(x =garch.sim, order.by = dates)
myPars <- chart_pars(); myPars$cex<-1.4
myTheme <- chart_theme();myTheme$col$line.col <- "blue"
myTheme$rylab <- FALSE; dev.new(width=16,height=8)
par(mfrow=c(1,2));chart_Series(stock.rtn,theme=myTheme,pars=myPars)
graph <-chart_Series(garch,theme=myTheme,pars=myPars); myylim <- graph$get_ylim()
myylim[[2]] <- structure(c(min(stock.rtn),max(stock.rtn)), fixed=TRUE)
graph$set_ylim(myylim); graph

stock.rtn 2013−01−03 / 2014−11−28 garch 2013−01−03 / 2014−11−28

0.10 0.10

0.08 0.08

0.06 0.06

0.04 0.04

0.02 0.02

0.00 0.00

−0.02 −0.02

−0.04 −0.04

−0.06 −0.06

−0.08 −0.08

Jan 03 Apr 02 Jul 02 Oct 02 Jan 02 Apr 01 Jul 02 Oct 03 Jan 03 Apr 02 Jul 02 Oct 02 Jan 02 Apr 01 Jul 02 Oct 03
2013 2013 2013 2013 2014 2014 2014 2014 2013 2013 2013 2013 2014 2014 2014 2014

Fig. 2.13: GARCH samples.

Fitting market prices

Next, we fit market price data to an ARIMA time series.

library(quantmod)
getSymbols("1800.HK",from="2007-01-03",to="2011-12-02",src="yahoo")
stock=Ad(`1800.HK`)
chartSeries(stock,up.col="blue",theme="white")
n = length(stock)
arima(stock,order=c(2,1,2))

52 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

stock [2007−01−03/2011−12−02]
Last 5.565

20

15

10

Jan 03 Jan 02 Jan 01 Jan 01 Jan 03 Dec 02


2007 2008 2009 2010 2011 2011

Fig. 2.14: Cumulative stock returns.

The output of the auto.arima(stock) command identifies these data to an


ARIMA(2,1,0) time series of integrated order one.

Series: stock
ARIMA(2,1,0)
Coefficients: ar1 ar2 0.0605 -0.0006 s.e. 0.0288 0.0288
sigma2 = 0.05082: log likelihood = 84.47
AIC=-162.94 AICc=-162.92 BIC=-147.63

We may also fit these data to an ARIMA(2,1,2) time series using the com-
mand arima(stock,order=c(2,1,2)).
Coefficients:
ar1 ar2 ma1 ma2
-0.3073 -0.9626 0.3452 0.9783
s.e. 0.0137 0.0178 0.0092 0.0155
sigma2 estimated as 0.04987: log likelihood = 94.49, aic = -178.98

n=length(stock)-1
arima.sim<-arima.sim(model=list(ar=c(-0.3133,-0.9464),ma=c(0.3535,0.9637),order=c(2,1,2)),
n.start=100,n)
x=seq(100,100+n)
dates <- index(stock); ar<-xts(x =arima.sim, order.by = dates)
myPars <- chart_pars();myPars$cex<-1.4
myTheme <- chart_theme();myTheme$col$line.col <- "blue"
myTheme$rylab <- FALSE; dev.new(width=16,height=8)
par(mfrow=c(1,2));chart_Series(stock,theme=myTheme,pars=myPars)
chart_Series(as.vector(stock[1])+ar,theme=myTheme,pars=myPars)

" 53

This version: June 9, 2023


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

stock 2007−01−03 / 2011−12−01 as.vector(stock[1]) + ar 2007−01−03 / 2011−12−01

15
15
14

13 10
12
5
11

10 0

9
−5
8

7 −10

6 −15
5
−20
4

3 −25
2007 2008 2009 2010 2011 2007 2008 2009 2010 2011

Jan 03 Jan 02 Jan 02 Jan 04 Jan 03 Dec 01 Jan 03 Jan 02 Jan 02 Jan 04 Jan 03 Dec 01
2007 2008 2009 2010 2011 2011 2007 2008 2009 2010 2011 2011

Fig. 2.15: ARIMA(2, 1, 2) Samples.

2.5 Application: Pair Trading

Pair trading data

We consider two assets that can be traded in pairs.

install.packages("quantmod");library(quantmod)
symbols = c("1800.HK","KO","PEP");symbols = c("1800.HK","MSFT","AAPL")
getSymbols(symbols, from=Sys.Date()-365, to=Sys.Date());ClosePrices <- lapply(symbols,
function(x) Ad(get(x)))
getSymbols(symbols, from="2017-01-01", to="2018-01-01");ClosePrices <- lapply(symbols,
function(x) Ad(get(x)))
stock<-do.call(merge, ClosePrices);stock.price<-stock[rowSums(is.na(stock[ , 1:3])) == 0, ];
price.pair <- stock.price[,2:3]["2017-02-01::"]
chartSeries(stock.price[,2],up.col="blue",theme="white",name = symbols[2])
chartSeries(stock.price[,3],up.col="blue",theme="white",name = symbols[3])
myPars <- chart_pars();myPars$cex<-1.4;myTheme <- chart_theme();
myTheme$col$line.col<-"blue"
dev.new(width=16,height=8);par(mfrow=c(1,3))
chart_Series(stock.price[,2],theme=myTheme,name = symbols[2],pars=myPars)
chart_Series(stock.price[,3],theme=myTheme,name = symbols[3],pars=myPars)
add_TA(stock.price[,2], col='purple', lw =2, on = 1)


The animation works in Acrobat Reader on the entire pdf file.

54 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

stock.price stock.price
[2017−01−03/2017−12−20] [2017−01−03/2017−12−20]
2 Last 85.519997
3 Last 174.350006

85
170

80 160

150
75

140

70

130

65

120

60
Jan 03 Mar 01 May 02 Jul 03 Sep 01 Nov 01 Dec 20 Jan 03 Mar 01 May 02 Jul 03 Sep 01 Nov 01 Dec 20
2017 2017 2017 2017 2017 2017 2017 2017 2017 2017 2017 2017 2017 2017

(a) MSFT graph. (b) AAPL graph.

Fig. 2.16: MSFT vs APPL graphs.

Linear regression

As the two assets may evolve within different price ranges, we use a linear
regression to put them both on the scale of the second asset.
AAPL 2017−01−03 / 2017−12−29 85
80 80

75 75

70 70

65 65

60 60

55 55

50

45

40

35

30
Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec

Jan 03 Feb 01 Mar 01 Apr 03 May 02 Jun 01 Jul 03 Aug 01 Sep 01 Oct 03 Nov 01 Dec 01 Dec 29
2017 2017 2017 2017 2017 2017 2017 2017 2017 2017 2017 2017 2017

Fig. 2.17: Comparison graph before linear regression.

Letting
(1) (1) (2) (2)
rt := log(St ) and rt := log(St ), t ⩾ 1,
by an Ordinary Least Square (OLS) regression using the command lm
(linear model), we derive a linear relationship of the form
(2) (1)
rt = a + brt + Xt , t ⩾ 1, (2.22)
(1)  (2) 
between rk k⩾1 and rk k⩾1 , where Xk is a random remainder term, by
minimization of the quadratic residual distance
n
(2) ( 1 ) 2
X
rt − a − brt (2.23)
t=1

" 55

This version: June 9, 2023


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

(2)  (1) 
between rt t=1,2,...,n
and a + brt t=1,2,...,n
, i.e.
 n
1 X (2) b (1) 
a= rk − brk ,


 b

 n
k =1






 and





n n n n n
1 X (1) (2)
! !
 X (1) (2) X (1) 1 X (1) (2) 1 X (2)

 rk rk − r k r̃l rk − rl rk − r̃l
n

 n n
 bb = k=1 k,l=1

k =1 l =1 l =1
.


n n = 2
1 X (1) (1) n n
 !
1 X (1)

(1) 2
 X
( ) − (1)
X
r r r

r − r

 k n k l k k
n


k =1 k,l=1 k =1 k =1

cf. Exercise 2.6. The coefficient a in (2.22) is called the premium, and b is
called the hedge ratio.

reg <- lm(log(price.pair[,2]) ~ log(price.pair[,1]))


hedge.ratio <- as.numeric(reg$coef[2]);premium <- as.numeric(reg$coef[1])
myPars <- chart_pars();myPars$cex<-1.4
myTheme <- chart_theme();myTheme$col$line.col <- "blue"; dev.new(width=16,height=8)
chart_Series(price.pair[,2],name="",theme=myTheme,pars=myPars)
add_TA(exp(premium+hedge.ratio*log(price.pair[,1])), col='purple', lw =2,on = 1)

2017−02−01 / 2017−12−29
42 42

41 41

40 40

39 39

38 38

37 37

36 36

35 35

34 34

33 33

32 32

31 31
Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec

Feb 01 Mar 01 Apr 03 May 02 Jun 01 Jul 03 Aug 01 Sep 01 Oct 03 Nov 01 Dec 01 Dec 29
2017 2017 2017 2017 2017 2017 2017 2017 2017 2017 2017 2017

Fig. 2.18: Comparison graph after linear regression.

This allows us to define the spread (Xt )t⩾1 via the linear relationship
(2) (1)
Xt := log(St ) − (premium + hedge.ratio × log(St )), t ⩾ 0.

56 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

spread <- log(price.pair[,2]) - ( hedge.ratio * log(price.pair[,1]) + premium )


list(spread = spread, hedge.ratio = hedge.ratio, premium = premium)
dev.new(width=16,height=7)
plot(spread,col='blue', main = "Spread",cex.axis=1.3)

Spread 2017−02−01 / 2017−12−29

0.06 0.06

0.04 0.04

0.02 0.02

0.00 0.00

−0.02 −0.02

−0.04 −0.04

−0.06 −0.06

Feb 01 Mar 01 Apr 03 May 02 Jun 01 Jul 03 Aug 01 Sep 01 Oct 03 Nov 01 Dec 01 Dec 29
2017 2017 2017 2017 2017 2017 2017 2017 2017 2017 2017 2017

Fig. 2.19: Spread graph.

Next, we model the spread Xt using an AR(1) time series and check for its sta-
(1)  (2) 
tionarity, in which case the log-price processes log St t⩾0 and log St t⩾0
are said to be cointegrated.

This will be interpreted as the existence of a statistically significant con-


(1)  (2) 
nection between St t⩾0 and St t⩾0 , also named cointegration. See Engle
and Granger (1987) and Chapter 6 of Enders (2009) for more information on
cointegration.

Dickey-Fuller test

Consider an AR(1) time series (Xn )n⩾0 given by

Xn := Zn + α1 Xn−1 .

The Dickey-Fuller test allows us to test the null hypothesis H0 , i.e. “|α1 | = 1”,
against the alternative stationarity hypothesis “|α1 | ̸= 1”.

install.packages('tseries')
library('tseries')
adf.test(spread)

Its output leads us to reject the nonstationarity (null) hypothesis H0 at the


level 1%:

" 57

This version: June 9, 2023


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

Augmented Dickey-Fuller Test


data: spread
Dickey-Fuller = -2.8771, Lag order = 6, p-value = 0.2077
alternative hypothesis: stationary

We reject the (nonstationarity) null hypothesis H0 at the confidence level 5%


when the p-value is lower than 0.05. The Phillips-Perron test is another unit
root test.

Pair trading

The trading signal is {−1, 1}-valued and determined by the alternating cross-
ing times of a threshold level by the spread.
signal<-spread;threshold <- 0.02
signal[1] = -sign(as.numeric(spread[1]));i=1
while (i<length(spread)){i=i+1;
while (i<length(spread) &&
sign(as.numeric(spread[i+1])-threshold)==sign(as.numeric(spread[i])-threshold))
{signal[i]=sign(threshold-as.numeric(spread[i-1]));i=i+1;print(i);}
signal[i]=sign(threshold-as.numeric(spread[i-1]));threshold=-threshold;print(i);}
signal[i]=sign(threshold-as.numeric(spread[i-1]));threshold <- abs(threshold)
ratio1=range(spread)[1]/threshold;ratio2=range(spread)[2]/threshold
tblue <- rgb(0, 0, 1, alpha=0.8);tred <- rgb(1, 0, 0, alpha=0.5)
dev.new(width=16,height=7)
barplot(spread,col = tblue,lwd = 3, main = "",cex.axis=1.4,cex=1.6,las=1);par(new=TRUE);
barplot(signal,offset=(range(spread)[1]+range(spread)[2])/threshold,ylim=c(ratio2,ratio1),
xpd = FALSE, col=tred,space = 0, border
="blue",xaxt="n",yaxt="n",xlab="",ylab="")

0.06

0.04

0.02

0.00

−0.02

−0.04

−0.06

2017−02−01 2017−03−14 2017−04−26 2017−06−09 2017−07−20 2017−08−29 2017−10−11 2017−11−20

Fig. 2.20: Pair trading signals.

Backtesting

The performance of the pair trading algorithm can be estimated by the fol-
lowing code.
58 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

return.pairtrading=(lag(signal)*(price.pair[,2]-lag(price.pair[,2]))-lag(signal)*hedge.ratio
*(price.pair[,1]-lag(price.pair[,1])))/(hedge.ratio*lag(price.pair[,1])+lag(price.pair[,2]))
return.pairtrading<-return.pairtrading[2:length(return.pairtrading)]
dev.new(width=16,height=7);par(mfrow=c(1,2))
plot(return.pairtrading,col='blue', main = "Returns",cex.axis=1,cex=1,las=1)
plot(100 * cumprod(1 + return.pairtrading),col='blue',main =
"Performance",cex.axis=1,cex=1,las=1)

The return of the portfolio is defined as


(2) (2) (2) (1) (1) (1)
ξt (St − St−1 ) + ξt (St − St−1 )
Rt := (2) (2) (1) (1)
,
ξt St−1 + ξt St−1

where
1

(2)
 ξt := signalt−1 × 1 + hedge.ratio ,


hedge.ratio
 ξt(1) := (−signalt−1 ) ×

.


1 + hedge.ratio

Performance 2017−02−02 / 2017−12−29

112 112

110 110

108 108

106 106

104 104

102 102

Feb 02 Mar 01 Apr 03 May 02 Jun 01 Jul 03 Aug 01 Sep 01 Oct 03 Nov 01 Dec 01 Dec 29
2017 2017 2017 2017 2017 2017 2017 2017 2017 2017 2017 2017

Fig. 2.21: Pair trading returns.

The pair trading compounded portfolio return


n
Y
(1 + Rt ), n ⩾ 1, (2.24)
t=1

is plotted in Figure 2.22.

" 59

This version: June 9, 2023


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

Performance 2017−02−02 / 2017−12−29

112 112

110 110

108 108

106 106

104 104

102 102

Feb 02 Mar 01 Apr 03 May 02 Jun 01 Jul 03 Aug 01 Sep 01 Oct 03 Nov 01 Dec 01 Dec 29
2017 2017 2017 2017 2017 2017 2017 2017 2017 2017 2017 2017

Fig. 2.22: Pair trading performance.

The portfolio strategy used as benchmark is built by investing a same amount


in Stock 1 and Stock 2, and its return from time 0 to time n, given by
(1) (2)
hedge.ratio Sn 1 Sn
Bn : = , + , ,
1 + hedge.ratio S (1) 1 + hedge.ratio S (2)
0 0

is compared to the pair trading compounded portfolio return (2.24), see Fig-
ure 2.23 for another example of pair trading backtesting.∗

> source("pairtrading.R")
Examples of pairs: 005930.KS vs AAPL, 2600.HK vs 1919.HK
Enter Stock 1 (Ex: GOOG):2600.HK
Enter Stock 2 (Ex: AAPL):1919.HK

Augmented Dickey-Fuller Test


data: spread
Dickey-Fuller = -3.4553, Lag order = 8, p-value = 0.0466
alternative hypothesis: stationary


Download the corresponding code.

60 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

350
Pair trading

0.2

300

0.1

250

Performance
Spread

0.0

200

−0.1

150

−0.2

100

−0.3
2017 2018 2019 2020 2017 2018 2019 2020

Fig. 2.23: Pair trading performance.

See also the PairTrading package in Takayanagi and Ishikawa (2017).

Exercises

Exercise 2.1 Consider the MA(1) time series (Xn )n⩾1 defined as

Xn := Zn + aZn−1 , n ⩾ 1,

where (Zn )n⩾0 is a white noise sequence and a ∈ R.


a) Compute the autocovariance function

ρ(k ) = Cov(Xn , Xn+k )

for all k ∈ Z = {. . . , −3, −2, −1, 0, 1, 2, 3, . . .}, and plot it on the graph
below when a = 2.

b) Is the time series (Xn )n⩾1 weakly stationary? Strictly stationary?

Exercise 2.2 Let (Zn )n⩾1 denote a discrete-time white noise.


a) Check the (weak) stationarity of the AR(1) time series (Xn )n⩾1 given by

Xn = Zn + Xn−1 , n ⩾ 1.
" 61

This version: June 9, 2023


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

b) Check the (weak) stationarity of the AR(2) time series (Yn )n⩾1 given by
3 1
Yn = Zn + × Yn−1 − × Yn−2 , n ⩾ 2.
4 8
Hint: Consider the roots of φ(z ) = 1 where φ(z ) is the polynomial defined
by Xn = Zn + φ(L)Xn and L is the lag operator LXn = Xn−1 .

Exercise 2.3 Let α ∈ R. Consider an i.i.d. white noise sequence (Zn )n⩾0
with mean E[Zn ] = 0 and variance Var[Zn ] = 1, n ⩾ 1, and the AR(1) time
series (Xn )n⩾0 given by X0 := 0 and

Xn := Zn + αXn−1 , n ⩾ 1. (2.25)

a) Find a recurrence relation for the mean E[Xn ] in the parameter n ⩾ 0,


and deduce the value of E[Xn ] for all n ⩾ 0.
b) For fixed n ⩾ 1, find a recurrence relation in the parameter k ⩾ 0 for the
covariance

Cov(Xn+k , Xn ) = E[Xn+k Xn ] − E[Xn+k ]E[Xn ], k ⩾ 0.

c) Find a recurrence relation in the parameter n ⩾ 1 for the variance

Var[Xn ] = E[Xn2 ] − (E[Xn ])2 = E[Xn2 ], n ⩾ 0.

d) When is the time series (Xn )n⩾0 weakly stationary?

Exercise 2.4 Consider an i.i.d. white noise sequence (Zn )n⩾0 with mean
E[Zn ] = 0 and variance Var[Zn ] = 1, n ⩾ 1, and the AR(3) time series
(Xn )n⩾3 given by

Xn := Zn−1 − Zn−2 + αZn−3 , n ⩾ 3.

a) Find the autocovariances

Cov(Xn , Xn ) = Var[Xn ],







Cov(Xn+1 , Xn ),


Cov(Xn+2 , Xn ),









Cov(Xn+k , Xn ), k ⩾ 3.

b) Show that (Xn )n⩾3 has same distribution as an MA(q ) time series (Yn )n⩾3
of the form

62 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

q
X
Yn = Zn + βk Zn−k ,
k =1

whose order q and coefficients (βk )1⩽k⩽q will be determined.

Exercise 2.5 Consider an AR(1) time series (Xn )n⩾0 given by X0 = 0 and

Xn := Zn + α1 Xn−1 , n ⩾ 1,

and the difference operator

∇Xn := Xn − Xn−1 , n ⩾ 1,

also written ∇ = I − L, which can be integrated by the telescoping identity


n
X n
X
Xn = X0 + (Xk − Xk−1 ) = ∇Xk , n ⩾ 1.
k =1 k =1

a) Show that the first-order difference process (∇Xn )n⩾1 = (Xn − Xn−1 )n⩾1 .
forms an ARMA(1, 2) time series.
b) Show that the second-order difference process

(∇2 Xn )n⩾2 = (∇Xn − ∇Xn−1 )n⩾2

forms an ARMA(1, 3) time series.

(1)  (2) 
Exercise 2.6 Consider two sequences rk k⩾1 and rk k⩾1 of market
returns. We aim at deriving a linear relationship of the form
(2) (1)
rk = a + brk + Xk , k ∈ N,

(1)  (2) 
between rk k⩾1 and rk k⩾1 , where Xk is a random remainder term, by
minimization of the quadratic residual distance
n
(2) ( 1 ) 2
X
rk − a − brk (2.26)
k =1

(2)  (1) 
between rk k =1,2,...,n
and a + brk k =1,2,...,n
.

a) Compute the partial derivatives of (2.26) with respect to the parameters


a and b.
b) By equating the derivatives to zero, find the least square estimates b
a and bb
(1)  (2) 
of the parameters a and b based on the sequences rk k⩾1 and rk k⩾1 .

" 63

This version: June 9, 2023


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

Exercise 2.7 Consider the following ADF test output on a time series:

Augmented Dickey-Fuller Test


data: series
Dickey-Fuller = -2.8771, Lag order = 6, p-value = 0.02377
alternative hypothesis: stationary
Does this test result allow us to reject the nonstationarity (null) hypothesis
H0 at a 5% confidence level?

Exercise 2.8 Let (Zn )n∈Z denote a white noise sequence with zero mean
and variance σ 2 , and consider the AR(2) time series (Xn )n∈Z given by

Xn = Zn + α1 Xn−1 + α2 Xn−2 , n ∈ Z.

a) Assume that α1 := a and α2 := 2a2 for some a ⩾ 0. For which values of


the parameter a is the time series (Xn )n∈Z stationary?
Hint: Consider the solutions of the equation φ(z ) = 1, where φ(z ) is the
polynomial defined by Xn = Zn + φ(L)Xn and L is the lag operator
defined by LXn = Xn−1 .
In the sequel, we assume that the time series (Xn )n∈Z is stationary.
b) Show that E[Xn ] = 0, n ∈ Z, if α1 + α2 ̸= 1.
c) We assume that (Xn )n∈Z is causal, i.e. for any n ∈ Z, Xn depends only
on (Zk )k<n . Show that Cov(Xn , Zn ) = σ 2 for all n ∈ Z.
d) Taking α1 := 1/4 and α2 := 1/2, compute the autocovariance Cov(Xn+1 , Xn )
given that Cov(Xn , Xn ) = 16, n ∈ Z.

64 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Chapter 3
Processes with Jumps

In this chapter, we present the construction of stochastic processes used for


the modeling of insurance risk, such as processes with jumps and independent
increments, including the Poisson and compound Poisson processes. We also
cover some basic topics in risk theory such as the construction of claim and
reserve processes, and the computation of ruin probabilities in the Cramér-
Lundberg model.

3.1 The Poisson Process . . . . . . . . . . . . . . . . . . . . . . . . . . . 65


3.2 Compound Poisson Process . . . . . . . . . . . . . . . . . . . . . 74
3.3 Claim and Reserve Processes . . . . . . . . . . . . . . . . . . . 79
3.4 Ruin Probabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87

3.1 The Poisson Process


The most elementary and useful jump process is
the standard Poisson process (Nt )t∈R+ which is a
counting process, i.e. (Nt )t∈R+ has jumps of size
+1 only and its paths are constant in between two
jumps, with N0 := 0.

" 65

This version: June 9, 2023


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

The counting process (Nt )t∈R+ that can be used to model discrete arrival
times such as claim dates in insurance, or connection logs.

Nt
6
5
4
3
2
1
0
T1 T2 T3 T4 T5 T6 t

Fig. 3.1: Sample path of a counting process (Nt )t∈R+ .

The value of Nt at time t can be written as

1[Tk ,∞) (t),


X
Nt = t ⩾ 0, (3.1)
k ⩾1

where
 1 if t ⩾ Tk ,

1[Tk ,∞) (t) =


0 if 0 ⩽ t < Tk ,

k ⩾ 1, and (Tk )k⩾1 is the increasing family of jump times of (Nt )t∈R+ such
that
lim Tk = +∞.
k→∞

In order for the counting process (Nt )t∈R+ to be a Poisson process, it has to
satisfy the following conditions:
1. Independence of increments: for all 0 ⩽ t0 < t1 < · · · < tn and n ⩾ 1 the
increments
Nt1 − Nt0 , . . . , Ntn − Ntn−1 ,
are mutually independent random variables.
2. Stationarity of increments: Nt+h − Ns+h has the same distribution as
Nt − Ns for all h > 0 and 0 ⩽ s ⩽ t.
The meaning of the above stationarity condition is that for all fixed k ⩾ 0
we have
P ( Nt + h − Ns + h = k ) = P ( Nt − Ns = k ) ,
for all h > 0, i.e., the value of the probability

P ( Nt + h − Ns + h = k )

does not depend on h > 0, for all fixed 0 ⩽ s ⩽ t and k ⩾ 0.

66 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

Based on the above assumption, given T > 0 a time value, a natural question
arises:
what is the probability distribution of the random variable NT ?
We already know that Nt takes values in N and therefore it has a discrete
distribution for all t ∈ R+ .
It is a remarkable fact that the distribution of the increments of (Nt )t∈R+ ,
can be completely determined from the above conditions, as shown in the
following theorem.
As seen in the next result, cf. Theorem 4.1 in Bosq and Nguyen (1996),
the Poisson increment Nt − Ns has the Poisson distribution with parameter
(t − s)λ.
Theorem 3.1. Assume that the counting process (Nt )t∈R+ satisfies the above
independence and stationarity Conditions 1 and 2 on page 66. Then, for all
fixed 0 ⩽ s ⩽ t the increment Nt − Ns follows the Poisson distribution with
parameter (t − s)λ, i.e. we have

((t − s)λ)k
P(Nt − Ns = k ) = e−(t−s)λ , k ⩾ 0, (3.2)
k!

for some constant λ > 0.


The parameter λ > 0 is called the intensity of the Poisson process (Nt )t∈R+
and it is given by
1
λ := lim P(Nh = 1). (3.3)
h→0 h
The proof of the above Theorem 3.1 is technical and not included here, cf. e.g.
Bosq and Nguyen (1996) for details, and we could in fact take this distribution
property (3.2) as one of the hypotheses that define the Poisson process.
Precisely, we could restate the definition of the standard Poisson process
(Nt )t∈R+ with intensity λ > 0 as being a stochastic process defined by (3.1),
which is assumed to have independent increments distributed according to
the Poisson distribution, in the sense that for all 0 ⩽ t0 ⩽ t1 < · · · < tn ,

(Nt1 − Nt0 , . . . , Ntn − Ntn−1 )

is a vector of independent Poisson random variables with respective param-


eters
((t1 − t0 )λ, . . . , (tn − tn−1 )λ).
In particular, Nt has the Poisson distribution with parameter λt, i.e.,

(λt)k −λt
P ( Nt = k ) = e , t > 0.
k!
" 67

This version: June 9, 2023


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

The expected value E[Nt ] and the variance of Nt can be computed as

E[Nt ] = Var[Nt ] = λt, (3.4)

see Exercise A.1. As a consequence, the dispersion index of the Poisson


process is
Var[Nt ]
= 1, t ⩾ 0. (3.5)
E [ Nt ]

Short time behaviour

From (3.3) above we deduce the short time asymptotics∗

 P(Nh = 0) = e−λh = 1 − λh + o(h), h → 0,


P(Nh = 1) = λhe−λh ≃ λh, h → 0.


By stationarity of the Poisson process we also find more generally that


−λh

 P(Nt+h − Nt = 0) = e


= 1 − λh + o(h), h → 0,



P(Nt+h − Nt = 1) = λhe−λh ≃ λh, h → 0,

(3.6)


2

 λ
P(Nt+h − Nt = 2) ≃ h2 = o(h), h → 0, t > 0,


2

for all t > 0. This means that within a “short” time interval [t, t + h] of length
h, the increment Nt+h − Nt behaves like a Bernoulli random variable with
parameter λh. This fact can be used for the random simulation of Poisson
process paths.
The next code and Figure 3.2 present a simulation of the standard Poisson
process (Nt )t∈R+ according to its short time behavior (3.6).

lambda = 0.6;T=10;N=1000*lambda;dt=T*1.0/N
t=0;s=c();for (k in 1:N) {if (runif(1)<lambda*dt) {s=c(s,t)};t=t+dt}
dev.new(width=T, height=5)
plot(stepfun(s,cumsum(c(0,rep(1,length(s))))),xlim
=c(0,T),xlab="t",ylab=expression('N'[t]),pch=1, cex=0.8, col='blue', lwd=2,
main="", cex.axis=1.2, cex.lab=1.4,xaxs='i'); grid()


The notation f (h) = o(hk ) means limh→0 f (h)/hk = 0, and f (h) ≃ hk means
limh→0 f (h)/hk = 1.

68 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

5
4
3
Nt
2
1
0

0 2 4 6 8 10

t
Fig. 3.2: Sample path of the Poisson process (Nt )t∈R+ .

More generally, for k ⩾ 1 we have

λk
P(Nt+h − Nt = k ) ≃ hk , h → 0, t > 0.
k!
The intensity of the Poisson process can in fact be made time-dependent (e.g.
by a time change), in which case we have

 r t λ(u)du k
 
 w
t s
P(Nt − Ns = k ) = exp − λ(u)du , k = 0, 1, 2, . . . .
s k!

Assuming that λ(t) is a continuous function of time t we have in particular,


as h tends to zero,

P(Nt+h − Nt = k )
  r 
t+h
 exp − t

 λ(u)du = 1 − λ(t)h + o(h), k = 0,



= exp − r t+h λ(u)du r t+h λ(u)du = λ(t)h + o(h),
  
 t t k = 1,




o(h), k ⩾ 2.

The intensity process (λ(t))t∈R+ can also be made random, as in the case of
Cox processes.

Poisson process jump times

In order to determine the distribution of the first jump time T1 we note that
we have the equivalence

" 69

This version: June 9, 2023


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

{T1 > t} ⇐⇒ {Nt = 0},

which implies

P(T1 > t) = P(Nt = 0) = e−λt , t ⩾ 0,

i.e., T1 has an exponential distribution with parameter λ > 0.


In order to prove the next proposition we note that more generally, we
have the equivalence

{Tn > t} ⇐⇒ {Nt ⩽ n − 1},

for all n ⩾ 1. This allows us to compute the distribution of the random


jump time Tn with its probability density function. It coincides with the
gamma distribution with integer parameter n ⩾ 1, also known as the Erlang
distribution in queueing theory.
Proposition 3.2. For all n ⩾ 1 the probability distribution of Tn has the
gamma probability density function

tn−1
t 7−→ λn e−λt
(n − 1) !
with shape parameter n and scaling parameter λ on R+ , i.e., for all t > 0
the probability P(Tn ⩾ t) is given by
w∞ sn−1
P(Tn ⩾ t) = λn e−λs ds.
t (n − 1) !

Proof. We have

P(T1 > t) = P(Nt = 0) = e−λt , t ⩾ 0,


and by induction, assuming that
w∞ (λs)n−2
P(Tn−1 > t) = λ e−λs ds, n ⩾ 2,
t (n − 2) !
we obtain

P(Tn > t) = P(Tn > t ⩾ Tn−1 ) + P(Tn−1 > t)


= P(Nt = n − 1) + P(Tn−1 > t)
(λt)n−1 w∞ (λs)n−2
= e−λt +λ e−λs ds
(n − 1) ! t (n − 2) !

70 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

w∞ (λs)n−1
=λ e−λs ds, t ⩾ 0,
t (n − 1) !
where we applied an integration by parts to derive the last line. □
In particular, for all n ∈ Z and t ∈ R+ , we have

(λt)n
P(Nt = n) = pn (t) = e−λt ,
n!
i.e., pn−1 : R+ → R+ , n ⩾ 1, is the probability density function of the
random jump time Tn .
In addition to Proposition 3.2 we could show the following proposition which
relies on the strong Markov property, see e.g. Theorem 6.5.4 of Norris (1998).

Proposition 3.3. The (random) interjump times

τk := Tk+1 − Tk

spent at state k ⩾ 0, with T0 = 0, form a sequence of independent iden-


tically distributed random variables having the exponential distribution with
parameter λ > 0, i.e.,

P(τ0 > t0 , . . . , τn > tn ) = e−(t0 +t1 +···+tn )λ , t0 , t1 , . . . , tn ⩾ 0.

As the expectation of the exponentially distributed random variable τk with


parameter λ > 0 is given by
w∞ 1
E[τk ] = λ xe−λx dx = ,
0 λ
we can check that the nth jump time Tn = τ0 + · · · + τn−1 has the mean
n
E[Tn ] = , n ⩾ 1.
λ
Consequently, the higher the intensity λ > 0 is (i.e., the higher the probability
of having a jump within a small interval), the smaller the time spent in each
state k ⩾ 0 is on average.
As a consequence of Proposition 3.2, random samples of Poisson process
jump times can be generated from Poisson jump times using the following
code according to Proposition 3.3.

" 71

This version: June 9, 2023


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

lambda = 0.6;n = 200*lambda;T=10;Z<-cumsum(c(0,rep(1,n))); tau_n <-


rexp(n,rate=lambda); Tn <- cumsum(tau_n)
dev.new(width=T, height=5)
plot(stepfun(Tn,Z),xlim =c(0,T),ylim=c(0,8),xlab="t",ylab=expression('N'[t]),pch=1,
cex=1, col="blue", lwd=2, main="", las = 1, cex.axis=1.2,
cex.lab=1.4,xaxs='i',yaxs='i'); grid(,8)

6
Nt

0
0 2 4 6 8 10

Fig. 3.3: Sample path of the Poisson process (Nt )t∈R+ .

In addition, conditionally to {NT = n}, the n jump times on [0, T ] of the


Poisson process (Nt )t∈R+ are independent uniformly distributed random vari-
ables on [0, T ]n , cf. e.g. 11.1 in Privault (2018). This fact can also be useful
for the random simulation of Poisson process paths.

lambda = 0.6;T=10;n = rpois(1,lambda*T);Tn <- sort(runif(n,0,T));


Z<-cumsum(c(0,rep(1,n))); dev.new(width=T, height=5)
plot(stepfun(Tn,Z),xlim =c(0,T),ylim=c(0,8),xlab="t",ylab=expression('N'[t]),pch=1,
cex=1, col="blue", lwd=2, main="", las = 1, cex.axis=1.2,
cex.lab=1.4,xaxs='i',tick.ratio = 0.5); grid()

Compensated Poisson martingale

From (3.4) above we deduce that

E[Nt − λt] = 0, (3.7)

i.e., the compensated Poisson process (Nt − λt)t∈R+ has centered increments.

72 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

lambda = 0.6;n = 20;Z<-cumsum(c(0,rep(1,n)));


tau_n <- rexp(n,rate=lambda); Tn <- cumsum(tau_n)
N <- function(t) {return(stepfun(Tn,Z)(t))};t <- seq(0,10,0.01)
dev.new(width=T, height=5)
plot(t,N(t)-lambda*t,xlim = c(0,10),ylim =
c(-2,2),xlab="t",ylab=expression(paste('N'[t],'-t')),type="l",lwd=2,col="blue",main="",
xaxs = "i", yaxs = "i", xaxs = "i", yaxs = "i", las = 1, cex.axis=1.2, cex.lab=1.4)
abline(h = 0, col="black", lwd =2)
points(Tn,N(Tn)-lambda*Tn,pch=1,cex=0.8,col="blue",lwd=2)

1
Nt−t

−1

−2
0 2 4 6 8 10

Fig. 3.4: Sample path of the compensated Poisson process (Nt − λt)t∈R+ .

Since in addition (Nt − λt)t∈R+ also has independent increments, we get the
following proposition. We let

Ft := σ Ns : s ∈ [0, t]), t ⩾ 0,

denote the filtration generated by the Poisson process (Nt )t∈R+ .


Proposition 3.4. The compensated Poisson process

(Nt − λt)t∈R+

is a martingale with respect (Ft )t∈R+ .


Extensions of the Poisson process include Poisson processes with time-
dependent intensity, and with random time-dependent intensity (Cox pro-
cesses). Poisson processes belong to the family of renewal processes, which
are counting processes of the form

1[Tn ,∞) (t),


X
Nt = t ⩾ 0,
n⩾1

for which τk := Tk+1 − Tk , k ⩾ 0, is a sequence of independent identically


distributed random variables.

" 73

This version: June 9, 2023


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

3.2 Compound Poisson Process


The Poisson process itself appears to be too limited to develop realistic price
models as its jumps are of constant size. Therefore there is some interest in
considering jump processes that can have random jump sizes.

Let (Zk )k⩾1 denote a sequence of independent, identically distributed


(i.i.d.) square-integrable random variables, distributed as a common ran-
dom variable Z with probability distribution ν (dy ) on R, independent of the
Poisson process (Nt )t∈R+ . We have
wb
P(Z ∈ [a, b]) = ν ([a, b]) = ν (dy ), −∞ < a ⩽ b < ∞, k ⩾ 1,
a

and when the distribution ν (dy ) admits a probability density φ(y ) on R, we


write ν (dy ) = φ(y )dy and
wb wb
P(Z ∈ [a, b]) = ν ([a, b]) = ν (dy ) = φ(y )dy, −∞ < a ⩽ b < ∞, k ⩾ 1.
a a
Figure 3.5 shows an example of Gaussian jump size distribution.

0.4
Probability density

0.3

0.2

0.1

0
−4 −3 −2 −1 a 0 1 b 2 3 4

Fig. 3.5: Probability density function φ.

Definition 3.5. The process (Yt )t∈R+ given by the random sum

Nt
X
Yt := Z1 + Z2 + · · · + ZNt = Zk , t ⩾ 0, (3.8)
k =1

is called a compound Poisson process.∗


Letting Yt- denote the left limit

Yt- := lim Ys , t > 0,


s↗t

n
X

We use the convention Zk = 0 if n = 0, so that Y0 = 0.
k =1

74 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

we note that the jump size

∆Yt := Yt − Yt- , t ⩾ 0,

of (Yt )t∈R+ at time t is given by the relation

∆Yt = ZNt ∆Nt , t ⩾ 0, (3.9)

where
∆Nt := Nt − Nt- ∈ {0, 1}, t ⩾ 0,
denotes the jump size of the standard Poisson process (Nt )t∈R+ , and Nt- is
the left limit
Nt- := lim Ns , t > 0,
s↗t

The next Figure 3.6 represents a sample path of a compound Poisson process,
with here Z1 = 0.9, Z2 = −0.7, Z3 = 1.4, Z4 = 0.6, Z5 = −2.5, Z6 = 1.5,
Z7 = −0.5, with the relation

YTk = YTk- + Zk , k ⩾ 1.

Yt
3

0
t
T1 T2 T3 T4 T5 T6 T7
-1

Fig. 3.6: Sample path of a compound Poisson process (Yt )t∈R+ .

Example. Assume that the jump sizes Z are Gaussian distributed with mean
δ and variance η 2 , with
1 2 / (2η 2 )
ν (dy ) = p e−(y−δ ) dy.
2πη 2

N<-50;Tk<-cumsum(rexp(N,rate=0.5)); Yk<-cumsum(c(0,rexp(N,rate=0.5)))
plot(stepfun(Tk,Yk),xlim = c(0,10),lwd=2,do.points = F,main="L=0.5",col="blue")
Yk<-cumsum(c(0,rnorm(N,mean=0,sd=1)))
plot(stepfun(Tk,Yk),xlim = c(0,10),lwd=2,do.points = F,main="L=0.5",col="blue")

Given that {NT = n}, the n jump sizes of (Yt )t∈R+ on [0, T ] are independent
random variables which are distributed on R according to ν (dx). Based on
this fact, the next proposition allows us to compute the Moment Generating
Function (MGF) of the increment YT − Yt .

" 75

This version: June 9, 2023


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

Proposition 3.6. For any t ∈ [0, T ] and α ∈ R we have

E eα(YT −Yt ) = exp (T − t)λ E eαZ − 1 . (3.10)


    

Proof. Since Nt has a Poisson distribution with parameter t > 0 and is


independent of (Zk )k⩾1 , for all α ∈ R we have, by conditioning on the value
of NT − Nt = n,

NT NT −Nt
" !# " !#
E eα(YT −Yt ) = E exp α
X X
= E exp α
 
Zk Zk+Nt
k = Nt + 1 k =+1
NT −Nt
" !#
X
= E exp α Zk
k =1
   
X NT
X −Nt
= E exp α Zk  NT − Nt = n P(NT − Nt = n)
n⩾0 k =1
n
" !#
X λn
−(T −t)λ
X
=e (T − t) E exp α
n
Zk
n!
n⩾0 k =1
X λn n
= e−(T −t)λ
Y
(T − t)n E eαZk
 
n!
n⩾0 k =1
X λn n
−(T −t)λ
=e (T − t)n E eαZ

n!
n⩾0
 
= exp (T − t)λ E eαZ − 1 .
 


We note that we can also write
 w∞ 
E eα(YT −Yt ) = exp (T − t)λ (eαy − 1)ν (dy )
 
−∞
 w∞ w∞ 
= exp (T − t)λ eαy ν (dy ) − (T − t)λ ν (dy )
−∞ −∞
 w∞ 
= exp (T − t)λ (eαy − 1)ν (dy ) ,
−∞

since the probability distribution ν (dy ) of Z satisfies


 w ∞ αy w∞
E eαZ = e ν (dy ) and ν (dy ) = 1.

−∞ −∞

76 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

From the moment generating function (3.10) we can compute the expectation
and variance of Yt for fixed t. Note that the proofs of those identities require
to exchange the differentiation and expectation operators, which is possible
when the moment generating function (3.10) takes finite values for all α in a
certain neighborhood (−ε, ε) of 0.
Proposition 3.7. i) The expectation of Yt is given as the product of the
mean number of jump times E[Nt ] = λt and the mean jump size E[Z ],
i.e.,

E[Yt ] = E[Nt ]E[Z ] = λtE[Z ]. (3.11)

ii) Regarding the variance, we have

Var [Yt ] = E[Nt ]E |Z|2 = λtE |Z|2 . (3.12)


   

Proof. (i) We use the relation

∂ w∞
E[Yt ] = E[eαYt ]|α=0 = λt yν (dy ) = λtE[Z ].
∂α −∞

(ii) By (3.10), we have

∂2
E Yt2 = E[eαYt ]|α=0
 
∂α2
∂2
exp λt E eαZ − 1 |α=0
  
=
∂α2
∂  
λtE ZeαZ exp λt E eαZ − 1
   
=
∂α |α=0
= λtE Z 2 + (λtE[Z ])2
 
w∞ w ∞ 2
= λt y 2 ν (dy ) + (λt)2 yν (dy ) .
−∞ −∞


Relation (3.11) can be directly recovered using series summations, as
"N #
Xt
E[Yt ] = E Zk
k =1
"N #
X Xt
= E Zk Nt = n P(Nt = n)
n⩾1 k =1
" n #
X λn tn X
−λt
=e E Zk Nt = n
n!
n⩾1 k =1

" 77

This version: June 9, 2023


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

" n #
X λ n tn X
= e−λt E Zk
n!
n⩾1 k =1
X (λt)n−1
= λte−λt E[Z ]
(n − 1) !
n⩾1
= λtE[Z ]
= E [ Nt ] E [ Z ] .

As a consequence, the dispersion index of the compound Poisson process

Var [Yt ] E |Z|2


 
= , t ⩾ 0.
E[Yt ] E[Z ]

coincides with the dispersion index of the random jump size Z. By a multi-
variate version of Theorem 12.19, Proposition 3.6 can be used to show the
next result.
Proposition 3.8. (i) The compound Poisson process
Nt
X
Yt = Zk , t ⩾ 0,
k =1

has independent increments, i.e. for any finite sequence of times t0 < t1 <
· · · < tn , the increments

Yt1 − Yt0 , Yt2 − Yt1 , . . . , Ytn − Ytn−1

are mutually independent random variables.


(ii) In addition, the increment Yt − Ys is stationary, 0 ⩽ s ⩽ t, i.e. the
distribution of Yt+h − Ys+h does not depend of h ⩾ 0.
Proof. This result relies on the fact that the result of Proposition 3.6 can be
extended to sequences 0 ⩽ t0 ⩽ t1 ⩽ · · · ⩽ tn and α1 , α2 , . . . , αn ∈ R, as
" n # " n
!#
Y iα (Y −Y )
X
E e k tk tk−1 = E exp i αk (Ytk − Ytk−1 )
k =1 k =1
n w∞
!
X
= exp λ (tk − tk−1 ) (eiαk y
− 1)ν (dy ) (3.13)
−∞
k =1
n
Y  w∞ 
= exp (tk − tk−1 )λ (eiαk y − 1)ν (dy )
−∞
k =1
n
Y  iα (Y −Y )
= E e k tk tk−1 ,
k =1

78 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

which also shows the stationarity of Yt+h − Ys+h in h ⩾ 0, 0 ⩽⩽ t> □


Since the compensated compound Poisson process also has independent and
centered increments by (3.7) we have the following counterpart of Proposi-
tion 3.4.
Proposition 3.9. The compensated compound Poisson process

Mt := Yt − λtE[Z ], t ⩾ 0,

is a martingale.

lambda = 0.6;n = 20;Zn<-cumsum(c(0,rexp(n,rate=2)));


tau_n <- rexp(n,rate=lambda); Tn <- cumsum(tau_n)
Y <- function(t) {return(stepfun(Tn,Zn)(t))};t <- seq(0,10,0.01)
par(oma=c(0,0.1,0,0))
plot(t,Y(t)-0.5*lambda*t,xlim = c(0,10),ylim =
c(-2,2),xlab="t",ylab=expression(paste('Y'[t],'-t')),type="l",lwd=2,col="blue",main="", xaxs
= "i", yaxs = "i", xaxs = "i", yaxs = "i", las = 1, cex.axis=1.2, cex.lab=1.4)
abline(h = 0, col="black", lwd =2)
points(Tn,Y(Tn)-0.5*lambda*Tn,pch=1,cex=0.8,col="blue",lwd=2);grid()

1
Yt−t

−1

−2
0 2 4 6 8 10

Fig. 3.7: Sample path of a compensated compound Poisson process (Yt − λtE[Z ])t∈R+ .

3.3 Claim and Reserve Processes


We consider
• a number Nt of claims made until t ⩾ 0, which is modeled by an homoge-
neous Poisson process (Nt )t⩾0 with intensity λ > 0,
• a sequence (Zk )k⩾1 of non-negative independent, identically-distributed
random variables, which represent the claim amounts.
We assume that the claim amounts (Zk )k⩾1 and the process of arrivals
(Nt )t⩾0 are independent. In the next definition we use the convention
S (t) = 0 if Nt = 0.

" 79

This version: June 9, 2023


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

Definition 3.10. The aggregate claim amount up to time t is defined as the


compound Poisson process
Nt
X
S (t) = Zk .
k =1

The aggregate claim amount (S (t))t∈R+ can also be written as

S (t) = YNt , t ∈ R+ ,

where (Yk )k⩾1 is the sequence of random variables independent of (Nt )t∈R+
given by
Xk
Yk = Zj , k ⩾ 0,
j =1

with Y0 = 0. In the next definition, f : R+ → R+ is an increasing function


mapping t > 0 to the premium income f (t) received between time 0 and time
t, with f (0) = 0.
Definition 3.11. Standard compound Poisson risk model. The surplus (or
reserve) process (Rx (t))t⩾0 is defined as

Rx ( t ) = x + f ( t ) − S ( t ) , t ⩾ 0,

where x ⩾ 0 is the amount of initial reserves and f (t) is the premium income
received between time 0 and time t > 0.
In the next Figures 3.8 and 3.9 we take f (t) := ct with c = 0.5.

Rx
3

1
x
0
T1 T2 T3 T4 T5 t

Fig. 3.8: Sample path (without ruin) of a reserve process (Rx (t))t∈R+ .

Unlike the above figure, the next Figure 3.9 contains a ruin event.

80 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

Rx
3

x1

0
T1 T2 T3 T4 T5 t

Fig. 3.9: Sample path (with ruin) of a reserve process (Rx (t))t∈R+ .

3.4 Ruin Probabilities

We will consider the infinite time ruin probability

Ψ ( x ) = P ∃ t > 0 : Rx ( t ) < 0 ,


and the finite-time ruin probability defined as

ΨT (x) = P ∃ t ∈ [0, T ] : Rx (t) < 0 ,




given T > 0 a finite time horizon. The ruin probability ΨT (x) can also be
written as
ΨT (x) = P mT0 < −x , x ⩾ 0,


where mT0 is the infimum

mT0 := min (f (t) − S (t)).


0⩽t⩽T

Cramér-Lundberg Model

In Proposition 3.12 we compute the ruin probability in infinite time starting


from an initial reserve x ⩾ 0.
Proposition 3.12. Assume that the premium income function satisfies
f (t) = ct with premium rate c > 0.
a) The ruin probability in infinite time starting from the initial reserve x = 0
is given by
λµ
Ψ(0) = P ∃ t ⩾ 0 : R0 (t) < 0 = ,

c
provided that c ⩾ λµ, where µ = E[Z ], and Ψ(0) = 1 if c < λµ.
b) Assume that the claim sizes (Zk )k⩾1 form a sequence of independent, ex-
ponentially distributed random variables with mean µ > 0, i.e. with pa-
rameter 1/µ. Then, the ruin probability in infinite time starting from the
initial reserve x ⩾ 0 is given by

" 81

This version: June 9, 2023


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

λµ (λ/c−1/µ)x
Ψ (x) = e , x ⩾ 0, (3.14)
c
provided that c ⩾ λµ, with Ψ(x) = 1 if c < λµ.
Proof. a) Let

Φ(x) := 1 − Ψ(x) = P (Rx (t) ⩾ 0, ∀t ⩾ 0)

denote the probability of non-ruin. Since c, x ⩾ 0, we have

Φ(x) = P(Rx (t) ⩾ 0, ∀ t ⩾ 0)


Nt
!
X
= P x + ct − Zk ⩾ 0, ∀ t ⩾ 0
k =1
Nt
!
X
= P x + ct − Zk ⩾ 0, ∀ t ⩾ T1
k =1
 
= E 1x+cT −Z +c(t−T )−PNt Z ⩾0, ∀ t⩾T
1 1 1 k =2 k 1
  
= E E 1x+cT −Z +c(t−T )−PNt Z ⩾0, ∀ t⩾T T1
1 1 1 k =2 k 1

= E Φ(x + cT1 − Z1 )
 
w∞ w x+cs
=λ e−λs Φ(x + cs − z )dF (z )ds
0 0
λ λx/c w ∞ −λu/c w u
= e e Φ(u − z )dF (z )du, (3.15)
c x 0

where
F ( z ) : = P ( Z1 ⩽ z ) , z ∈ R+ ,
denotes the cumulative distribution function of the claim size Z1 . By differ-
entiating (3.15) with respect to x, we find

λ wx 
Φ′ (x) = Φ (x) − Φ(x − z )dF (z )ds , (3.16)
c 0

hence by integration by parts with respect to z ∈ [0, x], we get


wx
Φ (x) = Φ (0) + Φ′ (y )dy
0
λ xw λ wxwy
= Φ (0) + Φ(y )dy − Φ(y − z )dF (z )dy
c 0 c 0 0
λ xw
= Φ (0) + Φ(x − z )(1 − F (z ))dz,
c 0
We deduce

82 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

λw∞
Φ (∞) = Φ (0) + Φ(∞ − z )(1 − F (z ))dz
c 0
λ w∞
= Φ (0) + Φ (∞) (1 − F (z ))dz
c 0
λ w ∞
= Φ (0) + Φ (∞) P(Z > z )dz
c 0
λµ
= Φ (0) + Φ (∞) , (3.17)
c
since
w∞ w∞
P(Z1 > z )dz = E[1{Z1 >z} ]dz
0 0
w 
Z
=E dz
0
= E [ Z1 ]

is the average claim size. From (3.17) we have

λµ
Φ (∞) = Φ (0) + Φ (∞) ,
c
which yields Φ(0) = 1 − λµ/c and Φ(∞) = 1 when λµ ⩽ c, and Φ(0) =
Φ(∞) = 0 when λµ > c. In particular, the ruin probability in infinite time
starting from the initial reserve x = 0 is given by

Ψ (0) = 1 − Φ (0)
= P ∃ t ⩾ 0 : Rx ( t ) < 0


λµ
= , (3.18)
c
provided that λµ ⩽ c.
b) We refer to Exercise 3.2 for the computation of the ruin probability Ψ(x)
starting from any x > 0. when the claim sizes (Zk )k⩾1 are exponentially
distributed. □

R simulation∗

The following code provides an approximation of the infinite time ruin


probability (3.14) of Proposition 3.12 by Monte Carlo simulation when T is
sufficiently large, see also (3.20) in Exercise 3.2.


Kaas et al. (2009), Example 4.3.7.

" 83

This version: June 9, 2023


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

lambda = 0.1; x = 7.5; mu = 10; c = 3;


T=20; # Use T>=500 to approximate infinite time dev.new(width=T, height=5)
nSim = 50; N <- rep(Inf, nSim)
for (k in 1:nSim){tauk <- rexp(10*T*lambda,lambda);Ti <- cumsum(tauk)
n=length(Ti[Ti<T]);if (n>=1) {Zk <- rexp(n,1/mu);Si <- x + Ti*c
Ri <- Si - cumsum(Zk);RRi <- Si - c(0,cumsum(Zk)[1:n-1]);
Si<-Si[Ti<T];Ri<-Ri[Ti<T];RRi<-RRi[Ti<T]
Ri <- c(Ri,Ri[n]+c*(T-Ti[n]));RRi <- c(RRi,Ri[n+1]);Ti <- c(Ti[Ti<T],T)
ruin <- !all(Ri[1:n]>=0);}
else {ruin<-FALSE;Ti=c(T);RRi=x+c*T;Ri=x+c*T;};color="blue";
if (ruin) {N[k] <- min(which(Ri<0));color="red"}
par(mgp=c(0.8,1,1));par(mar=c(2,2,2,2))
plot(c(0,rbind(Ti,Ti)),c(x,rbind(RRi,Ri)),xlab="Time
t",xlim=c(0,T*0.99),ylim=c(-c*T/3,x+c*T),lwd=3,ylab="R(t)",type="l",col=color,
main=paste(length(N[N<Inf]),"/",k,"=",format(length(N[N<Inf])/k,digits=4)),
axes=FALSE, cex.lab=1.4)
axis(1, pos=0, las = 1, cex.axis=1.2);axis(2, pos=0, las = 1, cex.axis=1.2);Sys.sleep(0.2)}
N <- N[N<Inf];length(N);mean(N);sd(N);max(N)
cat('Theoretical value:',lambda*mu*exp(-x*(1/mu-lambda/c))/c,'\n')
cat('Simulation:',length(N)/nSim,'\n')

Figure 3.10 computes an estimate of the infinite time ruin probability Ψ(x)
by generating the sample paths of the reserve process (Rx (t))t∈R+ .

2 / 9 = 0.2222

60

40
R(t)

20

0
0 5 10 15 20

−20

Time t

Fig. 3.10: Sample paths of a reserve process (Rx (t))t∈R+ .∗

Probability density function

The probability density function of mT0 at −x < 0 can be computed as

∂ΨT
− (x).
∂x

The animation works in Acrobat Reader on the entire pdf file.

84 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

An important practical problem is to obtain numerical values of the sensitiv-


ity of the finite-time ruin probability with respect to the initial reserve
∂ΨT
(x),
∂x
in particular due to new solvency regulations in Europe. The problem of
computing the corresponding sensitivity for the finite-time ruin probability
ΨT (x) has been covered in Loisel and Privault (2009) based on multiple
integration. Formulas for the finite-time ruin probability

ΨT (x) = P ∃ t ∈ [0, T ] : Rx (t) < 0




have been proposed in Picard and Lefèvre (1997), see also De Vylder (1999)
and Ignatova et al. (2001), Rullière and Loisel (2004). In Privault and Wei
(2004; 2007), the Malliavin calculus has been used to provide a way to com-
pute the sensitivity of the probability

P ( Rx ( T ) < 0 )

that the terminal surplus is negative with respect to parameters such as the
initial reserve or the interest rate of the model.

Integral expressions

Starting from f (0) := 0 we clearly we have mT0 ⩽ 0 = f (0) hence the


distribution of mT0 is carried by (−∞, 0]. On the other hand, we have mT0 = 0
if and only if NT = 0 or f (Tk ) − Yk > 0 for all k ⩾ 1 such that Tk ⩽ T ,
hence the distribution of mT0 has a Dirac mass at 0 with weight

P mT0 = 0 = P(NT = 0) + P {mT0 ⩾ 0} ∩ {NT ⩾ 1}


 
 
X w T w tk w t2
=e −λT
+e −λT 
E λ k
··· 1{f (t1 )>Y1 } · · · 1{f (tk )>Yk } dt1 · · · dtk  ,
0 0 0
k⩾1

where we used the fact that Poisson jump times are independent uniformly
distributed on the square [0, T ]n given that {NT = n}.

On the other hand, since f is increasing we have

mT0 = inf (f (Tk ) − Yk ) = 1{NT ⩾1} inf (f (Tk ) − Yk ),


Tk ⩽T , k⩾0 Tk ⩽T , k⩾1

with T0 = 0. Hence we have the integral expression

P mT0 ⩾ y ∩ {NT ⩾ 1} (3.19)


 

" 85

This version: June 9, 2023


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

 
w T w tk w t2
1{y<inf 1⩽l⩽k (f (tl )−Yl )} dt1 · · · dtk 
X
−λT
=e E λ k
···
0 0 0
k⩾1
 
w T w tk + 1 w t2
1{f (t1 )>Y1 +y} · · · 1{f (tk+1 )>Yk+1 +y} dt1 · · · dtk+1 
X
= λe−λT E  λk ···
0 0 0
k⩾0

Analytic expressions for ruin probabilities have been obtained in case (Yk )k⩾1
are independent, exponentially distributed random variables with parameter
µ > 0 and f (t) = ct is linear, c ⩾ 0, Theorem 4.1 and Relation (4.6) of Dozzi
and Vallois (1997) show that

P mT0 < x

 
wT X (λµt(x + ct))n X (λµt(x + ct))n e−µ(x+ct)−λt
=λ x + ct dt,
n!(n + 1)!
 
0 (n!)2 x + ct
n⩾0 n⩾0

see also Theorem 3.1 of León and Villa (2009) for other related expressions.

Random drift

Here, we consider the infimum

mT0 = inf (Xt − S (t))


0⩽t⩽T

where (Xt )t∈R+ is a stochastic process with independent increments and


X0 = 0, independent of (S (t))t∈R+ , and such that

inf Xt , 0 ⩽ a < b,
t∈[a,b]

has a probability density function denoted by ϕa,b (x). For example, if


(Xt )t∈R+ is a standard Brownian motion then ϕa,b (x) is given by
w∞  
ϕa,b (z )dz = P inf Xt ⩾ x
x t∈[a,b]
     
= E 1{Xa <x} P inf Xt ⩾ x Xa + E 1{Xa ⩾x} P inf Xt ⩾ x Xa
t∈[a,b] t∈[a,b]
  
= E 1{Xa <x} P inf Bt ⩾ x − Xa Xa + P(Xa ⩾ x)
t∈[0,b−a]

= 2E 1{Xa <x} P (Bb−a ⩾ x − Xa | Xa ) + P(Xa ⩾ x)


 

1 w∞ 2
w∞ 2 1 w ∞ −z 2 /(2a)
= p e−(x−y ) /(2a) e−z /(2(b−a)) dzdy + √ e dz.
π a(b − a) 0 y 2πa x

86 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

We have mT0 ⩽ X0 = 0 a.s., hence the distribution of mT0 is carried by


(−∞, 0].

Guaranteed Maturity Benefits

Variable annuity benefits offered by insurance companies are usually pro-


tected via different mechanisms such as Guaranteed Minimum Maturity Ben-
efits (GMMBs) or Guaranteed Minimum Death Benefits (GMDBs). The com-
putation of the corresponding risk measures is an important issue for the
practitioner in risk management.

Given a fund value process (Ft )t∈R+ , an insurer is continuously charging


annualized mortality and expense fees at the rate m from the account of
variable annuities, resulting into a margin offset income Mt given by

Mt := mFt t ∈ R+ .

Denoting by τx the future lifetime of a policyholder at the age x, the future


payment made by the insurer at maturity T is

(G − FT )+ 1{τx >T }

where G is the guarantee level expressed as a percentage of the initial fund


value F0 , δ is a roll-up rate according to which the guarantee increases up to
the payment time. In this case, the random variable X is taken equal to
w min(T ,τx )
X := e−rT (G − FT )+ 1{τx >T } − e−rs Ms ds.
0

Exercises

Exercise 3.1 Consider N a Poisson random variable with distribution


λn
P(N = n) = e−λ , n = 0, 1, 2, . . .
n!
N
X
where λ > 0, and let Y := Zk , where (Zk )k⩾1 is a sequence of inde-
k =1
pendent centered N (0, σ 2 ) Gaussian random variables with variance σ 2 and
cumulative distribution function
1 wx 2 2 1 w x/σ −y2 /2 x
P ( Zk ⩽ x ) = √ e−y /(2σ ) dy = √ e dy = Φ ,
2πσ 2 −∞ 2π −∞ σ

x ∈ R+ .

" 87

This version: June 9, 2023


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

a) Compute P(Y ⩾ y ) using the conditioning


N
!
X X
P(Y ⩾ y ) = P Zk ⩾ y N = n P(N = n) = · · ·
n⩾1 k =1

b) Find E[Y ].

Exercise 3.2 Show that when the claim size distribution is exponential with
mean µ > 0, i.e. when F (z ) = 1 − e−z/µ , z ⩾ 0, the ruin probability is given
by
λµ x(λ/c−1/µ)
Ψ ( x ) = P ∃ t ∈ R + : Rx ( t ) < 0 = e , x ⩾ 0, (3.20)

c
provided that c ⩾ λµ.

Exercise 3.3 An insurance company receives continuous-time premium in-


come at the rate $µ per year. Claim payments are filed by subscribers ac-
cording to a standard Poisson process (Nt )t∈R+ of intensity λ > 0 claims per
year. All claims have same constant amount $C > 0.
a) Compute the expected value E[RT ] and variance E[(RT − E[RT ])2 ] of the
company’s reserve RT := R0 + µT − CNT at time T > 0, with constant
initial reserve R0 .
b) Express the probability P(RT < 0) of ruin at time T using the Poisson
probability mass function P(NT = k ) = e−λT (λT )k /k!, k ⩾ 0.

Exercise 3.4 Consider


• a number Nt of claims made until t ⩾ 0, which is modeled by an homoge-
neous Poisson process (Nt )t⩾0 with intensity λ > 0,
• a sequence (Zk )k⩾1 of non-negative independent, identically-distributed
random variables, which represent the claim amounts.
We assume that the claim amounts (Zk )k⩾1 and the process (Nt )t⩾0 of ar-
rivals are independent. The aggregate claim amount made up to time t to an
insurance company is defined as the compound Poisson process
Nt
X
S (t) : = Zk = Z1 + Z2 + · · · + ZNt , t ∈ [0, T ].
k =1

The initial reserve of the company is denoted by x ⩾ 0 and the premium


income received up to time t ⩾ 0 is denoted by f (t).
a) Give the mean and variance of S (T ).
Hint: Use the mean E[NT ] = λT and the moments E[Z1 ] and E[Z12 ].

88 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

b) Using the Chebyshev inequality (3.21), provide an upper bound for the
ruin probability P(x + f (T ) − S (T ) < 0) at time T > 0, provided that
x + f (T ) − λT E[Z1 ] > 0.
Hint: By the Chebyshev inequality inequality, for any random variable X
with mean µ > 0 and variance σ 2 we have

σ2
P(X ⩽ 0) = P(X − µ ⩽ −µ) ⩽ P(|X − µ| ⩾ µ) ⩽ . (3.21)
µ2

" 89

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Chapter 4
Correlation and Dependence

Correlation and dependence are statistical relationships that can be observed


between distinct random variables or data samples.∗ They are generally mod-
eled by copulas which are used to describe the joint distribution of random
variables. This chapter deals with uncertainty and dependence structures via
the construction of copulas, starting from basic Bernoulli and Gaussian ex-
amples.

4.1 Joint Bernoulli Distribution . . . . . . . . . . . . . . . . . . . . 91


4.2 Joint Gaussian Distribution . . . . . . . . . . . . . . . . . . . . . 92
4.3 Copulas and Dependence Structures . . . . . . . . . . . . . 94
4.4 Examples of Copulas . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105

4.1 Joint Bernoulli Distribution

Given a choice of modeling based on the distributions of two random vari-


ables X and Y , it is natural to consider a dependence structure between X
and Y .

Consider two Bernoulli random variables X and Y , with

pX = P(X = 1) = E[1{X =1} ] and pY = P(Y = 1) = E[1{Y =1} ]

and correlation
E[XY ] − E[X ]E[Y ] P(X = 1 and Y = 1) − pX pY
ρ := = p .
Var [X ]Var [Y ] pX (1 − pX )pY (1 − pY )
p


Correlation does not imply causation. Try “Spurious Correlations”.

" 91

This version: June 9, 2023


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

We note that in that case the joint distribution P(X = i and Y = j ), i, j =


0, 1, is fully determined by P(X = 1), P(Y = 1) and the correlation ρ ∈
[−1, 1], as

P(X = 1 and Y = 1) = E[XY ] p




= pX pY + ρ pX pY (1 − pX )(1 − pY ),








P(X = 0 and Y = 1) = E[(1 − X )Y ] p
= P(Y = 1) − P(X = 1 and Y = 1)




= (1 − pX )pY − ρ pX pY (1 − pX )(1 − pY ),



P(X = 1 and Y = 0) = E[X (1 − Y )] p


= P(X = 1) − P(X = 1 and Y = 1)




= pX (1 − pY ) − ρ pX pY (1 − pX )(1 − pY ),








P(X = 0 and Y = 0) = E[(1 − X )(1 − Y )] p




= (1 − pX )(1 − pY ) + ρ pX pY (1 − pX )(1 − pY ),

see Exercise 4.2.

4.2 Joint Gaussian Distribution

Consider now two centered Gaussian random variables X ≃ N (0, σ 2 ) and


Y ≃ N (0, η 2 ) with probability density functions
1 2 / (2σ 2 ) 1 2 / (2η 2 )
fX ( x ) = √ e−x and fY (x) = p e−x , x ∈ R.
2πσ 2 2πη 2

Let
Cov(X, Y ) E[XY ] − E[X ]E[Y ]
ρ = corr (X, Y ) := p = .
Var [X ]Var [Y ] Var [X ]Var [Y ]
p

When the covariance matrix


E X E[XY ]
  2   2 
σ ρση
Σ := 
  =
   (4.1)
E[XY ] E Y 2 ρση η 2

with determinant
2
det Σ = E X 2 E Y 2 − E[XY ]
   
2 
= E X 2 E Y 2 1 − corr (X, Y )
   

⩾ 0,

is invertible, there exists a probability density function

92 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

 !
1 1 x ⊤ −1 x
 
fΣ (x, y ) = √ exp − Σ (4.2)
2π det Σ 2 y y
 ⊤ E X 2 E[XY ] −1  
     
1  1 x x 
= √ exp − ,
2 y
 
2π det Σ E[XY ] E Y 2
  y 

with respective marginals N (0, σ 2 ) and N (0, η 2 ).

0.08
0.06
0.04
0.02
4
0 2
-3
-2 0
-1 -2
0 y
1 -4
2
x 3
Fig. 4.1: Joint Gaussian probability density.

The probability density function (4.2) is called the centered joint (bivariate)
Gaussian probability density with covariance matrix Σ.

Note that when ρ = corr (X, Y ) = ±1 we have det Σ = 0 and the joint
probability density function fΣ (x, y ) is not defined.

More generally, a random vector (X1 , . . . , Xn ) has a multivariate centered


Gaussian distribution if every linear combination Y = a1 X1 + . . . + an Xn
is centered Gaussian, and in this case the probability density function of
(X1 , . . . , Xn ) takes the form

1 1
 
f Σ ( x1 , . . . , xn ) = p exp − (x1 , . . . , xn )T Σ−1 (x1 , . . . , xn ) ,
(2π )n det Σ 2

(x1 , x2 , . . . , xn ) ∈ Rn , where Σ is the covariance matrix

Var[X1 ] Cov(X1 , X2 ) · · · Cov(X1 , Xn−1 ) Cov(X1 , Xn )


 
 2 . . .. ..
 Cov(X2 , X1 ) Var X2 . . .
 

.. .. .. .. ..
 
Σ= . . . . . .
 
.. .. .
 
. . Var[Xn−1 ] Cov(Xn−1 , Xn ) 
 
 . .
Cov(X1 , Xn ) Cov(X2 , Xn ) · · · Cov(Xn−1 , Xn ) Var Xn
 2

" 93

This version: June 9, 2023


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

The next remark plays an important role in the modeling of joint default
probabilities, see here for a detailed discussion.
Remark 4.1. There exist couples (X, Y ) with of random variables with
Gaussian marginals N (0, σ 2 ) and N (0, η 2 ), such that
i) (X, Y ) does not have the bivariate Gaussian distribution with proba-
biliy density function fΣ (x, y ), where Σ is the covariance matrix (4.1) of
(X, Y ).
ii) the random variable X + Y is not even Gaussian.
Proof. See Exercise 4.5. □

4.3 Copulas and Dependence Structures


The word copula derives from the Latin noun for a “link” or “tie” that con-
nects two different objects or concepts.
Definition 4.2. A two-dimensional copula is any joint cumulative distribu-
tion function

C : [0, 1] × [0, 1] −→ [0, 1]


(u, v ) 7−→ C (u, v )

with uniform [0, 1]-valued marginals.


In other words, any copula function C (u, v ) can be written as

C (u, v ) = P(U ⩽ u and V ⩽ v ), 0 ⩽ u, v ⩽ 1,

where U and V are uniform [0, 1]-valued random variables.

Examples.
i) The copula corresponding to independent uniform random variables
(U , V ) is given by

C (u, v ) = P(U ⩽ u and V ⩽ v )


= P(U ⩽ u)P(V ⩽ v )
= uv, 0 ⩽ u, v ⩽ 1.

ii) The copula corresponding to the fully correlated case U = V is given by

C (u, v ) = P(U ⩽ u and V ⩽ v )


= P(U ⩽ min(u, v ))
= min(u, v ), 0 ⩽ u, v ⩽ 1.

94 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

iii) The copula corresponding to the fully anticorrelated case U = 1 − V is


given by

C (u, v ) := P(U ⩽ u and V ⩽ v )


= P(U ⩽ u and 1 − U ⩽ v )
= P(1 − v ⩽ U ⩽ u)
= (u + v − 1) + , 0 ⩽ u, v ⩽ 1.

The next lemma is well known and can be used to generate random sam-
ples of a cumulative distribution function FX based on uniformly distributed
samples, see Proposition 3.1 in Embrechts and Hofert (2013) for its general
−1
statement. Here, FX denotes the generalized inverse of the Cumulative Dis-
tribution Function FX of X. By e.g. Proposition 2.3-(2) in Embrechts and
−1
Hofert (2013), since FX is non-decreasing in x ∈ R, FX is non-decreasing,
left-continuous, and admits limits on the right.
Lemma 4.3. Consider a random variable X with continuous and strictly
increasing distribution function

FX ( x ) : = P ( X ⩽ x ) , x ∈ R.

a) The random variable U := FX (X ) is uniformly distributed on [0, 1].


−1
b) If U is uniformly distributed on [0, 1] then FX (U ) has same distribution
as X.
Proof.
a) We have

FU ( u ) = P ( U ⩽ u )
= P ( FX ( X ) ⩽ u )
−1
= P(X ⩽ FX (u))
−1
= FX ( FX (u))
= u, 0 ⩽ u ⩽ 1.

b) Similarly, we have
−1
P ( FX (U ) ⩽ x) = P(U ⩽ FX (x)) = FX (x), x ∈ R.


As a consequence of Lemma 4.3, given (X, Y ) a couple of random variables
with joint cumulative distribution function

F(X,Y ) (x, y ) := P(X ⩽ x and Y ⩽ y ), x, y ∈ R,

" 95

This version: June 9, 2023


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

and cumulative distribution functions

FX (x) = F(X,Y ) (x, ∞) = P(X ⩽ x) and FY (y ) = F(X,Y ) (∞, y ) = P(Y ⩽ y ),

we note the following points.


i) The random variables

U : = FX ( X ) and V := FY (Y )

are uniformly distributed on [0, 1].

ii) The copula function

(u, v ) 7−→ C(X,Y ) (u, v ) := P(U ⩽ u and V ⩽ v ), 0 ⩽ u, v ⩽ 1,

satisfies

C(X,Y ) (u, v ) := P(U ⩽ u and V ⩽ v )


= P FX (X ) ⩽ u and FY (Y ) ⩽ v


−1
= P X ⩽ FX (u) and Y ⩽ FY−1 (v )


−1
(u), FY−1 (v ) , 0 ⩽ u, v ⩽ 1,

= F(X,Y ) FX

is a copula.

iii) The joint cumulative distribution function of (X, Y ) can be recovered


from the copula C(X,Y ) and the marginal cumulative distribution func-
tions FX , FY as

F(X,Y ) (x, y ) = P(X ⩽ x and Y ⩽ y )


= P FX (X ) ⩽ FX (x) and FY (Y ) ⩽ FY (v )


= P U ⩽ FX (x) and V ⩽ FY (v )


= C(X,Y ) FX (x), FY (y ) , x, y ∈ R.


Higher dimensional copulas

Definition 4.4. An n-dimensional copula is any joint cumulative distribu-


tion function

C : [0, 1] × · · · × [0, 1] −→ [0, 1]


(u1 , . . . , un ) 7−→ C (u1 , . . . , un )

of n uniform [0, 1]-valued random variables.


Consider the joint cumulative distribution function

96 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

F(X1 ,...,Xn ) (x1 , . . . , xn ) := P(X1 ⩽ x1 , . . . , Xn ⩽ xn )

of a family (X1 , . . . , Xn ) of random variables with marginal cumulative dis-


tribution functions

FXi (x) = F(X1 ,...,Xn ) (+∞, . . . , +∞, x, +∞, . . . , +∞), x ∈ R,

i = 1, 2, . . . , n. The copula defined in Sklar’s theorem encodes the dependence


structure of the vector (X1 , . . . , Xn ).
Theorem 4.5. Sklar’s theorem (Sklar (1959)∗ , Sklar (2010)). Given a joint
cumulative distribution function F(X1 ,...,Xn ) there exists an n-dimensional
copula C (u1 , . . . , un ) such that

F(X1 ,...,Xn ) (x1 , x2 , . . . , xn ) = C FX1 (x1 ), FX2 (x2 ), . . . , FXn (xn ) ,




x1 , x2 , . . . , xn ∈ R.
The following proposition is a consequence of Sklar’s Theorem 4.5.
Proposition 4.6. Assume that the marginal distribution functions FXi are
continuous and strictly increasing. Then the joint cumulative distribution
function F(X1 ,...,Xn ) defines a n-dimensional copula

−1 −1
C (u1 , . . . , un ) := F(X1 ,...,Xn ) FX (u1 ), . . . , FX (un ) , (4.3)

1 n

u1 , u2 , . . . , un ∈ [0, 1], which encodes the dependence structure of the vector


(X1 , . . . , Xn ).
Proof. Indeed, it can be checked as in Lemma 4.3 that C (u1 , . . . , un ) has
uniform marginal distributions on [0, 1], as

C (1, . . . , 1, u, 1, . . . , 1)
−1 −1 −1 −1 −1
( 1 ) , . . . , FX (1), FX ( u ) , FX ( 1 ) , . . . , FX (1)

= F(X1 ,...,Xn ) FX 1 i−1 i i+1 n
−1
= F(X1 ,...,Xn ) + ∞, . . . , +∞, FXi (u), +∞, . . . , +∞


= FXe F −1 (u)

i Xei
= u, 0 ⩽ u ⩽ 1.


The following is a converse to Theorem 4.5.

“The author considers continuous non-decreasing functions Cn on the n-dimensional
cube [0, 1]n with Cn (0, . . . , 0) = 0, Cn (1, . . . , 1, α, 1, . . . , 1) = α. Several theorems are
stated relating n-dimensional distribution functions and their marginals in terms of
functions Cn . No proofs are given.” M. Loève, Math. Reviews MR0125600.

" 97

This version: June 9, 2023


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

Proposition 4.7. Given a family (X e1 , . . . , Xen ) of random variables with


marginal cumulative distribution functions FX e1 , . . . , FXen and a multidimen-
sional copula C (u1 , . . . , un ), the function

F Ce en ) (x1 , . . . , xn ) := C FX
e1 (x1 ), . . . , FXen (xn ) , x1 , x2 , . . . , xn ∈ R,

(X1 ,...,X

e1 , . . . , X
defines a joint cumulative distribution function with marginals X en .
Proof. We note that the marginal distributions generated by F C ( x , . . . , xn )
(X en ) 1
e1 ,...,X
coincide with the respective marginals of (X1 , . . . , Xn ), as we have
e e

F Ce (+∞, . . . , +∞, u, +∞, . . . , +∞)


(X1 ,...,X
en )
= C FXe (+∞), . . . , FXe (+∞), FXe (u), FXe (+∞), . . . , FXe (+∞)

1 i−1 i i+1 n

= C 1, . . . , 1, FXe (u), 1, . . . , 1

i
= FXe (u), 0 ⩽ u ⩽ 1.
i

4.4 Examples of Copulas

Gaussian copulas

The choice of (4.2) above as joint probability density function, see Figure 4.1,
actually induces a particular dependence structure between the Gaussian ran-
dom variables X and Y , and corresponding to the joint cumulative distribu-
tion function

ΦΣ (x, y ) := P(X ⩽ x and Y ⩽ y )


1 wx wy 
1
 
u
 
u
= √ exp − , Σ−1 dudv,
2π det Σ −∞ −∞ 2 v v

x, y ∈ R. In case (X, Y ) are normalized centered Gaussian random variables


with unit variance, Σ is given by


 
Σ= ,
ρ1

with correlation parameter ρ ∈ [−1, 1]. Letting

FX ( x ) : = P ( X ⩽ x ) and FY (y ) := P(Y ⩽ y ),

denote the cumulative distribution functions of X and Y , the random vari-


ables FX (X ) and FY (Y ) are known to be uniformly distributed on [0, 1],
98 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

and (FX (X ), FY (Y )) is a [0, 1] × [0, 1]-valued random variable with joint


cumulative distribution function

CΣ (u, v ) := P FX (X ) ⩽ u and FY (Y ) ⩽ v


−1
= P X ⩽ FX (u) and Y ⩽ FY−1 (v )


−1
= Φ Σ FX (u), FY−1 (v ) , 0 ⩽ u, v ⩽ 1. (4.4)


The function CΣ (u, v ), which is the joint cumulative distribution function


of a couple of uniformly distributed [0, 1]-valued random variables, is called
the Gaussian copula generated by the jointly Gaussian distribution of (X, Y )
with covariance matrix Σ.

1.0 1.0 1.0

0.8 0.8 0.8

0.6 0.6 0.6


C(x,y)

C(x,y)

C(x,y)
0.4 0.4 0.4

0.2 0.2 0.2


0.0 0.0 0.0
1.0 1.0 1.0

0.8 0.8 0.8

0.6 0.6 0.6


1.0 1.0 1.0
0.8 0.8 0.8
y

y
0.4 0.4 0.4
0.6 0.6 0.6

0.2 0.4 x 0.2 0.4 x 0.2 0.4 x


0.2 0.2 0.2
0.0 0.0 0.0
0.0 0.0 0.0

(a) ρ = 0. (b) ρ = 0.85. (c) ρ = 1.

Fig. 4.2: Different Gaussian copula graphs for ρ = 0, ρ = 0.85 and ρ = 1.

Figure 4.2-(a) corresponds to independent uniformly distributed [0, 1]-valued


random variables U , V , i.e. to the copula

C (u, v ) := P(U ⩽ u and V ⩽ v ) = P(U ⩽ u)P(U ⩽ u) = uv, 0 ⩽ u, v ⩽ 1.

On the other hand, Figure 4.2-(c) corresponds to equally uniformly dis-


tributed [0, 1]-valued random variables U = V , i.e. to the copula

C (u, v ) := P(U ⩽ u and V ⩽ v )


= P(U ⩽ u and U ⩽ v )
= P(U ⩽ min(u, v ))
= min(u, v ), 0 ⩽ u, v ⩽ 1,

Figure 4.2-(b) corresponds to an intermediate dependence level given by a


Gaussian copula, cf. (4.4) below.

" 99

This version: June 9, 2023


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

1.0 100
2.0
0.8 80
0.6 1.5
c(x,y)

60

c(x,y)
c(x,y)
0.4 1.0 40
0.2 0.5 20
0.0 0.0 0
1.0 1.0 1.0

0.8 0.8 0.8

0.6 0.6 0.6


1.0 1.0 1.0
0.8 0.8 0.8
y

y
0.4 0.4 0.4
0.6 0.6 0.6

0.2 0.4 x 0.2 0.4 x 0.2 0.4 x


0.2 0.2 0.2
0.0 0.0 0.0
0.0 0.0 0.0

(a) ρ = 0. (b) ρ = 0.35. (c) ρ = 0.999.

Fig. 4.3: Different Gaussian copula density graphs for ρ = 0, ρ = 0.35 and ρ = 0.999.

Figure 4.3-(a) represents a uniform (product) probability density function


on the square [0, 1] × [0, 1], which corresponds to two independent uniformly
distributed [0, 1]-valued random variables U , V . Figure 4.3-(c) shows the
probability distribution of the fully correlated couple (U , U ), which does not
admit a probability density on the square [0, 1] × [0, 1].

The Gaussian copula CΣ (u, u) admits a probability density function on


[0, 1] × [0, 1] given by

∂ 2 CΣ
cΣ (u, v ) = (u, v )
∂u∂v
∂2 −1
ΦΣ FX (u), FY−1 (v )

=
∂u∂v !
∂ 1 ∂ΦΣ −1 −1
,

= F X ( u ) FY ( v )
∂u FY′ (FY−1 (v )) ∂y
!
∂ 1 ∂ΦΣ −1 −1
FX (u), FY (v )

=
∂u fY (FY−1 (v )) ∂y
1 ∂ 2 ΦΣ
F −1 (u), FY−1 (v )

=
fX (FX−1
(u))fY (FY−1 (v )) ∂x∂y X
−1
(u), FY−1 (v )

f Σ FX
= −1 ,
fX (FX (u))fY (FY−1 (v ))

hence the Gaussian copula CΣ (u, v ) can be computed as


wuwv
CΣ (u, v ) = cΣ (a, b)dadb
0 0
w u w v fΣ F −1 (a), F −1 (b)
X Y
= dadb, 0 ⩽ u, v ⩽ 1.
0 0 fX (F −1 (a))fY (F −1 (b))
X Y

100 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

The joint cumulative distribution function F(X,Y ) (x, y ) of (X, Y ) can be


recovered from Proposition 4.6 as

F(X,Y ) (x, y ) = CΣ (FX (x), FY (y )), x, y ∈ R. (4.5)

from the Gaussian copula CΣ (x, y ) and the respective cumulative distribu-
tion functions FX (x), FY (y ) of X and Y .

In that sense, the Gaussian copula CΣ (x, y ) encodes the Gaussian depen-
dence structure of the covariance matrix Σ. Moreover, the Gaussian copula
CΣ (x, y ) can be used to generate a joint distribution function F(CX,Y ) (x, y )
by letting

F(CX,Y ) (x, y ) := CΣ (FX (x), FY (y )), x, y ∈ R, (4.6)

based on other, possibly non-Gaussian cumulative distribution functions


FX (x), FY (y ) of two random variables X and Y . In this case we note that
the marginals of the joint cumulative distribution function F(CX,Y ) (x, y ) are
FX (x) and FY (y ) because CΣ (x, y ) has uniform marginals on [0, 1].

Gumbel copula

The Gumbel copula is given by


  1/θ 
C (u, v ) = exp − (− log u)θ + (− log v )θ , 0 ⩽ u, v ⩽ 1,

with θ ⩾ 1, and C (u, v ) = uv when θ = 1.

Uniform marginals with given copulas

The following code generates random samples according to the Gaussian,


Student, and Gumbel copulas with uniform marginals, as illustrated in Fig-
ure 4.4.
install.packages("copula"); install.packages("gumbel")
library(copula);library(gumbel)
norm.cop <- normalCopula(0.35);norm.cop
persp(norm.cop, pCopula, n.grid = 51, xlab="u", ylab="v", zlab="C(u,v)", main="", sub="",
col='lightblue')
persp(norm.cop, dCopula, n.grid = 51, xlab="u", ylab="v", zlab="c(u,v)", main="", sub="",
col='lightblue')
norm <- rCopula(4000,normalCopula(0.7))
plot(norm[,1],norm[,2],cex=3,pch='.',col='blue')
stud <- rCopula(4000,tCopula(0.5,dim=2,df=1))
points(stud[,1],stud[,2],cex=3,pch='.',col='red')
gumb <- rgumbel(4000,4)
points(gumb[,1],gumb[,2],cex=3,pch='.',col='green')

" 101

This version: June 9, 2023


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

1.0
1.0

1.0
● ●●●●

●●● ●
●●● ●●● ●

● ●



● ●
●● ● ● ● ●●● ● ●●
● ●● ●●● ● ●●
●●
●●● ● ●
● ●●

● ●
● ● ●● ● ●●
●●●
● ●●



● ●● ●
●● ●


●●


●●

● ● ● ●
●● ●●●●
● ● ●
● ● ● ●●
●●● ● ● ● ●● ●●●
●●●●● ● ●● ●● ● ● ●
● ● ● ● ● ●●● ● ●●●●●●● ● ●●●


● ●●
●●

● ●●
● ● ● ●●●● ●
●● ● ● ●●
●●●● ●● ● ●

●●●

●●● ●
● ● ●
● ●● ● ●● ●● ● ●●●● ●
● ●
● ● ● ●●● ●●
● ●●●
●● ●●●● ● ●
●● ●●●● ●● ● ● ● ●● ●●●●●●
●●●
●●● ● ●● ●
● ● ●●●●
● ● ● ● ● ●● ● ● ● ● ●● ●● ● ●
●● ●● ● ●●
● ●● ● ● ● ● ● ● ●
●● ● ●● ● ●● ●
●●●●
●●●●




●●●●

● ● ●● ● ●●● ●● ● ● ● ●● ● ●●●●●●●● ● ● ● ●● ● ●● ● ●

●●●
● ●●


● ● ● ●● ● ● ●● ● ● ● ●● ● ●●● ● ● ● ● ● ● ● ● ● ●● ● ●● ●● ● ● ●● ●●● ●● ●●●●● ● ●●●●
● ● ●● ● ● ● ● ● ● ● ● ● ● ●● ●● ● ● ● ● ●●● ● ●● ●
● ●

● ●● ●● ● ● ●● ●●●●
●●● ● ●
●●
● ● ● ● ● ●
● ● ●●●
● ● ● ●● ● ● ● ● ● ● ● ●
● ●

● ● ● ● ● ● ●●● ●● ● ●● ●● ● ●● ● ●●
●● ● ●
●●●●
● ● ●●●

●●●●
● ● ● ● ● ●● ●● ● ● ● ● ● ● ● ● ● ●● ●● ● ●
●● ● ●● ●● ● ● ● ●● ● ● ● ● ●●●
●●●●●
●●●●
●●● ●●
● ● ● ● ● ● ● ●●●●● ● ●
● ● ●● ●● ●● ●
● ● ● ●● ● ● ● ● ●● ● ●● ● ● ●●●●●● ● ●●●●●● ● ●●
● ●
● ● ● ● ● ● ● ● ● ●● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ●● ●● ●●●●
● ● ● ● ●● ●● ●●●
●●● ●● ●● ● ●
● ● ●

● ●

● ● ● ●● ● ● ● ● ●● ● ● ● ● ●● ● ● ● ● ●● ● ● ● ●
●● ● ● ● ● ●● ●● ● ● ● ● ● ● ●● ● ●
●●●●●●
● ●●●●●
●● ● ●
● ● ● ●● ● ● ● ● ● ● ● ● ● ●●● ● ● ● ●●● ● ● ● ● ● ● ●● ● ●●●●
●●
● ● ● ● ●●● ●
● ● ●
●● ● ●● ● ●
● ●●● ● ● ●
● ● ● ●
● ● ● ● ● ● ● ● ●● ●
● ●● ● ● ● ●●● ● ● ●● ●
● ● ● ● ●●
●● ● ●●●
●● ●●
●●●
●●●● ●

●●
● ●
●● ●● ●● ● ●
●● ● ● ●


●● ● ● ● ● ● ● ● ● ● ●● ● ●●●● ● ● ● ● ● ●
●●●●● ● ● ● ●● ●●

●●●● ●
●●●
● ●●

●●

● ● ● ● ● ● ● ● ●● ●● ● ●● ● ●● ●● ● ● ● ● ●● ● ●●● ● ● ● ●● ● ● ● ● ● ●● ● ●●
● ● ● ● ● ●●
● ● ● ●● ● ● ● ● ● ●● ● ●● ● ●●

●●
● ●● ● ● ● ●●● ●● ● ●● ●
●● ●●
●● ● ●
● ● ●

● ● ● ● ● ● ● ●● ● ● ●● ● ●
●●● ● ●● ●● ● ● ● ● ● ● ● ● ● ● ● ●●● ●● ● ● ●● ●●●● ● ●●●● ●● ● ● ●● ● ● ●●● ● ●● ●● ●

● ●
●●●● ●●


●● ● ● ● ●● ●
●●●● ●● ●● ● ● ● ●● ● ● ● ● ● ● ●
● ● ● ●● ● ●●● ●

●● ●● ●
● ●● ● ●● ● ●● ●●● ● ●●● ●●●

●●●
●●●●● ●●● ● ●
●● ● ● ● ● ●
● ● ● ● ●● ● ●
● ● ● ● ●●● ● ● ●● ● ●● ●●● ● ● ● ● ●●●● ● ● ● ● ● ●●
●● ● ● ●● ●● ● ●●●● ● ●●●●●●●●●● ●● ●
● ● ● ●
●● ● ● ● ● ● ● ● ●● ●
● ● ● ● ●● ● ● ● ●●● ●● ●
● ● ●● ● ● ● ● ●
● ● ● ● ● ● ● ●● ● ●● ● ●●●● ● ● ● ● ● ● ● ●● ● ● ●●●● ● ●●
● ● ● ● ● ● ● ● ● ● ●●● ● ● ●●
● ●● ●● ● ● ●● ● ● ● ●● ● ● ●● ● ● ● ● ● ● ● ● ●

●● ● ● ●
●● ● ●
● ● ●● ●● ● ●●● ● ●● ●●●● ●
●● ●
● ● ● ●● ● ● ●● ● ● ● ● ● ●
●● ● ● ● ● ● ● ●
●● ● ● ● ● ● ● ●● ● ●● ● ● ● ●● ● ● ●●●● ● ●● ●● ● ● ●●● ●●●
● ● ●
● ● ● ● ●● ● ●● ● ● ● ● ●●● ●● ● ● ● ● ● ● ●
● ●● ●●● ● ●

●●●● ● ● ● ● ●● ● ●●● ● ● ● ●● ●● ● ●●● ●


● ●● ● ●
● ●● ● ● ● ● ● ●

● ●● ● ● ●● ●● ●● ● ● ●●●● ● ● ● ● ● ● ● ● ●● ● ●●


● ● ●● ● ● ●● ● ●●
●● ● ● ●● ●
● ● ●●● ●● ● ●
● ● ● ●● ● ●● ● ●
● ●
● ●● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ●● ●● ● ●● ● ● ● ●● ●● ● ● ● ●●●●
● ● ● ● ●● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ●● ●●

●●●●● ●●● ● ●
● ● ● ● ● ● ●● ● ● ●● ● ● ● ● ●
● ●
● ● ● ● ● ● ● ●●● ●●●● ●
● ● ● ●
● ● ● ● ●● ● ● ● ●●● ●● ●
● ● ● ● ● ●● ●● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ●● ● ● ● ●●● ●●● ● ● ●●● ● ●● ● ● ● ● ● ● ●●
● ●● ●
●● ●●●●
● ● ● ● ● ● ● ● ● ●● ● ●●●● ● ● ● ● ● ●● ● ● ●● ● ● ●●● ●
● ●● ● ● ●● ● ● ● ● ● ● ●
● ● ● ●
● ●●
● ● ● ●●
● ● ● ● ●
●●
● ●● ● ● ●●●● ● ● ● ● ● ●● ● ● ● ● ● ● ●●●●● ● ● ● ● ● ● ● ●● ●● ● ●●●● ●●

● ● ●● ● ● ● ● ● ● ●● ●● ● ● ● ● ● ● ● ● ● ●● ●● ● ● ● ● ● ● ●● ●● ● ● ●● ● ●●●●
● ●● ●●● ● ● ●
● ● ● ● ● ● ● ● ● ● ● ● ● ●● ●●●●● ●● ● ● ● ● ●● ● ●● ● ● ● ● ●● ● ●

0.8

0.8

0.8
●● ● ● ● ●
●●● ● ●● ●
● ●● ● ●
●● ● ● ●
●●

● ● ● ● ● ● ● ● ● ●● ● ●●

● ●● ● ● ● ●● ● ● ●● ● ●●● ● ● ●● ●● ● ● ● ● ●● ●

● ● ● ● ● ● ● ● ●● ● ● ● ● ● ●●
● ● ● ● ● ● ●● ● ●
●● ● ● ●● ● ● ●● ●● ●
● ● ● ● ●● ●● ●
● ● ●● ●● ● ●● ●● ●●
● ● ● ● ● ● ● ● ● ●● ● ● ●● ●●●●● ●

● ● ● ●● ●●

● ● ●● ● ● ● ● ●●● ● ●● ● ● ● ● ● ●
● ● ● ●
● ● ● ●

● ● ●● ● ●● ●● ● ● ●● ●● ●
● ● ● ●
●●
● ● ●●●● ●●●● ● ●●●
●● ●

● ●
● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ●●● ● ●
● ●
● ● ● ● ●● ● ●●● ● ●●
● ● ● ● ● ●
● ● ●
●● ●● ● ● ● ●●● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ●● ● ●● ●● ● ●●● ●● ● ● ● ● ●
● ● ● ● ●
● ● ●
● ● ● ● ● ●● ●● ● ● ●●
● ● ● ● ●● ● ●
● ● ● ● ●● ● ●● ●● ●
● ● ● ●
● ● ●●● ●
●●● ●● ● ● ● ● ● ● ● ● ●● ●● ● ●
● ● ● ● ● ● ● ●
● ● ●


● ● ● ● ● ● ●
● ● ● ● ●● ● ●● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ●
● ● ● ● ● ● ● ● ● ●● ● ● ● ● ●●●● ●●

● ● ● ● ● ● ● ● ● ● ●● ● ●● ● ●● ● ●
● ●● ●● ● ● ● ● ●
● ● ● ● ● ●● ● ●
● ● ● ● ● ● ● ● ●
● ● ●● ● ● ● ●
●● ●●● ●●● ● ● ●● ●●● ● ●● ●
● ● ● ●


● ●● ●● ● ●
●● ● ● ● ●●● ● ● ● ● ● ● ●

●● ● ● ● ●
● ● ● ● ● ● ● ● ●● ● ● ● ● ●
●● ● ● ● ● ●
● ●
● ●●●●●●● ● ● ●
●● ● ● ●● ● ● ● ● ●● ● ● ● ● ● ●● ● ● ● ●● ● ● ●● ● ●
● ● ● ● ●● ● ● ● ●● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ●●● ● ● ●●● ●● ● ●● ● ●● ●● ●
●●

● ●
●● ●● ● ● ● ●
● ● ●● ● ●● ●
● ● ● ●

●● ● ● ● ●●●●●● ● ● ●●● ● ●● ● ● ●
●● ● ● ● ● ● ● ● ●●●● ●● ● ●●
●● ● ● ● ● ●
● ● ●● ● ● ●
●● ●● ● ● ● ●● ● ●● ●

● ●● ●
● ● ●● ● ● ●

● ● ● ●● ● ● ● ●● ● ● ●● ●

● ● ● ● ● ● ●● ● ● ● ● ● ● ● ●● ●● ● ● ● ●
● ● ● ● ● ●● ● ●● ● ●● ●● ●
● ● ● ● ● ● ●● ● ● ●● ● ●● ● ● ●● ● ●● ●● ●● ● ● ● ● ● ● ● ● ● ●● ● ●● ● ●●● ●



● ●●
● ●● ● ● ● ● ● ●●●
● ● ●● ● ● ● ● ●● ● ● ● ● ●●
● ● ●
● ●● ● ● ● ●● ● ●● ● ● ●● ● ●● ●● ●
● ● ●

●● ●● ● ●
●●●● ● ●● ● ● ● ●● ●● ● ● ●● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ●●● ● ● ● ●

●● ● ● ●● ● ● ●● ● ● ●●● ● ●● ● ● ●● ● ● ● ● ● ●
● ●
● ●
●● ● ● ●● ● ●
● ●●● ● ●●● ●●

● ●● ● ●
● ● ●
● ● ●● ● ●● ● ●●●
● ● ●● ● ● ●●● ● ● ● ● ● ● ● ● ●
● ● ●●

● ● ● ●
● ●
● ●●
● ● ●● ● ● ●● ● ● ● ● ●● ● ●● ● ●● ● ●
● ●●●
● ●● ● ●● ● ● ● ● ● ● ● ● ● ●● ● ● ● ●● ●
● ● ●● ● ● ● ● ● ● ● ● ● ●● ● ● ●●● ● ● ● ● ● ● ● ●● ● ● ●● ●
●● ● ● ●

● ●
● ●●
● ●

●● ●
● ●
● ● ●● ●● ●
●● ●● ● ● ● ● ● ●
● ●● ●● ●●● ● ● ●●● ● ●● ● ●● ● ●● ● ● ● ● ● ● ● ●● ●●● ● ●● ● ● ● ● ● ●● ●● ● ● ● ●●
● ●●●
● ● ● ●● ● ●● ●● ● ● ● ●● ● ● ●● ● ●
● ● ●● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ●● ● ● ● ●● ● ● ●● ●● ● ● ● ● ● ● ●●

● ●● ● ● ● ● ● ● ●
● ● ●● ●●● ● ● ●● ● ● ●
●● ● ● ●● ● ● ● ● ● ●● ● ●● ● ● ● ●● ● ● ●● ● ●● ● ●● ●
● ●●● ●● ● ●● ● ● ●●
● ● ● ● ●
● ● ● ● ●●
● ●● ●● ●● ● ●●● ●● ● ● ●● ● ● ● ●● ● ● ● ● ● ● ●● ● ● ● ●●● ●● ● ● ● ● ●● ● ●● ● ● ●● ● ● ● ●●
● ●●●●●●

●● ●● ● ● ● ●


● ● ● ● ● ● ● ● ● ●● ● ● ●● ● ●
● ●●
● ● ● ● ●● ● ●● ● ● ● ● ● ● ● ● ● ● ● ●● ●● ● ● ●● ● ● ● ●● ● ●● ● ● ● ●●
● ● ● ● ● ● ●● ● ●● ●● ●
● ● ●● ● ● ● ● ●
● ● ● ● ● ● ●●
●● ●● ●● ● ● ●●
● ● ● ●● ● ●● ●● ●
●● ● ● ●● ● ● ● ● ● ● ● ● ●● ● ● ●● ●
● ● ●
●● ● ●● ●
●● ● ● ●● ● ● ● ●● ●● ● ● ●● ●
●● ●●●
● ● ● ● ● ●● ●●
● ● ●●
● ● ● ● ●●●
●● ●● ● ● ●● ● ●● ● ●●
● ●
● ● ● ●● ● ●
●● ● ● ●●●
●●●● ● ● ●● ●
● ● ● ● ●● ● ●● ●●● ● ● ● ● ●
●● ●● ● ●● ●●●● ●● ● ● ●● ● ● ● ● ● ●
●● ●
● ● ● ●● ● ● ● ●
● ● ●
● ● ● ●● ●●
● ●● ● ●● ●●● ●● ● ●● ● ●
● ●● ● ● ● ● ● ●● ● ● ●● ● ● ● ● ●● ●
● ●
● ● ● ● ●● ● ● ●● ● ● ●● ●
● ●
● ●
● ● ● ● ● ●
● ●● ● ● ●●
● ●● ●●● ● ●
● ● ● ● ● ● ● ●
● ● ●● ●● ● ● ●
● ● ●●● ●●● ● ● ● ●● ● ● ● ●● ● ● ● ● ● ● ● ● ●
●● ● ●● ●●●●● ● ●● ● ● ● ●●
● ● ●
●●
●● ●● ● ● ● ● ● ● ●●
● ● ● ● ●● ● ● ● ● ● ● ●●●● ● ● ●● ●
● ● ● ● ● ●● ● ●● ● ●● ● ●● ●
● ●
● ●● ● ●●● ●
● ● ● ●● ●● ● ● ● ● ●● ●● ● ●● ●
●● ●● ● ● ● ● ● ●● ● ● ● ● ● ● ● ●● ●●
● ● ● ● ● ●
● ● ● ●● ● ●● ● ●● ●
●● ● ●
● ● ● ● ● ● ●● ● ●
●● ●
● ● ● ●
● ● ● ●
● ● ●
● ●● ● ● ● ● ● ●●●● ●● ● ● ● ●● ● ● ●● ● ●●● ●● ● ● ●● ●
● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ●● ●● ● ●●● ● ● ●● ● ●● ● ●● ● ● ● ● ● ● ● ● ● ●● ● ●
●● ● ●

● ●
●● ●
● ● ●● ● ● ● ● ● ● ● ● ● ●● ●● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ●● ● ● ● ● ●● ● ● ● ●
●● ●
● ● ●● ● ●
● ●●
●● ●

● ●●● ● ● ●● ●● ● ● ●


●● ● ● ● ●● ● ●
● ● ●● ●
●● ● ● ● ● ● ● ● ● ●● ●● ●● ● ● ● ● ●●●●●● ●●

0.6

0.6

0.6
● ●● ● ● ●● ● ●
● ● ● ● ●● ● ● ●● ● ● ●● ●● ●●
● ● ● ● ● ● ● ●


● ● ● ● ●
●● ● ●● ● ●● ●● ● ● ● ● ● ● ● ●●
● ●●
●●● ●● ● ●● ● ● ● ●● ●● ● ● ●● ● ● ●● ●

● ●

●●
● ●● ●
● ● ● ●●●● ● ● ● ● ●●● ●●●
● ● ●●● ● ●●●● ●
●● ● ●●● ● ● ● ● ●● ● ● ●● ● ● ● ● ●●●●● ● ● ●● ● ● ● ● ● ● ● ●●● ● ● ●
● ● ●
● ● ● ● ●● ● ●● ● ● ●● ● ●● ● ●● ● ● ● ● ●● ●
●● ● ● ● ● ●●
●● ● ● ● ● ● ● ● ● ●
●● ● ● ● ●
● ● ● ● ●● ●●
● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ●
●● ● ●● ● ● ● ● ● ●● ● ● ● ● ● ● ● ●
● ● ● ● ●● ● ● ●
● ●● ●●
● ●● ● ● ● ●●
● ● ●
● ●● ● ●
● ● ●● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ●
● ● ● ● ● ●● ● ● ● ● ●
●● ● ● ● ●● ● ● ●● ● ● ●● ●●●● ● ● ● ● ●
● ● ● ● ● ● ● ● ● ● ●
● ● ● ●●●
● ●
● ●● ●● ● ●
● ●
● ● ● ● ● ● ● ● ● ● ●●
● ●● ●● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ●● ● ● ● ● ● ●● ●
● ● ● ● ●● ● ● ●
● ● ● ● ● ● ●● ● ●● ●
● ●● ● ●● ● ●●
● ●
● ● ● ●
●● ●●● ● ● ●●● ●●● ● ● ● ● ● ● ● ● ●● ● ●● ●●● ● ●●

● ● ●● ● ● ● ●● ● ● ● ● ● ● ●● ● ● ● ● ● ●●● ● ● ● ●● ●
● ●● ● ● ● ● ● ● ● ●● ● ● ● ●● ● ●● ●● ●
● ●●●● ●● ●● ●● ● ●● ● ●● ● ●● ● ●● ● ●● ●
●● ● ●● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ●● ● ●● ● ●● ● ●
● ●

●● ●
● ● ● ● ● ●● ● ● ●● ● ● ● ●● ● ●
●● ● ● ● ● ● ● ● ● ●
● ●
● ● ●
● ●● ● ● ● ● ●● ● ●● ●● ● ●● ● ●
● ● ●
● ● ●● ●● ● ● ● ● ●● ● ● ● ● ● ●● ● ● ●
● ● ● ● ● ●●●

● ●● ● ● ● ● ● ●●

● ●● ●●● ●●● ● ●●
● ● ●● ●●
● ● ● ●
● ● ● ● ●

● ● ●●
● ● ● ●● ●● ●● ● ●● ●
● ●●
●● ● ● ●● ●● ●● ● ●● ●
● ● ● ● ● ●● ●● ●●● ●● ●
● ●●● ●●●
● ●●
● ● ●
● ●●● ● ●●● ●●● ● ●● ● ●
● ●● ● ● ●●● ● ● ● ● ● ● ● ● ● ● ●
● ●● ●●● ● ● ● ●●
● ●● ●●
● ●
● ● ●● ● ● ●● ● ●●
● ●●●●● ● ● ● ●● ●
● ● ● ● ● ●
● ● ●● ●● ●
● ●● ● ● ● ● ● ● ● ● ● ● ● ●●●● ● ●● ● ● ● ●
●● ● ● ● ● ● ●

● ●● ● ● ●● ● ●● ●●●
● ● ● ● ●● ● ●● ●

● ● ●


● ●
● ●● ● ● ● ● ● ● ● ● ● ●● ● ●● ●
● ● ● ●●
● ●● ● ● ● ● ● ● ● ●● ● ●● ●● ● ●
●●

●●● ● ● ●● ●●● ●●● ● ●
● ● ● ●● ●
● ● ● ● ● ● ● ● ● ●● ● ●
●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●
● ● ● ● ●● ●●

● ●
● ●
● ● ● ● ● ●● ●●● ●● ● ● ●● ● ●● ● ●
●● ●●
● ●● ● ● ● ●
● ● ●
● ● ●●● ● ●● ● ● ● ● ● ● ● ●
● ●●
● ● ●● ● ● ● ● ● ●● ● ●●
●● ●
● ● ● ● ●● ● ● ● ●● ●

● ● ● ● ● ● ● ● ●
● ● ● ●
● ● ● ● ● ● ● ●

● ● ● ● ●● ●●●● ● ●
● ● ●● ●
● ● ● ●● ● ●● ● ●
● ● ●
● ● ●
● ● ● ●● ● ●● ● ●
● ● ● ● ● ● ● ● ●

● ● ●
● ● ●
●● ● ● ●● ● ● ●● ● ● ● ● ● ● ● ●
● ● ● ●●
● ● ● ● ● ● ● ● ●
● ●●●● ● ● ●● ● ● ● ●● ● ●

● ● ● ●
● ● ● ●
●● ●●● ● ● ● ●● ● ● ● ● ● ● ●● ● ● ●●● ● ●● ● ● ● ● ● ● ● ●●●● ● ● ● ●
●● ●
● ●●
● ● ● ●● ●
● ●
● ● ●● ● ● ● ●● ● ● ● ●
●● ● ●● ● ● ● ●● ● ● ●● ●● ● ●
●● ● ● ●● ●
● ● ● ● ●
● ●●● ● ● ●● ●
● ● ● ● ● ●
●● ● ● ● ●● ● ● ● ● ●● ●● ● ● ● ● ●●● ● ● ● ● ● ● ● ● ●●

● ● ● ●● ● ●●●
●● ●● ●
● ● ● ● ● ● ● ● ● ● ● ● ●● ● ●● ● ●
●● ● ●● ● ● ● ● ● ● ● ● ●● ● ●
● ●●●
● ● ● ●● ●●● ● ● ● ● ● ● ●● ● ● ●● ●
● ● ● ● ● ●
● ●● ●● ● ● ● ● ● ● ● ● ●
● ● ●

● ● ● ●
● ● ●
●● ● ● ● ● ● ● ●● ● ●● ●● ● ● ●
● ●
● ● ● ● ● ●● ●
● ● ●

● ● ● ●●
● ● ●●
● ●● ● ●
●● ● ● ● ●
● ●● ●●●
● ●
●● ● ● ● ●● ●● ●●● ● ●● ●● ● ● ● ● ● ● ● ● ●● ●● ●● ● ● ●● ●●● ●●
● ●● ● ● ●
●●
● ● ● ● ● ● ●● ●● ● ● ●● ● ● ● ● ●
● ● ● ● ● ● ● ● ● ● ● ● ● ●
● ●

● ● ● ● ● ● ● ● ●●● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ●● ●● ● ● ●●● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ●● ●●●● ● ● ●
● ●
● ●●● ● ● ● ● ●● ● ● ●● ● ● ● ● ● ●● ●● ● ● ● ● ● ●
● ●● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●
● ● ●●● ● ● ● ● ●● ● ● ● ● ●● ● ● ● ● ●● ● ● ● ● ●
●● ●● ● ● ●●● ●
● ● ● ● ● ● ● ● ●●
●●
● ● ●● ● ● ● ●● ● ●● ● ●● ● ● ● ●● ● ● ● ● ● ● ● ●
● ● ● ●● ●
● ●● ● ● ●
● ● ● ● ● ●● ● ● ● ● ● ● ●

●● ● ● ●● ● ●●● ● ●

● ● ● ●● ●● ●
● ● ● ●● ● ● ●
● ● ● ●
● ● ● ●● ● ● ●●● ●● ● ● ●
●● ●● ● ● ● ● ●
● ● ●●
● ●
● ● ● ● ● ● ●● ● ● ● ●● ● ● ● ● ● ● ● ●
●● ● ● ●
●●●● ● ●● ●●●
● ●● ● ●● ●
● ●
● ● ●● ● ●● ● ● ● ●● ● ●● ● ●● ● ● ●
● ● ● ●
● ● ● ● ● ● ●● ● ● ●● ● ●● ● ● ● ● ● ●
● ● ● ● ● ● ● ● ●● ● ●●● ●● ●● ● ●
● ● ● ●● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ●● ●● ●
● ● ● ●
● ● ●● ● ● ● ● ● ● ● ●● ● ● ●● ● ● ●

● ● ●●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ●● ●● ● ●● ●
● ●● ● ● ● ● ● ●●● ● ●
● ● ●● ●●

●● ● ●● ●●●●● ●
● ● ● ●
● ● ●● ● ● ●● ● ● ● ● ● ● ● ● ●
● ● ● ●
● ●● ● ● ● ● ● ●● ●● ●●● ●● ● ● ●● ● ●● ● ● ● ● ● ●● ● ● ●● ●● ● ● ●● ●
● ● ● ● ●● ●● ● ● ● ● ● ●● ● ● ● ● ● ●● ● ●● ● ● ●
● ● ● ● ● ●● ● ● ●● ● ● ● ●
●● ● ● ●
● ●● ●● ● ● ● ● ●● ●● ● ●● ●● ● ● ●● ●
●● ● ● ● ● ● ● ● ●

0.4
● ●

0.4
0.4

● ● ● ●● ●●● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ●●
● ● ● ● ●● ● ● ●● ●● ●
● ● ● ●● ● ●● ●● ● ● ● ● ●
● ● ● ● ●●
●●● ● ● ●● ● ●● ●
● ● ● ● ●● ● ● ●● ● ●●●●
● ● ● ●
● ●● ● ● ●
● ● ● ●● ●● ● ● ● ● ● ●● ● ● ● ● ● ● ● ●
● ●● ● ●● ● ● ● ● ● ● ● ● ● ● ● ●●● ●● ●● ●● ● ● ●● ● ● ● ● ●● ● ● ●
●● ● ● ●●● ● ● ● ● ● ● ● ●
● ●●● ● ● ● ●● ● ● ● ● ●
● ● ● ●●
●● ● ●● ● ● ● ● ● ● ●
● ●● ●●● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ●● ● ●●● ● ● ● ●● ●
● ● ●
● ● ● ● ● ●● ● ● ●●● ● ●
●● ●● ● ● ●● ● ●● ● ● ●● ● ●● ● ●● ● ● ●● ● ●●● ●● ●
● ● ●
● ● ● ●
● ● ● ●
● ●
● ●
● ● ●● ● ● ● ● ● ● ●● ● ● ● ● ●
● ● ●
●●
●●●●●● ● ● ● ● ● ●
●● ● ● ● ● ●
●●● ● ●

● ● ● ● ● ● ●● ●
● ● ● ● ● ● ● ● ● ● ●● ●● ● ●● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ●● ● ●● ● ● ● ● ● ●
● ●● ● ● ● ●
● ●
● ● ● ● ●● ● ●● ●
● ● ●● ●● ● ● ● ● ● ●● ● ●
● ● ● ●●● ● ●

● ● ● ● ● ●
● ● ●●
● ● ●
●● ● ● ●
● ● ● ● ●● ● ● ● ● ●● ● ● ● ● ● ● ●● ●●● ● ● ● ● ●●● ● ● ● ● ● ●
● ●● ● ● ●
● ● ● ●● ●● ● ● ●● ● ●● ● ● ●● ● ● ● ●
● ● ●
●● ● ● ● ● ● ● ●● ● ●● ●
● ●
● ● ● ● ● ● ● ●● ● ● ●●● ● ● ● ● ● ●●
● ● ●●●● ● ● ● ● ●
● ● ●● ● ● ●● ● ● ● ●
● ● ● ● ● ● ● ●
● ● ●● ●●


● ● ● ● ●●● ● ● ● ●● ●
● ●● ● ● ● ● ●
● ● ●● ● ● ● ● ●
● ●● ● ● ● ● ● ● ● ● ● ● ●● ●● ● ● ● ● ● ●● ● ● ● ●● ●● ● ● ● ●● ●● ●
●● ●● ● ● ●● ●
● ● ● ●● ● ●● ●● ● ● ● ● ● ● ● ●● ● ● ● ●● ●● ● ●
● ● ● ● ● ●● ●
● ● ● ● ● ●●● ●
●●● ●● ●
● ●●
● ● ●● ● ●● ● ●

● ●
● ● ● ●
●●
● ● ●● ●● ●
●● ● ● ● ● ● ●● ● ● ● ● ● ●
● ● ●
● ● ● ●
● ●● ● ●● ● ●●● ● ● ● ● ●● ● ●● ● ● ●●● ●


●● ● ● ● ●● ● ● ●● ● ●● ● ●● ● ● ●
● ●
● ● ● ● ● ● ● ●●● ● ●● ● ● ● ●● ● ● ● ●
● ●● ●

● ●● ● ● ●● ● ●● ●● ● ● ● ● ●
● ● ● ●● ● ● ● ● ● ● ●● ● ● ● ● ●● ● ●● ● ●●● ● ● ● ● ● ● ● ●● ● ● ● ● ● ●●
● ●
●● ● ● ● ● ●●●

●● ●● ● ●
● ●
● ●● ●● ● ● ●●● ● ● ● ● ● ● ● ● ● ● ● ● ●● ●●●●● ● ● ● ● ● ●● ● ● ● ●●●
● ● ●
● ● ● ● ●●
● ● ● ●
●●
●● ●● ●● ● ●
● ●● ●
● ● ● ● ● ● ● ●● ●
● ● ●●

● ●● ● ● ● ●● ● ● ●● ● ●●● ● ●●● ● ●● ●● ●● ● ● ● ● ●●● ●
●● ● ●
● ● ● ● ● ● ●● ● ●● ● ● ● ● ●● ● ● ● ● ● ● ●● ●● ●●●● ●● ●● ● ● ● ● ●
● ●● ● ●● ●● ● ● ●●● ● ● ● ●
● ● ● ● ● ● ● ● ●
●● ● ●● ● ● ● ● ● ● ● ● ●
● ●
● ● ● ● ● ● ● ●● ●● ● ● ● ● ● ● ●
● ● ●●● ● ●●
● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ●● ● ●●● ● ●● ● ● ● ●

● ● ●● ● ● ●● ● ●●● ●
● ● ● ●●● ● ●● ●● ●
●● ● ●● ● ● ● ● ● ● ● ● ● ● ● ●
● ● ●● ● ● ● ● ●● ● ● ● ● ● ●● ●● ● ● ● ● ● ●●

● ●
● ● ●
●● ●

● ●●

● ● ● ● ●● ● ● ● ●● ● ● ●● ●●

● ●●
●●
● ● ● ●● ● ● ●
● ● ●● ● ●●●● ● ●● ● ●●●●

●●●●●●●● ●● ● ● ● ●● ● ●●● ● ● ● ●●● ● ●● ●● ●
●● ● ●
● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ●● ● ● ● ●● ● ●● ● ● ● ● ●● ●●● ● ● ●

●● ● ● ●● ● ● ● ● ●●●● ● ● ●● ● ● ● ●●● ● ● ● ● ● ● ● ● ● ●● ● ● ●●
● ● ● ● ● ●● ●● ●●● ●● ● ●● ●
● ● ● ● ●
●● ● ●● ● ● ●● ● ● ● ● ● ● ●● ● ● ●● ● ● ● ●● ● ● ● ● ●●● ● ●●● ● ●
● ●
●● ●● ● ● ● ● ● ● ● ●● ● ●
● ● ●
● ● ● ● ● ●● ● ● ●●●● ● ●
●● ● ● ● ● ●●●● ● ● ●● ● ● ● ● ●

● ● ● ● ● ● ●● ● ●
●● ● ● ●●● ● ● ●
● ● ● ● ● ● ● ● ● ● ● ●
● ● ● ● ● ● ●● ● ● ●
● ● ● ● ● ●
● ● ●● ●● ●● ● ● ●● ● ● ●● ● ●● ● ● ●
●● ● ● ● ●● ● ● ● ● ●

●● ● ● ●● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ●
● ● ●
● ● ● ●● ● ● ●● ●
●●
●● ● ● ●● ● ● ● ● ●
● ● ● ● ●● ● ● ● ●● ● ● ● ● ● ● ●
● ●● ● ●● ● ● ● ● ●● ● ● ● ● ● ● ● ●
● ● ● ● ●● ●
● ●●● ● ●● ●
●● ●● ● ● ● ●
● ● ●
●●
● ●● ●● ● ● ● ● ●
●●
● ● ● ●
● ●
● ● ●● ● ● ● ● ● ● ●
● ● ● ●●● ●●●●
●● ● ●
●● ●● ● ●
●● ● ● ●
●●● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ●● ●● ●● ● ● ● ● ●● ● ●
● ●
● ● ● ●● ● ●● ● ● ●● ● ● ● ● ● ● ● ● ● ●● ● ● ● ●● ● ● ●● ● ● ● ● ●● ● ● ● ● ● ●● ●● ● ● ● ● ●
● ●
● ●● ● ● ●● ●●

●● ●● ● ● ● ● ● ● ●
● ● ● ● ● ● ● ● ● ● ● ● ● ●●

● ● ●● ● ● ●
●●● ● ● ●●● ●
●●
● ● ● ● ●● ● ● ● ● ●


● ●
●●
● ● ● ● ● ● ● ●
● ●
● ● ● ● ●● ●● ● ● ●●● ● ● ● ● ●● ● ● ● ● ●
● ● ● ●
● ● ● ●● ● ●●

● ● ● ● ●● ●●
● ● ●

● ●
● ● ●● ●●●● ● ● ● ●● ●
● ● ●● ● ● ●● ● ●● ● ● ●●●●● ● ● ●
●● ● ● ● ● ● ●● ● ● ●● ● ●●● ● ● ●● ●●
● ●● ●●
● ● ● ● ● ● ● ●●●● ● ● ● ● ● ● ● ●● ● ● ● ●● ●
● ● ●●● ● ● ● ● ●● ● ● ● ● ●● ●● ● ●● ●● ● ● ● ● ●
●● ● ● ● ●● ● ● ●
● ● ● ● ●
● ● ● ● ●● ● ● ● ● ●● ● ● ●
●● ● ●● ● ● ● ● ● ● ● ● ● ●● ● ●●

●● ● ●
● ● ●●● ●
● ● ● ● ● ● ● ● ●● ● ● ● ●● ● ● ● ● ● ●● ●
● ● ● ●●
●● ●● ●
● ●●● ●●

● ●

● ● ●● ● ●●●
●● ● ● ●● ●●●
● ● ● ●● ● ●
● ●●● ● ● ●● ● ●● ● ● ● ● ●● ● ●● ● ● ●● ●● ● ● ●●● ●● ● ● ● ● ● ●
● ●● ● ● ● ● ● ●
● ● ● ● ● ● ●
●●● ●● ● ●●● ●● ● ● ● ● ● ● ● ● ● ● ● ● ●●
● ●● ●●●

0.2
● ●●●

0.2
0.2

● ● ●● ● ● ● ● ● ● ● ●
● ●●● ● ● ●
● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●
● ●●● ● ● ● ●● ●● ● ● ● ● ● ● ● ● ● ●● ● ●
●● ●● ● ● ● ● ●
● ● ● ●● ● ● ● ●● ●● ● ● ●● ● ● ● ● ● ● ●
●●
● ● ● ● ● ●● ● ● ● ● ● ● ●
● ●
● ●

● ●● ●●
● ● ● ● ● ● ● ● ● ●
● ● ● ●● ● ● ●●
● ●●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ●
●● ● ● ●● ● ●●● ●●
● ● ●●
●● ● ●● ●
● ●●● ●● ● ● ● ● ● ● ●●● ● ● ● ● ● ● ●● ● ● ●
● ●● ● ●
●● ● ● ●
●● ● ●● ●● ●● ● ●
●● ●
● ● ● ● ●●● ●●● ● ● ● ● ●● ● ● ● ● ● ● ● ● ●●●●● ● ● ●● ● ●
● ●● ● ●● ● ● ● ● ●● ●●●● ●
● ●● ● ● ● ●● ● ●● ●● ● ●
● ● ● ●
●●●● ●● ● ●
● ● ●● ●● ● ● ● ●

● ● ● ● ●●● ● ● ● ● ● ● ● ● ●

● ●●● ● ●●
●● ● ●
● ● ● ● ● ● ● ●● ●● ● ●● ●

● ●● ● ● ●●
● ●
●● ● ●● ● ●
● ●● ● ●
● ●● ● ● ● ●● ●● ●●● ● ● ● ●● ● ● ● ● ●● ● ● ● ● ●● ● ● ● ● ● ● ●

● ●●
● ●●
● ● ● ● ● ●● ● ●● ●● ● ● ●● ● ●●
● ●● ●
● ● ● ● ● ● ●● ●●● ●● ● ● ●
● ●● ● ● ● ●● ● ●●● ● ● ● ● ● ●
●● ● ●●

● ● ●●●● ● ● ●
● ●● ●

● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ●●
● ● ● ●●
●●
● ● ●● ● ● ● ●● ● ●●● ● ●●● ●●● ● ● ●● ●
● ● ● ● ● ● ● ●● ● ● ● ● ●●● ● ● ● ●● ● ●● ●
●● ● ● ●●● ● ● ●● ● ●● ● ● ● ● ● ●
● ●● ● ●● ●●
● ●
● ● ●● ● ●● ●●●●● ● ●●
● ● ●● ●● ●
● ● ● ● ●●● ●●● ● ● ● ● ●


● ● ● ● ●● ●●● ● ●
●● ●


● ● ● ● ●● ● ● ● ● ● ● ● ●● ● ● ●● ● ● ●●● ● ● ● ● ●● ● ●
●● ● ●● ●

●● ● ● ●● ●● ● ●● ●
● ●
● ● ● ● ●●● ● ● ●●
● ●● ● ● ●●● ●
● ● ● ●● ●● ● ● ● ● ● ● ●
● ● ●● ● ●● ● ● ●● ● ●● ● ● ● ● ● ● ●
● ●●
● ● ● ●● ● ●● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ●● ● ● ●● ●● ●● ●
● ● ●●● ●
● ● ● ● ● ● ● ● ● ●● ●● ● ●
●● ● ●● ● ●
● ●● ●●
● ● ● ● ● ● ● ● ● ●●
●● ● ●● ● ● ● ● ●● ●● ● ●● ● ●● ● ●
● ●●
● ● ● ● ● ● ● ●
●● ● ●

● ● ●● ● ●
●● ●●●● ● ● ● ● ● ● ●●● ● ●● ● ●● ●● ● ●● ●● ● ● ● ●●● ●● ● ● ● ● ●● ● ●
● ● ●● ● ● ●● ●● ●● ● ● ● ● ●● ● ● ●●● ● ●●●● ● ● ●● ● ●● ● ● ●● ● ●●
●●
● ● ●●

●● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ●● ●● ● ●

● ●●● ●
● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ●● ●●● ● ●● ● ● ● ● ●●● ●●● ● ●● ●● ●●●● ●● ●● ● ● ●● ●
● ●● ●● ● ● ●

● ●●
●●
● ●● ● ● ● ●●
● ● ●●● ● ● ●● ● ● ● ● ● ●
● ● ●
● ● ● ●● ●
●●●
● ●● ● ●● ● ●● ● ●● ● ● ●●
●● ● ● ● ●
● ● ●● ●
● ●● ● ● ●● ● ● ● ● ●
● ● ● ●
● ●●● ●● ● ● ●● ● ●
● ● ● ● ● ● ●● ● ●●●
● ●● ● ● ●●●● ●● ●●
● ●● ● ● ●● ●

●● ● ● ●●● ● ● ● ● ● ● ● ● ● ● ●
● ●● ● ● ● ● ● ● ●●
● ● ● ●● ● ● ●● ●●● ● ● ●
●● ●
● ● ● ●● ●● ● ●
● ● ●● ●● ● ● ●● ● ● ●● ●
●●● ●● ● ● ●● ● ● ● ●
● ●
● ● ● ● ● ● ● ●●●● ● ● ●● ● ●
● ● ● ●● ● ●
●● ● ●● ●
● ●●●● ● ● ● ● ●● ● ● ● ● ● ●● ● ● ●● ● ●● ● ●●● ● ●● ● ● ● ●
●●●
● ●●● ● ● ● ● ● ● ●● ●● ● ● ● ● ● ● ● ● ●
● ● ● ● ● ●● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ●● ●●● ●● ● ● ●●● ● ●●
●●● ● ●● ●● ● ●●
● ●●● ● ●
● ●● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ●●
● ● ●●●●● ● ●
● ●●
● ● ● ● ● ●●● ● ●● ●
● ● ●● ●
● ● ●● ● ●● ●● ● ● ● ● ●
●● ● ● ●● ●
● ● ● ● ● ●
●● ●
●● ● ● ● ● ● ●●●●● ●● ●
●●●● ● ● ● ● ●● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ●●●● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ●
●● ●● ●● ● ●●
● ● ●
● ● ●● ● ● ● ●
● ● ● ● ● ● ●●●● ● ● ● ●● ● ●
● ● ● ● ● ●● ● ● ● ● ●●
● ● ● ● ●●
● ● ●● ● ● ● ● ●
●● ● ● ●●●●
● ● ● ● ● ● ● ● ●
● ● ● ● ● ● ● ●● ● ● ● ●● ● ● ●● ●● ● ● ● ● ●● ● ●● ● ● ●●●●●

● ● ●● ● ●
● ●
●●● ●●

● ● ●● ●● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ●
●●● ● ● ● ●● ● ●● ● ● ●
●●● ● ● ●● ● ● ● ●● ● ●● ●●● ● ● ● ● ●●
● ● ● ● ●● ●●●
●● ●●●●● ● ●● ●● ● ● ● ●● ● ● ● ●
●●●● ●●● ● ● ●● ● ● ● ● ● ● ●● ● ● ● ● ● ●● ● ● ●● ●●●
● ●● ● ●●● ● ● ●● ●●●● ● ● ●● ● ● ● ●
● ● ● ● ● ●● ● ● ● ● ● ●● ●
● ● ● ●● ●● ● ● ●● ●
● ● ● ●● ●●
●● ● ●● ●
● ● ●●● ● ●● ● ●●
● ● ●● ● ● ● ● ● ● ● ● ● ●● ●●
●● ● ●● ● ●● ● ●● ● ● ● ● ● ● ● ●
● ● ● ● ●●●
● ● ●●
● ●
●● ● ●
● ●●● ●● ● ● ● ●●●●●● ●

●●● ● ● ● ●

● ●
●● ●● ● ●● ● ● ●● ● ● ● ● ● ● ●●● ● ●●● ● ● ● ●● ● ● ● ● ● ● ● ●●●●●●●●●
●● ● ●●
● ● ●● ● ●● ● ●
● ● ●
●●● ●● ●● ● ● ●
●● ●

●● ● ● ● ● ● ●● ● ●● ● ●● ●● ● ● ● ● ●● ● ● ● ●● ●●● ● ● ●● ● ● ●
● ●● ● ●
●● ●● ● ● ● ●●● ● ●●●●● ●●● ● ● ● ● ●●● ●
● ●● ●● ●● ● ● ●●● ● ●

●● ● ●●
●● ● ●

●● ● ● ●
● ●●● ● ●● ●●● ● ● ● ●● ● ●
●●●● ●● ● ●●
● ●●●● ●● ● ●● ● ● ●
● ●● ●●●●● ●● ●●
● ●● ●● ●● ● ● ● ●● ● ● ●●
● ●●●●● ●● ● ● ● ●● ● ● ● ● ●●
●● ●●●
●● ●● ●● ● ● ●●●● ●●
● ●
● ● ● ● ● ●● ●● ● ●● ● ● ●
● ● ●● ●●●●● ●● ●●●● ●●
● ● ●
● ● ●●●
● ● ● ● ●●

0.0
●●●●

0.0
● ●● ●
0.0

●●●
●● ● ● ● ● ● ● ● ●●
●●●● ● ● ● ● ● ●●●● ●● ● ●●●●●
● ●
● ● ●
●●●●●●● ● ●● ● ● ●● ● ● ● ●●●
● ●● ● ● ● ●● ● ● ●
●●●● ●
●●●●● ●● ● ●● ●
● ● ● ● ● ●

●● ● ●●●● ● ●● ●● ● ●● ● ●● ●● ● ● ● ● ● ● ●


●●


● ●● ● ● ● ● ● ● ●● ●● ● ● ●
●● ●●
● ● ●
● ● ● ● ● ●
●●● ●● ●●●●●● ● ● ●● ● ● ● ●






●● ● ●●●● ● ●


●●

●●
●●
●●
● ●●

0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.2 0.4 0.6 0.8 1.0

(a) Gaussian copula. (b) Student copula. (c) Gumbel copula.


Fig. 4.4: Samples with uniform marginals and given copulas.

The following code is plotting the histograms of Figure 4.4.


joint_hist <- function(u) {x <- u[,1]; y <- u[,2]
xhist <- hist(x, breaks=40,plot=FALSE) ; yhist <- hist(y, breaks=40,plot=FALSE)
top <- max(c(xhist$counts, yhist$counts))
nf <- layout(matrix(c(2,0,1,3),2,2,byrow=TRUE), c(3,1), c(1,3), TRUE)
par(mar=c(3,3,1,1))
plot(x, y, xlab="", ylab="",col="blue",pch=19,cex=0.4)
points(x, -0.01+rep(min(y),length(x)), xlab="", ylab="",col="black",pch=18,cex=0.8)
points(-0.01+rep(min(x),length(y)), y, xlab="", ylab="",col="black",pch=18,cex=0.8)
par(mar=c(0,3,1,1))
barplot(xhist$counts, axes=FALSE, ylim=c(0, top), space=0,col="purple")
par(mar=c(3,0,1,1))
barplot(yhist$counts, axes=FALSE, xlim=c(0, top), space=0, horiz=TRUE,col="purple")}
joint_hist(norm);joint_hist(stud);joint_hist(gumb)

Gaussian marginals with given copulas

(a) Gaussian copula. (b) Student copula. (c) Gumbel copula.


Fig. 4.5: Samples with Gaussian marginals and given copulas.

102 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

The next code generates random samples according to the Gaussian, Stu-
dent, and Gumbel copulas with Gaussian marginals, as illustrated in Fig-
ure 4.5.
set.seed(100);N=10000
gaussMVD<-mvdc(normalCopula(0.8), margins=c("norm","norm"),
paramMargins=list(list(mean=0,sd=1),list(mean=0,sd=1)))
norm <- rMvdc(N,gaussMVD)
studentMVD<-mvdc(tCopula(0.5,dim=2,df=1), margins=c("norm","norm"),
paramMargins=list(list(mean=0,sd=1),list(mean=0,sd=1)))
stud <- rMvdc(N,studentMVD)
gumbelMVD<-mvdc(gumbelCopula(param=4, dim=2), margins=c("norm","norm"),
paramMargins=list(list(mean=0,sd=1),list(mean=0,sd=1)))
gumb <- rMvdc(N,gumbelMVD)
plot(norm[,1],norm[,2],cex=3,pch='.',col='blue')
points(norm[,1], -0.01+rep(min(norm[,2]),N), xlab="", ylab="",col="black",pch=18,cex=0.8)
points(-0.01+rep(min(norm[,1]),N), norm[,2], xlab="", ylab="",col="black",pch=18,cex=0.8)
plot(stud[,1],stud[,2],cex=3,pch='.',col='blue')
points(stud[,1], -0.01+rep(min(stud[,2]),N), xlab="", ylab="",col="black",pch=18,cex=0.8)
points(-0.01+rep(min(stud[,1]),N), stud[,2], xlab="", ylab="",col="black",pch=18,cex=0.8)
plot(gumb[,1],gumb[,2],cex=3,pch='.',col='blue')
points(gumb[,1], -0.01+rep(min(gumb[,2]),N), xlab="", ylab="",col="black",pch=18,cex=0.8)
points(-0.01+rep(min(gumb[,1]),N), gumb[,2], xlab="", ylab="",col="black",pch=18,cex=0.8)
joint_hist(norm);joint_hist(stud);joint_hist(gumb)

0.20 0.25 0.4


0.15 0.20
0.3
0.15
0.10 0.2
0.10
0.05 0.05 0.1

0.00 0.0
3 3 3
2 2 2
1 1 1
3 3 3
0 0 0
2 2 2
x2

x2

x2

−1 1 −1 1 −1 1
0 0 0
−2 −1 x1 −2 −1 x1 −2 −1 x1

−2 −2 −2
−3 −3 −3
−3 −3 −3

(a) Gaussian copula. (b) Student copula. (c) Gumbel copula.

Fig. 4.6: Joint densities with Gaussian marginals and given copulas.

The following code is plotting joint densities with Gaussian marginals and
given copulas, as illustrated in Figure 4.6.
persp(gaussMVD, dMvdc, xlim = c(-3,3), ylim=c(-3,3),col="lightblue")
persp(studentMVD, dMvdc, xlim = c(-3,3), ylim=c(-3,3),col="lightblue")
persp(gumbelMVD, dMvdc, xlim = c(-3,3), ylim=c(-3,3),col="lightblue")

" 103

This version: June 9, 2023


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

3
2

2
0.06 0.06
1

1
0.05
0.16 0.15 0.16
0.12 0.12
4 0.2 4 0.2
0.0 2 0.0 2
2 4 2 4
0.0 0.1 0.0 0.1
0

0
Y

Y
25
4

4
0.2

0.2
0.
0.2

0.2
0.2
0.18 0.18
−1

−1

−1
0.1

0.1
0.1
0.0 0.0
8 8
−2

−2

−2
−3

−3

−3
−3 −2 −1 0 1 2 3 −3 −2 −1 0 1 2 3 −3 −2 −1 0 1 2 3
X X X

(a) Gaussian copula. (b) Student copula. (c) Gumbel copula.

Fig. 4.7: Joint density contour plots with Gaussian marginals and given copulas.

The following code generates countour plots with Gaussian marginals and
given copulas, as illustrated in Figure 4.7.
contour(gaussMVD,dMvdc,xlim=c(-3,3),ylim=c(-3,3),nlevels=10,xlab="X",ylab="Y",cex.axis=1.5)
contour(studentMVD,dMvdc,xlim=c(-3,3),ylim=c(-3,3),nlevels=10,xlab="X",ylab="Y",cex.axis=1.5)
contour(gaussMVD,dMvdc,xlim=c(-3,3),ylim=c(-3,3),nlevels=10,xlab="X",ylab="Y",cex.axis=1.5)

Exponential marginals with given copulas

The following code generates random samples with exponential marginals


according to the Gaussian, Student, and Gumbel copulas as illustrated in
Figure 4.8.
library(copula);set.seed(100);N=4000
gaussMVD<-mvdc(normalCopula(0.7), margins=c("exp","exp"),
paramMargins=list(list(rate=1),list(rate=1)))
norm <- rMvdc(N,gaussMVD)
studentMVD<-mvdc(tCopula(0.5,dim=2,df=1), margins=c("exp","exp"),
paramMargins=list(list(rate=1),list(rate=1)))
stud <- rMvdc(N,studentMVD)
gumbelMVD<-mvdc(gumbelCopula(param=4, dim=2), margins=c("exp","exp"),
paramMargins=list(list(rate=1),list(rate=1)))
gumb <- rMvdc(N,gumbelMVD)
plot(norm[,1],norm[,2],cex=3,pch='.',col='blue')
plot(stud[,1],stud[,2],cex=3,pch='.',col='blue')
plot(gumb[,1],gumb[,2],cex=3,pch='.',col='blue')
persp(gaussMVD, dMvdc, xlim = c(0,1), ylim=c(0,1), col='lightblue')
persp(studentMVD, dMvdc, xlim = c(0,1), ylim=c(0,1), col='lightblue')
persp(gumbelMVD, dMvdc, xlim = c(0,1), ylim=c(0,1), col='lightblue')
contour(gaussMVD,dMvdc,xlim=c(0,1),ylim=c(0,1),nlevels=10,xlab="X",ylab="Y",cex.axis=1.5)
contour(studentMVD,dMvdc,xlim=c(0,1),ylim=c(0,1),nlevels=10,xlab="X",ylab="Y",cex.axis=1.5)
contour(gaussMVD,dMvdc,xlim=c(0,1),ylim=c(0,1),nlevels=10,xlab="X",ylab="Y",cex.axis=1.5)
joint_hist(norm);joint_hist(stud);joint_hist(gumb)

104 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

8
● ● ●

8

● ●


● ●


● ●
● ● ●
● ●


6

● ● ●

6

● ●

● ●

● ● ●
● ● ●
● ● ●
● ● ●

● ● ●
● ● ●●

● ● ●
● ● ● ● ●
● ●
● ●● ●
● ●● ● ● ● ●

●● ●● ●
● ● ● ● ●
● ● ●
● ●● ●
● ● ●
● ● ● ●

● ● ● ●●
● ● ● ● ● ●
● ● ● ●
● ●
● ● ● ● ●
● ● ● ●
● ● ●
● ● ● ● ● ●
● ● ● ● ● ●● ●●
● ● ● ● ● ● ● ● ●
● ● ● ● ●
● ● ● ●● ●
● ● ● ● ● ●
● ● ●●● ● ●
● ● ● ● ● ● ●
● ● ● ● ● ● ● ● ●● ●
●● ● ● ● ●●
● ● ● ● ● ● ● ●

4

● ● ●● ● ● ●
● ● ● ● ● ● ●

4
● ●●

4
● ● ● ● ● ● ●●
● ● ● ● ● ●
●● ●●
● ● ● ● ● ● ●●
● ● ● ●● ● ● ● ● ● ●
● ● ● ● ● ● ●●
● ● ● ● ● ●● ● ●
● ●
●● ● ● ●●
●● ● ● ● ● ● ● ● ● ● ● ● ●
● ● ●
● ● ● ● ● ● ● ● ● ● ● ●● ● ●● ●● ● ● ● ●● ●
● ● ● ● ● ● ● ●● ● ● ●●
● ● ●
● ● ● ●●
● ● ● ● ● ● ● ●●
● ● ● ● ●● ●
●● ●

● ● ●
● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●●
● ●

● ● ● ● ● ● ●
● ● ● ● ●
● ● ● ● ● ●● ● ●
● ● ● ● ● ● ●● ● ● ● ●● ● ● ●
● ● ● ● ● ● ● ●
●● ●

● ●
●●


● ●● ● ●● ●
● ●●
● ● ● ● ● ● ●●● ●
● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ●
● ● ● ● ● ● ● ● ● ● ●


● ● ●● ● ● ● ● ●
● ● ● ● ● ● ●● ●
●●


● ● ● ● ● ● ● ● ● ● ●● ● ● ● ●●
● ●● ● ●● ●●● ● ● ● ● ● ● ● ● ●
● ●● ● ●
● ● ● ● ● ● ●● ●● ● ● ●● ●● ● ●
● ● ●
●● ● ● ●● ●
● ● ● ●● ●
● ● ●● ● ● ●●●
● ● ●●
● ● ●● ● ● ●● ● ● ● ● ● ● ●
● ●●
● ● ● ●
● ● ● ●●● ● ●
●●
● ●● ● ● ● ●● ● ● ●● ●
● ● ● ● ●
● ●● ●

●● ● ● ● ● ● ● ●● ● ● ● ●
●● ● ●●

● ● ●●●●
● ●● ●
● ● ●
●●● ●● ● ●● ● ● ● ● ● ●
● ● ● ● ●●● ● ● ● ●● ●
● ● ●● ● ● ● ●● ●
● ● ● ●
● ●

● ● ●●
● ● ●● ● ● ●
● ●● ● ●●● ● ●● ●●
●● ● ●
● ● ● ● ● ● ● ● ●● ● ● ● ●
● ●● ●●● ●
● ● ●● ● ●
● ●
● ●
● ●●●
● ●●
● ●●● ● ● ● ●● ●● ● ● ●
● ● ● ● ●● ● ● ● ● ● ●● ●● ● ●● ●●
●● ●● ●● ● ● ●
● ●
● ●● ● ●● ●● ● ● ● ●●

● ●● ● ●● ● ● ●
●● ●
●●●
● ●
● ● ● ● ● ● ● ●● ● ● ●
●●
● ● ●● ●●
● ●●
● ● ● ● ● ● ● ●● ●

● ● ● ●● ●● ● ●

●● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ●●● ● ●●● ● ●
● ● ● ● ● ● ●● ● ● ● ● ● ● ● ●● ● ● ● ● ● ●● ● ● ●● ● ● ● ● ●
● ● ● ● ● ● ● ● ●
● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ●
●●●
● ●●● ●●● ● ● ●
● ● ● ● ● ● ● ●●● ● ● ● ● ● ● ● ● ●● ●● ● ● ●
● ● ● ● ● ● ●●●

● ● ●●
● ●●

● ● ● ● ● ● ● ●
●●●● ● ● ● ● ●●
● ●● ● ●● ●
● ● ●●● ●●● ● ● ●● ●

● ● ●● ●● ● ● ●● ● ● ●●● ●●●
● ● ● ● ●● ●● ●● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ●● ●●●●● ● ●●● ●● ●● ● ●
●●●● ● ●

● ●● ● ● ● ●
● ●
● ●●
● ● ● ● ●●● ● ● ● ●● ● ● ● ● ● ● ●●● ●●
● ●●● ●●●

●●

●● ● ●●●
● ●
● ● ● ● ● ● ●● ●● ● ● ●
● ● ● ● ●● ● ● ● ● ●● ● ● ●●
●● ● ●●● ●● ●
● ● ● ● ●● ● ●● ●●● ●● ● ● ●● ● ●
●● ● ● ● ●● ● ●● ●● ● ●● ●● ●●
●● ●● ●● ●●

●● ● ● ● ● ●● ● ●● ● ● ●● ● ● ●
●● ● ●● ● ● ●

● ●●
● ●
●● ● ●

● ●● ● ● ●●●● ●●●● ● ●
● ●
● ● ●● ● ●● ● ● ● ● ● ● ● ● ●● ●● ●● ●● ● ● ● ●● ● ●
●● ● ● ● ●●● ●●●●●● ●●● ● ● ● ●
● ●● ●●● ● ● ●●● ● ● ●● ● ●● ● ● ● ●●●● ● ●● ● ● ● ●●●
● ● ●●● ●● ● ● ● ● ● ●
● ● ● ● ●● ● ●● ● ● ● ● ●●●● ●●●● ● ● ● ● ●
2



● ●● ●● ● ● ●● ● ●
●● ● ● ● ●● ● ● ● ● ●● ●● ● ● ● ●● ●
● ●● ● ●● ● ● ● ●● ●●● ● ● ●● ●● ● ● ●● ●
●● ●● ●● ●●●● ●● ●
● ●● ●
● ●● ● ●●

2
●● ● ● ● ●●● ●● ● ● ●

2
● ●
●●
●● ● ●
●● ● ● ●● ● ●● ● ● ●●● ●●● ● ● ●● ● ● ● ● ●
● ● ● ● ●●●●●● ● ●●●●● ● ● ● ●● ●
● ● ●● ●● ● ● ● ● ●
● ●●● ●
● ●●
● ● ● ● ● ●● ● ● ● ● ●● ●●● ●●● ● ●● ● ● ● ● ● ●●● ● ● ● ● ● ● ●●●● ●
●● ● ● ●
● ●
●● ●● ●●●
●● ● ●● ● ● ● ● ● ● ●
●● ● ●●● ● ●● ●
● ●● ● ● ● ●● ● ●● ● ●● ●●● ●●●
● ● ● ●● ●●●●● ●●●●● ●●

●●●● ●● ● ● ●
● ● ● ●● ●●
●●● ●●
● ●● ●● ● ● ● ●● ● ● ● ●●● ● ●● ● ●● ●●● ●● ● ●● ● ●
●● ●
●●● ● ●● ●●●●● ●●●● ● ● ●● ● ● ●●
● ● ● ●● ●● ●
● ●●● ● ● ● ● ●●

●● ● ● ● ● ● ●● ●● ●●

● ●● ●●● ●●
●●● ●
●●
● ●● ●
● ●● ●●● ● ●●● ● ● ●● ● ●●●● ● ●● ●
●● ●
● ● ●●●
● ●● ●●● ●●● ● ●●
● ●● ●●●
● ● ● ● ● ● ● ●
● ●●●● ●● ●● ● ● ● ● ● ●● ● ● ●●●● ● ●● ● ● ●● ●
● ● ●●●● ● ●● ● ● ●● ●● ●● ●●●● ●●● ● ● ● ● ●
● ●●●●● ●●
● ●
● ● ●● ● ● ●● ● ● ●●● ● ● ●●
● ●●● ●●●● ●● ●
● ●● ● ● ●●● ● ● ●● ● ●
●●
●●

● ●●
●●

● ●● ● ●● ●●●●●●● ● ●● ● ●●● ●● ● ● ● ● ●● ● ●
● ●●● ● ● ●●● ● ●●● ●●●
●● ● ●●●● ● ●● ● ●●●●●●●●● ●● ●
● ●● ● ● ●● ● ● ●●●●● ●●
● ● ●● ● ●
● ●● ● ●
●● ● ● ●● ●● ●● ●●
● ●●
● ●● ● ●●●● ● ●
●● ● ●●
● ● ●●● ●
●●
●● ●●● ●
●● ● ●● ● ● ●●● ● ● ● ● ● ●●● ●●● ● ●●●●● ● ●●
● ●● ● ● ●●●●● ●●●●
●● ●
● ●● ● ● ● ● ●
● ● ●
● ● ●●
●●● ●● ●●● ● ●●●●● ●
●●● ●● ●●● ● ●

●●● ●
●● ●●
●●●
●●●●● ● ●●
● ●● ●● ●● ●● ● ●
●●● ● ●● ●● ● ● ●● ● ● ● ● ● ● ●● ●● ● ● ● ● ●● ● ●● ● ● ●● ●● ● ● ●●● ● ● ● ●● ● ● ● ● ●● ● ●
● ●●
● ●● ●●●●●● ●● ● ●● ●●●● ● ● ●● ●● ●●● ●●
● ● ● ● ●●● ● ●
● ● ● ● ● ● ● ● ●
● ● ● ●● ● ●
● ●●● ●●
● ● ●●
●●●
●● ● ●● ● ● ● ● ●● ●● ● ●●●● ●● ●●● ●●●●● ● ● ● ● ● ●
●● ● ● ● ● ● ● ●
● ●
● ● ● ● ●● ●●

●● ● ●●● ● ●
●●
●● ●● ●●● ●

● ●●●● ● ● ● ●● ●
● ●● ●● ● ●● ●●● ●
●●●●●●● ●●● ●
● ● ●● ● ● ●●
●●
●● ●● ●● ●● ● ● ●● ●● ● ●●● ● ● ● ●● ●
● ● ●
● ● ● ● ●●●
●● ●●
●● ● ●● ● ●●●
● ●●● ● ● ● ●●● ●●●● ● ● ● ● ●
● ● ●● ●●● ●● ●●
●●
● ●●●●● ●
●● ●●●●●
● ●● ●●●●●● ●● ●
●●● ●●
● ●● ● ● ●
● ● ● ● ● ● ● ● ●● ● ● ● ● ●
● ● ●● ● ●● ● ● ● ● ● ●●● ● ●●● ●●●
● ●●●
●●●● ●●●
●● ●●● ●●
● ●●●●●
●●●●
● ●●
●●
● ●● ● ●●● ● ●● ● ●● ●●● ● ● ●●● ● ●●●●
●● ●
● ●● ●
● ● ●● ●● ● ● ●●

● ●● ● ● ● ● ● ● ●● ●● ●● ● ● ● ●● ●●
● ● ●● ● ●
● ●
●● ●● ●● ● ●
● ●● ●● ● ●● ●
● ● ● ● ● ● ● ●●● ●
● ● ●
● ●●●
●●
● ●●● ●● ● ●
●● ●● ● ●●●● ●● ●●●● ●
●● ●● ●
● ●● ●● ●●●
●● ●●● ●● ●●●●●●● ●● ●
● ● ●
● ● ● ●● ● ● ●●●●● ●● ● ●●●
● ●●● ●●●
● ●●●● ● ●●●
●● ●●● ● ●

●●● ● ● ● ●● ●
● ● ● ●●●
●● ● ● ● ●● ● ●● ●● ● ● ● ● ●● ●
●●
● ●●●● ● ● ● ●● ● ● ●● ●●● ●● ● ●● ●● ●●●●● ●● ● ● ●
● ● ●● ● ● ● ● ● ● ● ●●● ●
●●
●●

●●
● ● ●
●●● ●●●
● ●
●●● ●●

●●●

●●●●● ● ●● ●

●●●● ●●●● ●●●●● ● ●●●●●● ● ● ●●● ●●
● ●●● ● ●● ● ●
● ● ●●
● ●● ● ● ● ● ●●●● ● ●● ●●●●● ●●●
●●● ● ● ●● ●● ●● ● ●● ● ● ● ● ● ●
●●
●●
● ●●
●● ● ● ●●●●●● ●●●● ●
● ●● ●●● ●
● ●● ● ●●
● ●● ●●● ● ●●

● ●● ● ● ●● ●●
● ●● ● ●● ● ● ● ● ●● ● ● ● ● ●● ● ●●●● ● ● ●● ● ●●● ● ●● ●●

●●● ● ● ●● ● ● ● ● ● ● ●●
●●
●●
● ●● ●●●● ●●
●●●● ●●
●●●●●● ●● ●●●●●●● ●●● ● ●
●●● ● ●● ●● ● ●●●●
●●● ● ● ●● ● ●●
●● ● ● ●●●●
● ● ● ●●● ●●●●● ●● ●● ● ●●●●● ●● ●● ● ●●●●●● ● ● ●
●●●
●● ●● ●●●
● ● ●● ●
●● ●●● ●● ● ●● ●●● ● ●● ● ●●●●●●●
●●● ●●● ● ●
●●●●●
● ●● ●● ●●
● ● ●●● ●● ● ● ●● ● ●●● ●● ●
● ● ● ● ● ●● ● ●●● ● ●● ● ●●●
● ● ● ● ● ●● ●
● ● ● ●

●●●● ●●● ●●●●●● ●●●● ● ●●
●●● ●●●●
● ●● ●● ●
●● ● ●

●● ●●●● ● ● ●●●●● ● ●●● ●●●● ● ●● ●●● ●●● ● ●●
●● ● ● ●● ●● ● ●
● ●
●● ● ● ●
● ● ● ● ●●
● ●●
● ●● ●●● ●●●●
●●●●●
●● ●● ●●
●● ●

●●●●
● ●●●● ●● ● ●●●● ● ● ●● ●● ● ● ● ● ● ● ● ● ● ●● ●●●●● ●●● ●●●●●
● ●
●●●
●● ●
●● ●
●●●

●●
●●● ●●● ●●
●●
● ●●
●●●●●● ●●●●● ●● ● ●●●● ● ●● ●●● ● ● ● ● ●● ● ●● ●●● ● ●●●●●
●●●
● ● ● ● ● ● ● ● ●● ● ●
● ● ●
● ●
● ●●
● ●●● ● ●
●●●●

● ●●
● ●●● ● ●● ●
● ●●●●●●●●●
● ●● ●

● ●
●● ● ●●● ● ● ● ●● ● ● ● ● ● ●●● ●● ●●
● ● ● ●●●
● ●●● ●●● ● ●
●● ● ●
●● ●●●●●●●● ●●●●● ●●● ●● ●● ● ● ●●● ●● ●● ●●●●●● ●
●●
●●●●
●●●●●
●●● ●
●●

● ●●●
●●● ●●● ● ● ● ●
●●● ● ●●●●● ● ●●● ●●
●●● ● ●●●●
● ●● ● ● ●● ●●
●● ● ●● ● ●●●● ●● ●
●●
●● ●●●● ●●●
● ● ●● ●
● ●● ●● ● ● ● ●● ● ● ●
●●●● ●●●● ●●●
●● ●●●●
● ●
● ● ●
●●●●

● ●● ● ●●●● ●● ● ●
●● ●
●●●● ●●●
● ●●●
● ●●●
●● ●

●●●● ●●●●● ● ●●● ● ●●
● ●● ●●● ●● ●●●● ●●● ● ●● ●●● ● ●● ●●●● ●●● ●●●● ● ● ● ●● ● ●● ● ●
● ●●● ● ● ●
●●● ●● ● ● ● ● ●
● ●● ●●●● ●
● ● ●● ●● ●●
● ●●
● ●●● ●●
● ●●●● ●●●●●● ● ● ●
●● ● ●
● ● ●● ●● ●●●●
● ●● ●●
●●● ● ●● ●● ●●●● ●● ●●● ●● ●
● ● ● ● ● ● ●● ●●
●● ●● ● ● ●
● ● ● ● ●

●●● ●● ●● ●● ●●●
● ●●● ●●●● ●●●● ●●●● ●● ●
●●●

●●●●●
● ● ● ●●●● ●
● ●●● ●●● ●● ● ● ● ●●●●
●● ●●
●●
●●
●● ●
●● ●●●● ●
●●●
● ●●●●●● ● ●●●

● ●● ●

● ● ● ●

● ●●
●●


●●●● ●●● ● ●
●● ●●
● ●● ●●
● ●

●●
● ●●●● ● ●●●

●● ●
● ● ● ● ● ● ● ● ●
● ●●
● ●
● ● ● ● ● ● ●
● ●●
● ●●
●●
● ●
● ●
●● ●●

●●
●●
●●●● ●
●●
● ●●
● ● ● ● ●●
●●

●●

●●
●●


●● ●
●● ●●● ●●● ●●● ●●●
●● ● ● ● ● ● ● ● ● ● ● ●●
●●● ●
● ●● ●●●●

●●
●●
●●
●●●

●●

●●
●●●




●●

●●●
●●●●

●●●●

● ●●
● ●● ●
● ● ● ● ● ●●● ● ●●●●● ● ●● ●● ●●● ●●●● ●● ●● ●● ●
● ● ●●● ●● ●●● ● ●●●
● ●●● ●●
●● ●●●●●●●● ●●
● ●●

● ●
●● ●●● ●
●●●● ●●
● ●● ● ● ●●● ● ●● ● ● ● ● ● ●● ●●●●●● ●●
●● ●●
● ●●●●● ● ●● ●●●●
●●
●●● ●● ●●● ● ● ●●● ●●●● ● ● ● ● ●● ● ● ●● ● ● ●●
● ●
●●
● ●●
● ●●
● ●●●●●
● ●
● ● ●●●●● ● ●● ● ●
●● ●●
●●●●●● ●●● ●

●●●
●● ●●

●● ● ● ●● ●●

● ●● ●● ●●●●● ● ●
● ● ●
● ● ●●● ● ● ● ●● ●●●● ●●●●●●●●● ● ● ●●

● ●●
●● ●● ●●● ●●● ● ●●
● ● ● ●●●


● ●●●
●●● ●
●●●●
● ●●●●

●●
●●
● ●●
● ●●
●●●
●● ●
●●●
● ●● ●
● ●● ●● ●● ●
●●● ● ●●
● ●●●●● ● ● ● ●● ● ● ● ● ● ●● ● ●
● ●●● ●
●●●● ●●
● ●● ●●● ●●
●● ●

●●●● ●●● ●●●●●●● ●●●
●● ●
● ●●● ● ●
● ●●●● ●● ● ●● ● ● ● ●● ● ● ●●●●● ●●● ● ● ●
●●
●●● ●● ●●●●●●●
● ●●
● ●●
●●
●●● ●● ●● ●●●●●●●●●
● ● ●●
●●
● ●● ●●● ●●● ●
●●
● ●●
●●
●●
●●●
●●
●●●
●●●

●●●
● ●


●●●●
●●●● ●
●●

●●● ● ●●

●●
●●●●
●● ● ●●● ●
● ●●
●●
● ● ●●● ●

●●● ●
● ● ●●
●●●
●●
● ●● ●● ● ● ● ● ●●● ●● ● ● ● ●●● ●●● ●
● ●
●●●
●●● ●●●
● ●●● ●

●● ●
● ●● ●● ●

●●
●●
●●● ● ● ● ●●
●● ● ●● ● ● ●● ●●●●
● ●●
● ●●
●●
●●
● ●● ●
●●

●● ●●● ●
●●●●
●●●●●●●●
●● ●● ● ●
● ●●●
●● ●●
● ●●●●●● ●
●●● ● ●●●●● ●● ●● ● ●
● ●●●●●
● ● ●●
●● ● ●●●● ●
●● ●●● ● ● ●●
● ●● ●●● ● ● ● ●
● ●
● ●● ●●●●
●● ●●
● ●●●
● ● ● ●● ●● ●●●

● ●●●● ●● ●● ● ● ● ● ● ● ●●●● ● ●●●●● ●●●●
● ●●● ● ●
●● ● ●

● ● ● ●
●●
●● ●
● ● ●
●● ● ●●● ●● ●● ●● ● ● ●● ● ●
●●● ●●●●●●● ●● ● ●● ●●
●● ● ●● ●● ● ●● ●
● ● ●
● ●●●
● ●
●●
●●●● ●

●●●●
● ●● ●●● ● ●●
●● ●●●●● ● ●
●●
●●●
● ●●●


●●●●●●●●●● ●● ●● ● ●●●
● ●●
●●● ●
●●
●● ●●●
●● ●● ●● ● ●● ● ●●● ●● ● ●●● ● ●
●● ●●●● ● ● ● ● ●●● ●● ●

●●●●
● ●● ●

●●●
●● ●
●●●●●●●
●●●
●●●● ●
●●●● ●●●●●●● ● ●●●●● ● ●
● ●●●●●● ●●●●● ● ● ●●●
●●
● ●
● ●
●●

●●●


●●

●●●●●


●●●
●●● ●

●●

● ●●
●●●


● ●
●●●● ●●● ●
● ●● ● ●● ● ●
●●
●●● ●
●● ●●●
●●●●●● ●
●●●

●● ●●● ●

●●● ●●●●●

●● ●● ● ●●●
● ●● ●

● ●●
●●● ● ● ● ● ● ● ● ● ● ●● ● ●●
● ●● ● ●●
●●●
●●●
●●
●●●●●●●



●●
●● ●

●●


●● ● ●
● ●●●
●●●●●●

●●


●●●●●●
● ●● ●●● ●●●● ● ● ● ● ●● ●● ●●
●●


●●●
● ●
●●

●●

● ●
●●
●●●
●●

●●
●●●●●●
●●


●●
●●
●●●
●● ●●● ●●

●● ●●●●● ●
●● ● ●● ●● ● ●● ●●●
● ●● ●● ●● ●● ● ●


●●● ●●● ● ● ● ● ● ●●●●●●●● ● ●●● ●● ● ● ● ● ●● ●●● ●●●
● ●●●●
● ●●●●●●
● ● ●● ●●
● ●●● ● ●●
● ● ● ●● ●●●● ● ● ●● ●● ●●●


●●
●●
●●●●●

●●●●●
●● ●●● ●●●
● ● ●
●●● ● ●● ●
● ●
●●●●● ● ●
●●●
● ● ● ●●● ●● ●●● ●●● ●● ●● ● ●● ●●●● ● ●
● ●●● ●●● ●●●● ●
● ● ● ●
●●●● ●●

●●

● ●●
●● ●
● ● ●● ●

●●

●●
●●

● ●
●● ●●
●●●●
●● ●●●●●●● ●● ● ●
●● ● ●● ●
●● ●
●● ●●

●●●●●●●

● ●
●●
●● ●●

● ●● ●
●●
●●●

●●
●●● ● ●

●●
●●
●●●● ● ● ● ●● ● ● ●●
●●
●● ● ● ● ●
● ●●● ●● ●● ● ●● ● ● ●●● ● ●● ●● ●●● ● ● ● ●●● ● ●● ● ●● ● ●● ● ● ● ● ●
●●●●●
●●●●●●●

● ●
● ●●●
●●●●●● ●● ●●
●●
●●● ●
●●●

● ●●● ●●● ●●
●● ●
●●
●●●
●●●
●● ●● ●● ●
●●●●
● ●●●●●
● ●●●
● ● ●●

●●●● ●
●●
●●●●●●

● ●

●●●
●●● ●

●●
● ●
●●
●●●●
●●● ●●
●● ●●●
● ● ●

●●●● ● ●●
● ●●●
● ●
● ●● ●●● ● ●● ●●




●●●●●
● ●●●

● ●●
●●●
●●









●●●●●●●

●●
●●● ●●


● ● ●●●●
●● ●●●●● ● ●
●●●●
●●●●● ●●●● ● ●●● ●● ● ● ●
●● ● ●● ● ●● ● ●● ●
● ●●● ●●●
● ●● ● ● ● ● ●● ● ●
●● ● ●●●● ●●●
● ● ●● ● ● ● ●●●
●●●
●●●
●● ●
●●●
●● ●●
●●●●●
● ●● ●●●
●●●
●●
●● ● ●●● ● ●●●
●●
● ●


● ●● ● ●●
●●● ●● ●●
● ●

●●●●●● ● ●● ●●●● ●● ● ●●●
● ●● ● ● ● ● ●●●● ● ● ●● ●● ●
●●●
●●
●●● ●
●●
●●●●●
●●

●●●
●●
●● ●

●●●●
●●●
●●●
●●●
●●●●
●●
●●●●
● ●● ●● ●● ● ●●
● ●
●●●●●
● ● ● ● ● ●● ● ●
● ●
● ●
●●●● ●
●●●●
●●● ●●
●●●●
●●


●●
●●
●●
●●

●●

●●
●●●


●●

●●●
●●●
●●●●●
●●●●●● ●
●●
●●●●● ●
● ●
●● ●
● ● ●●● ●
●●●●
●●●●●●

●●
● ●
●●

● ●
●●

●●

●●●●
●●●●●●●●
●●
● ●

●●●●●
●●●

●●
● ●● ●
●● ●●
●●●●●

●●● ●●● ●●●●
●●●● ●●●●● ●● ● ● ●
●● ● ● ● ●●●●●●●●●●●●

●●●
●●
●●
● ●●●
●●●
●●

●●
●●●●
● ●
●● ●●●
●●
●●
●●
●●

●●
●●
●●
● ●
●● ●●●● ●●● ●●
●● ●● ● ●● ●




●●
● ●

●●●

●●






●●●●









● ●
●●
● ●



●●

●●●●●
●●

●●●


●●●●●
● ● ●
●●● ●● ●●●


● ●●
●●
●●●
●● ●● ●●●
●●

●●
●●
●●●
●●

●●●
●● ●

●●● ●
●●●●
● ●●●
●●●●●
●●●●

●●

●●●●
●●●●●
●●●
●●
●● ●● ●●●●● ●●●●●● ●
●● ●
● ●●●●
● ● ●● ● ● ● ● ●●



●●
●●●

●●●●
●●●
●●

●●●●
●●●●

●●●●
●●

● ●
● ●

● ●●●
● ●
● ●

●●● ●●●

●●●
●●●● ●● ●
● ●● ● ●●●●●●
● ●●
● ● ●●
●● ● ●●
● ●
●●
●●●

●●


●●
●●


●●●


●●●




●●

●●
●●


●●

●●



●●


●●



●●●

●●
●●
● ●
● ●
●● ●
●●
● ●

●●
●●
●●
●●● ●●
●●
●●●
●●
●●●●
●● ●●
● ●
●● ●●●●●●
● ●● ● ● ● ●● ●
● ●●
●●● ●
●●● ●●● ● ●●●● ● ● ●● ● ●●
●●●
●●

●●

●●●●
●● ●●●
●●●

●●● ●●
●● ●
●● ●● ●
●●●●●●
●●
●● ● ●● ●●● ●●●
●●●●● ● ●●● ●
●●
● ●● ● ● ● ● ●●●●

●●●
●●●

●●
●●●
●●●
●●
●●

●●
●●
●●

●●
●●●


●●
● ●
●●
●●●●●
●●● ●
●●●●●● ●● ● ●
●●●
●● ●●●●
● ●
●● ●●● ● ● ●
●●● ● ● ●●●
● ● ● ● ● ● ● ● ● ● ●
●●

●● ●● ●●● ●●●
●●

●●
●●
●● ●● ●●●
●●●
●●

●●● ●

● ●
● ●●●
● ●
● ●●● ●●

●● ●●● ●●●● ● ●
● ● ●●● ● ● ● ●●
● ●●

●●
● ●●● ● ●
● ●● ● ●● ● ● ●
●●
● ● ●●● ● ● ● ● ● ● ● ● ● ●● ●●
●●
●●
●●
●●
●●


●●

● ●

●●
●●

●●●
●●●

●●

●● ●●
●●●●
● ●● ●● ● ● ● ●
●●● ● ● ●
●● ● ●● ● ● ●● ● ● ● ● ●● ● ● ● ●● ●● ● ●

●●●●


●●
●●●
●● ●●●

●●●●●●●●
●●●
● ●
●●● ●●
●● ●●●●
●● ●

●●
●●●
●● ●● ● ●● ● ●● ●●● ● ● ● ● ● ●● ●●●
● ●

●●●
●●
●●●●●
●●
●●
●●●●
●●


●●
●●
●●●●●●

●●●●
●● ●
● ●●● ● ●● ●● ● ● ●●● ●● ● ●●●●● ● ● ●●●● ● ● ● ● ● ●
●●


●●
●●
●●

●●●●●
●●
●●

●●
●●
●●●

●●


●●
●●


●●


● ● ● ●●● ● ●
●● ● ● ● ● ●
●●

●●●●
●●






●●●


●●
●●●

●●
● ●●

●●●●

●●


●●
●●
●● ●

●●
●● ●
● ●● ●
●●●
●●●●●●●●●
● ●

● ●● ●●●●
● ● ● ●
●●

●●

●●


●●
●●




●●●
●●●
●●●
●●●●
●●
● ●

●●●
●●●
●●
● ●
● ●●●●

●●
●●
●●●● ●●






●● ●● ●●● ● ●●●●●● ●● ● ●● ● ●●●●● ●
● ● ● ●●



●●
●●






●●



●●
●●


●●





●●





●●
●●


●●
●●





●●
●●

●●
●●●●●●

●●● ●
●●●
●●
●●●
● ● ● ●●
● ● ● ● ● ● ● ● ●
● ● ● ●● ●●● ● ● ●●●●● ● ● ●● ● ● ●● ● ● ● ● ● ● ● ●●●●
●● ●●●●● ● ● ●
●● ●●
● ●

●●


● ●

●●
●●
●●


●●
●●●

●●●●●
●●

●●●●●

●● ●●
●●●
●●
●●
●●

●●●●

●●●
●●
●●●●●● ●●●● ●●●●●●● ● ●● ● ● ● ●
●●





●●


●●
●●
●●

●● ●

●●

●●●
●●●
● ●●
●●●
●●

●●●
●●●●
● ●● ●● ● ●●●●●●● ●● ● ● ●
● ●● ●
● ● ● ●●● ● ●● ● ●●●●● ● ● ●

●●
●●

●●
●●


●●
●●

●●


●●

●●
●●
●●●●
●●●
●●


●●
●● ●●
●●●
● ● ●●●● ● ●

● ●
●●
●●


●●
●●
●●
●●

●●
● ●
●●

●●
●●
●●

●●
● ●
●●
●●

●●

● ●● ●


●● ●
● ●
●●●● ●
●●●● ●●●●● ● ●● ●● ●● ●
●● ●● ● ● ●●● ● ● ●
●●

●●
●●


●●

●●

●●

●●

●●
●●

●●●●

●●
● ●●

●●●●●


● ●
●●

●●● ●● ● ●● ●● ●●●● ● ●●●●● ●●●
● ●●●
● ●●●● ●

● ●●
●● ●
●● ●● ● ●● ●



●●






●●
●●
●●
●●


●●
●●


●●


●●
●●

●●

●●

●●
●●●


●●
●●
●●
●● ●●●
● ●● ● ●
●●
●●
●●
●●

●●

●●


● ●

●●
●●
●●


●●
●●

●●
●●●
●●
● ●

●● ●●
● ● ●●
● ●●
● ●
●●●

●● ● ● ●
● ● ● ● ● ●●●


●●

●●
●●
●●

●●
●●●●
● ●
●●●●● ● ●● ●● ●●●● ● ●●●● ● ●●● ● ●● ●● ●● ● ●● ●● ● ●●●● ● ● ● ●

●●




●●

●●


●●

●●


●●

●●
●●
●●
●●
●●●

●●●●
●●

●●

●● ●●
● ●●









●●
●●













●●

●●
●●




●●










●●









●●

●● ●●



●●●●

●●●●
●●● ●

● ●
●● ●●● ● ●




●●

●●

















●●



●●



●●
●●

●●
●●
●●●●●●●

●●●● ●

● ●●●●●●
●● ● ● ● ●● ●
●● ●● ● ●●●● ●
● ●● ●● ● ● ● ● ● ● ●● ● ●● ● ●● ● ● ● ●● ● ●
● ● ● ●











●●









●●












●●
●●


●●









●●






●●
● ●●





●●● ●● ● ●
●●

●●
●●

●● ● ●● ● ●●
● ●●● ●●● ● ● ● ● ●● ●●
● ● ●●● ●● ● ● ●●● ● ●●●●●● ● ●●
0

0
● ●
●●● ●●● ●
● ●●

0
●●
●●
●● ● ● ●● ●
●●●● ● ● ●●●● ●●● ● ●●
●●
●●●

● ● ● ●●



●●




●●
●●
●●

●●




●●

●●●

●●
●●



●●●● ●
● ●● ● ● ●● ● ● ● ●




●●



●●
●●
●●
●●●
● ● ● ● ● ● ● ●● ● ●● ●● ● ●● ●
● ●
●●● ● ● ●






●●



●●


●●

●●
●●●


● ●
●●
●● ●
●● ● ●

0 1 2 3 4 5 6 0 2 4 6 8 0 2 4 6 8

(a) Gaussian copula. (b) Student copula. (c) Gumbel copula.


Fig. 4.8: Samples with exponential marginals and given copulas.

Exercises

Exercise 4.1 Copulas. In what follows, U denotes a uniformly distributed


[0, 1]-valued random variable.
a) To which couple (U , V ) of uniformly distributed [0, 1]-valued random vari-
ables does the copula function

CM (u, v ) = min(u, v ), 0 ⩽ u, v ⩽ 1,

correspond?
b) Show that the function

Cm (u, v ) := (u + v − 1)+ , 0 ⩽ u, v ⩽ 1,

is the copula on [0, 1] × [0, 1] corresponding to (U , V ) = (U , 1 − U ).


c) Show that for any copula function C (u, v ) on [0, 1] × [0, 1] we have

C (u, v ) ⩽ CM (u, v ), 0 ⩽ u, v ⩽ 1. (4.7)

d) Show that for any copula function C (u, v ) on [0, 1] × [0, 1] we also have

Cm (u, v ) ⩽ C (u, v ), 0 ⩽ u, v ⩽ 1. (4.8)

Hint: For fixed v ∈ [0, 1], let h(u) := C (u, v ) − (u + v − 1) and show that
h(1) = 0 and h′ (u) ⩽ 0.

Exercise 4.2 Consider two Bernoulli random variables X and Y , with pX =


P(X = 1), pY = P(Y = 1), correlation coefficient ρ ∈ [−1, 1], and

" 105

This version: June 9, 2023


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

P(X = 1 and Y = 1) = pX pY + ρ pX pY (1 − pX )(1 − pY ),


 p





 P(X = 0 and Y = 1) = (1 − pX )pY − ρ pX pY (1 − pX )(1 − pY ),

 p

P(X = 1 and Y = 0) = pX (1 − pY ) − ρ pX pY (1 − pX )(1 − pY ),


 p







P(X = 0 and Y = 0) = (1 − pX )(1 − pY ) + ρ pX pY (1 − pX )(1 − pY ).
 p

Is it possible to have ρ = 1 without having pX = pY and

P(X = 1 and Y = 1) = pX = pY ,






 P(X = 0 and Y = 1) = 0,


P(X = 1 and Y = 0) = 0,







P(X = 0 and Y = 0) = 1 − pX = 1 − pY ?

Exercise 4.3 Exponential copulas. Consider the random vector (X, Y ) of


nonnegative random variables, whose joint distribution is given by the sur-
vival function

P(X ⩾ x and Y ⩾ y ) := e−λx−µy−ν Max(x,y ) , x, y ∈ R+ ,

where λ, µ, ν > 0.
a) Find the marginal distributions of X and Y .
b) Find the joint cumulative distribution function F (x, y ) := P(X ⩽
x and Y ⩽ y ) of (X, Y ).
c) Construct an “exponential copula” based on the joint cumulative distri-
bution function of (X, Y ).

Exercise 4.4 Gumbel bivariate logistic distribution. Consider the random


vector (X, Y ) of non-negative random variables, whose joint distribution is
given by the joint cumulative distribution function (CDF)
1
F(X,Y ) (x, y ) := P(X ⩽ x and Y ⩽ y ) := , x, y ∈ R.
1 + e−x + e−y

a) Find the marginal distributions of X and Y .


b) Construct the copula based on the joint CDF of (X, Y ).

Exercise 4.5 Consider the random vector (X, Y ) with the joint probability
density function
106 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

1 1
1 2 (x, y )e−x /(2σ )−y /(2η ) + 1 2 (x, y )e−x /(2σ )−y /(2η ) ,
2 2 2 2 2 2 2 2
fe(x, y ) :=
πση R− πση R+
plotted as a heat map in Figure 4.9b.

1.5

0.3 1

● ●

3

● ●

●●

0.5 ● ●● ● ● ● ●
● ●
● ● ●
● ●
●● ● ●● ● ● ●●

● ● ●
● ●● ●
● ●● ● ●● ● ●
● ●
● ● ● ● ● ● ● ●
● ● ●
● ● ●● ● ●● ● ● ●●
● ● ● ● ● ● ● ●
● ● ● ● ● ●● ● ●
● ● ●● ● ●● ●
●● ●● ● ●●● ● ● ●

● ●● ● ● ●● ● ● ● ●

2

● ● ● ● ● ●● ●● ● ● ●● ● ● ●
● ● ●● ● ● ● ●
● ● ●●● ●●●● ● ●● ● ●
● ●● ● ● ●●●● ● ● ● ● ● ● ● ●
●● ● ●● ● ●●●●● ●●●

● ●● ● ● ●● ●● ●
● ●●● ●● ●● ●
●●●

0.2
● ●● ●●● ● ● ●●
● ● ●

●● ● ●●●● ●● ● ● ● ● ● ● ●●
● ●
● ●● ●● ●● ● ●
● ● ●
● ●●● ● ●●● ● ● ● ● ● ●
●● ● ● ●●●● ● ●●● ●● ●● ● ●● ● ● ● ●● ● ● ● ● ●
● ● ●● ●●


● ● ●● ● ●
● ●● ●● ● ● ●● ●● ●

0
●●● ●● ● ●●●●●
● ●●● ● ● ● ● ● ●
●● ● ●● ● ●● ● ●●●

y
●●●
● ● ● ● ●●● ●● ●

●● ●● ●
●● ●● ●●●● ● ● ●● ●● ●●● ● ● ●● ● ● ●
● ●● ●●● ● ●● ●● ● ●●●● ●● ● ●
●●● ●●
● ● ●● ●●●●●● ● ● ●●● ●●●● ● ● ●● ● ● ● ●
●●●●●●● ● ●●
● ●
●● ●●●● ●●
● ● ●●
● ● ● ●● ●●
●●
●● ●● ●●
● ●●
● ●● ● ●
● ● ●● ● ● ●
● ●● ●● ●● ● ● ● ●●● ●● ●● ●●● ●●●●● ●● ●● ● ● ●
●●
●● ●●● ● ●● ● ● ●●●● ●●●●
● ●
● ●
●●●● ●● ●● ●
● ●
● ● ●● ● ● ●●●

●●●● ● ● ●● ● ●●
●● ● ● ●● ● ● ●


●●●●●● ●●● ● ●●● ● ● ● ●● ● ● ● ●● ●●●● ●●●● ● ●● ●● ●● ● ●
●●●● ●● ● ●●
●● ●● ●●● ● ● ●● ● ●●● ● ●● ● ●● ● ● ●
● ●● ● ●●

●●●●● ● ●
● ●●
● ● ● ●●●● ●●●● ●● ●
● ●● ● ● ●● ● ●● ●

● ● ●●
● ● ●
● ●●

1
●● ● ●● ● ●● ● ●● ● ● ● ●● ● ● ● ● ●● ●● ●●● ●●●●
● ●● ● ● ● ● ●● ● ●
●● ●
● ●●●● ●●●● ●● ●● ●● ●● ●●● ●●●
● ● ●●●● ● ● ● ●●●●● ●
● ●●● ●

●●● ● ● ● ●● ●● ●●●● ●
●● ●
●●●● ● ●●●
●●●●●●●● ●● ●● ● ● ● ●
●● ●● ●●●●●● ●
● ●
● ● ●●● ●●● ● ●● ● ● ● ● ●

2
● ●●●●● ●● ●● ● ● ●●● ● ●● ● ● ●
●●● ● ● ●
●● ● ● ● ●● ●●● ●
● ● ●●●●

●●●●●●● ● ● ● ● ● ● ● ● ● ●
●● ●●
● ●● ●●● ● ●●●●●● ● ●● ●● ●● ● ●● ●● ●● ●
● ●● ●●● ● ●●
●●●● ●●● ●●
●●● ●●●● ● ●●
● ●● ●
●●●●
●●●●●●●

● ●●● ●●● ● ●●●● ● ● ● ● ● ● ●
●● ●●
●● ●● ●●●● ● ●●● ●●● ●● ●●● ● ● ●
●● ●● ●●● ● ●● ●●●● ● ● ● ●● ●●●●●● ● ●●● ●● ●●
● ●●●
●● ● ● ● ● ●
● ●
●●●● ●● ●●● ●●●●● ●
●●●● ●● ● ●●●●
● ●● ●●●
● ●● ●● ●●● ● ●●● ●● ● ● ●● ● ●● ● ●●
● ●● ●●●
● ● ● ●●●● ●●●
●●● ●●● ● ● ● ●●● ●●● ●● ● ● ●●●●●● ● ●● ● ● ●
●●●● ●
●●
●●
● ●● ●● ●
●●● ●●●●●●
● ●●
●●
●●●● ●●● ● ● ●
●● ● ●● ●
●●●● ● ●● ●● ● ●● ●● ● ●●● ● ● ●

●●
●●●●● ●●● ●●●●● ●●●●●●● ●
●● ●●● ●● ●●●●● ●● ●● ●
● ●●● ● ●
● ● ● ● ●
●● ●●● ●● ● ● ●●● ●●● ● ● ●●● ●● ● ● ● ●
●● ●● ●●●● ●●●
● ● ●
●●●
●●●●●●● ● ●●●●● ●●
● ●●● ●● ●
●●
●●● ● ● ●●●●● ●●●● ● ●●● ● ● ●● ● ● ●●
●●●●●●●
●●●●●●●
● ●●
●●●● ●●●● ●●● ●● ● ●
●●●● ●●
●●
●●

●●●● ●●●●●
●●● ● ●● ● ● ● ● ●● ●● ●●●●

● ● ● ● ●● ●●●● ●● ● ●●●●● ●●●● ●●● ●●●●
● ● ● ●●● ●●●●●●
● ●
● ●● ● ●● ●● ● ● ● ●●
●●● ●
●●●
●●●
●●●●●●●● ●●●● ●●● ●●●●
●●● ●●● ●●
● ●● ●● ●
●●● ● ●●
●● ● ● ●●
●●●

●●●●●●● ●●●● ● ●● ●●●●●
● ● ● ●●
●●
●● ●●● ●●●●●●●● ● ●● ● ●● ● ● ●●
●● ●●● ●●●●●● ●● ●●●● ●●●●● ●● ●● ● ●●● ●●●●● ● ●●● ● ● ● ●●● ●● ● ●● ●
●●
●● ●●●
●● ●● ●●●● ●● ●●●●● ●●
●●● ●●● ●
●●●●

●●● ● ●●●

●●
●● ●●● ● ● ●

●●●●●

●● ●●●
●●
●● ●●●●●●● ● ●●
● ● ● ●●●
●●●●● ●●● ●● ●● ●●
● ● ●●
●●
●● ● ●●●● ●●●●● ● ● ● ●●

-0.5
●●● ●● ●●●● ●● ● ●● ● ●● ●● ● ●●● ●●
●● ●
●● ●●●●●●● ● ●
● ●
● ●●●● ●● ●●● ●● ● ●● ●● ● ● ●●●●● ●●● ● ●●● ● ● ● ● ●
●● ●
●●●
●●●●●
● ●●● ●● ●●●●●● ●

● ●
● ●●● ●●● ● ● ●
●● ●
●● ●●● ●●●●● ● ● ● ●

●●●
● ● ●●●● ●●●● ●
●●●●● ● ● ● ●● ●●● ●● ● ●
●●● ●●●●● ●●
●●
● ●● ●● ●●
●●●● ●●● ● ●● ●●●●●

●● ● ●●●●
●●●●
●● ●●●●●● ●
●● ●● ●● ●● ●● ● ● ●●● ●
●● ● ●●●● ●●●●
● ●● ●
●●●●
●●●● ●●●
●●● ●● ●●

●●
●● ●●●
● ● ●●● ●●● ● ●● ●
● ● ●
●● ●
●●● ●●●● ●●●●

●● ●● ● ●● ●● ● ●● ● ● ● ●
●●● ●●● ● ●
●●● ●●●
● ●●●●● ●●● ●
●● ●●● ●●●●
● ●●●
●●●●
●● ●● ● ●●
●● ● ● ●● ●
●● ● ●● ●● ●● ●● ● ●● ● ●

0
●● ● ● ●● ● ● ●
●● ● ● ● ● ● ●● ● ● ● ●
● ●●●●●●● ● ●●●●●●● ●●●● ●●
●●●
● ●●● ● ● ● ●● ●
● ● ● ●
● ● ●
●● ● ●● ●●●●●● ● ●●●●
● ●●
●● ● ● ●● ●● ●
●● ●● ●● ●

● ●● ●●
●●●●● ●●●●●●●
●●●●● ●● ●● ●● ● ● ●●● ●●●● ●●●●
●●●● ●● ●● ●● ● ●●●

●●●●● ●● ● ●

● ●●● ● ● ●● ● ●●●●● ●●● ●●● ●● ● ●●●● ●● ●● ● ● ●●●●
●● ●● ●● ●●● ● ● ●●● ●●
● ●●●●● ●● ● ●●
● ● ●● ●
●●●●●● ● ●●
●● ●

●●

●● ● ●

●●●
●●

● ●●●●
● ●●●●
● ●

●●● ●
● ● ●●●●

● ● ●● ●●● ●
● ● ●● ● ●●● ●● ●● ●
●●●●● ●●● ●●● ● ● ●
●●

● ● ● ●● ● ●●●
● ●● ● ● ●
● ●● ● ●●●● ●
●● ● ●● ●●
●● ●
●● ●● ●
●●●
● ● ●●●
●● ●●
●●●

●●
●● ● ● ● ●●● ● ●●● ● ●● ● ● ● ●●● ●
● ●●●
●● ●●●●●
● ●●● ●●●●
●●●● ● ●●
● ●
● ●●● ●● ●●● ●●●●●● ●

● ●● ●●●● ●●●●●
●●●●●● ● ●● ●● ● ●
●● ●●● ●
●● ●●●
● ●● ●● ● ●●● ●● ●
● ● ●●●●● ● ● ● ●●
● ●●
● ●● ●●●●●
● ●●●●● ●●●
● ●●● ●● ● ●●●●

1
● ● ●
● ● ● ● ● ● ● ●●● ● ●●●●●● ● ●●
● ●●●● ●
● ●● ●●●● ●
●●● ●● ● ●● ●● ● ● ●
●●
●●● ●●● ●●

●● ● ●●
●● ● ●● ● ● ●● ●● ●
● ●● ● ● ●●●
●● ● ●●

●●● ●● ●● ●●●● ●●● ●
●● ●● ●
●●●●●● ●●●
● ●
●●●
● ● ● ● ● ● ● ●● ●●●●●●●
●● ●
●● ● ●●
●●●●●● ● ●●●●
●●● ● ●● ● ●●●●●



●●

●●● ●●●
● ● ● ● ● ●●●●●●●
● ● ● ● ●●
● ●
●● ●
● ●●●
●●● ●
● ●●●●
●●● ●●

●●●●
●●●
●● ●●
● ●● ● ● ● ● ● ●●● ●
● ● ●●●● ●●


●● ●● ●●● ● ●●● ●● ●● ●
● ●●●●●
●●● ●●
●●
●●● ●●●●●●●● ●
●● ●●● ●● ● ●●●● ● ●● ● ●

●● ● ● ●●● ● ●●● ●●● ● ● ● ●●●●● ●●● ●● ●● ●
●●●
● ● ●●●●●●● ● ●●● ●●● ●●● ●●●
●● ● ●● ● ●
● ● ●●●● ● ●●● ● ●● ●●●●
● ●● ●● ●●● ●● ●●● ●●●●
● ●

●●●● ●●●●● ●
● ●● ●●●● ● ●● ●●● ● ●● ●● ●● ● ●●●● ●● ●●●
● ●●●●
● ●●●●● ●● ●●
●● ●●● ●●●● ●● ●●● ●
● ●●●●●● ●● ●● ● ●

0.1
● ● ● ● ●● ● ●●●●● ● ●● ● ●●●●
● ●
●● ●● ●●●
●● ● ● ●●●●●
● ● ● ●
● ●●● ●
● ● ● ●
●●● ● ●
● ●● ●●
● ●● ● ● ● ●●●
●● ● ● ●
● ● ●● ●● ● ●●● ● ●● ● ● ●●●● ●● ●●● ● ● ● ●●●●
● ●●
●● ● ● ●●● ●● ●●●●● ● ●●
●●
● ●● ●● ●●●●● ●●
●●● ● ● ●●● ●●●●● ●
●● ● ●
● ●● ● ● ● ●● ●● ●● ●●●
●●● ●●●●● ●
● ● ●●● ●● ●● ●● ● ● ●● ●●●● ●
●●●●● ●
●●●●

●●●●● ●●● ●●●●
●●●●●●●
● ●●●●●

●● ● ● ● ●●● ●

● ●●●●●●
● ●●● ● ●● ● ●● ●
●● ●
●●●●● ●
● ●●●●
● ● ● ● ● ● ● ● ●● ● ●● ● ●● ●●●● ● ●
●●●●●●● ●● ●●●●● ●● ●●●● ● ●●● ●●●●●● ●●●●


● ● ● ● ●● ● ●●
● ● ●●●● ●● ●●
● ●●● ●●
● ●●●
●●● ● ●●●●
●●●●●●● ●
●●● ● ●● ●
●●

−1
● ● ● ● ● ●●●●●●● ●● ● ●● ● ● ● ●
●● ●●●●
● ●● ●● ● ● ● ●●
●● ● ● ● ● ● ●●●● ●● ●●● ●
●●●● ● ●● ●

-1
● ●● ● ● ●●●● ● ●●● ●● ●● ● ●●
● ● ● ● ● ●●
● ● ● ● ●● ● ● ●● ● ● ● ● ●● ●●● ●● ● ● ●● ●●●● ●●● ●●● ●●●
● ● ●● ●●● ●● ●
● ●●●
● ● ● ● ● ● ●● ●●● ● ● ●● ● ● ● ●●●●●●● ●● ● ●●●
●● ●● ●
● ●●● ● ● ●●●●
● ●
●● ●●●● ●● ●● ●●●● ●●●● ●●●●●
● ●●●●● ●●
●● ●
●●● ● ● ●●●
●●
● ● ●● ●● ● ● ● ● ●●●● ●●●
● ●● ●● ● ●●●●
● ● ● ● ● ● ●● ● ● ● ●● ● ● ●● ●●● ● ● ●●

●●●
● ● ●●
● ● ● ● ●
●● ● ● ●

● ● ● ● ●●●●● ● ●●● ● ●● ● ●●● ●● ●●●●
●● ●● ● ● ●● ● ● ●● ● ●
●●●●
● ● ●● ● ● ●● ●● ● ● ● ●●

●●
●●●●●●● ●●● ● ●
● ●● ●● ●● ●





●●● ● ●●● ● ● ● ● ●●
● ●● ●● ● ●● ● ●●

● ●●●●● ●
●●● ● ● ● ●●●

y
● ●● ● ● ●● ●● ●●●
●●● ● ● ●
●●

● ●
●●●● ●● ●● ●●
●●●● ●● ● ● ● ●● ●●● ●● ●
● ● ● ● ● ●●●● ● ● ●● ●●
● ● ●● ●● ● ● ● ● ●● ●● ●●
● ●● ● ● ● ● ● ● ●●

●● ● ●● ● ● ●● ●● ● ●● ● ●

0
● ● ●● ● ●● ●● ● ●● ●●●● ● ● ●● ●
● ● ● ●●
●● ● ● ●
●●● ● ● ● ● ● ●●● ●●
● ● ● ●● ●
●●●
● ●● ●● ● ● ●● ● ●●● ●
● ● ● ●● ● ●
● ● ●
● ● ● ● ● ● ●● ● ● ● ● ●●●
● ● ●● ●
●● ● ●●● ● ●●●● ●
● ● ● ●● ● ● ● ●●
● ● ● ● ● ●
●● ● ● ●●● ●●● ● ● ●
● ●
● ●● ● ●●
●● ● ●●●● ●● ● ● ●● ●
● ● ● ● ●● ●● ● ● ●●●● ●●
● ● ● ●● ●●

● ●●

−2

● ● ● ● ●●●
● ● ●
● ● ● ●●● ● ● ●● ●● ● ● ●
● ● ● ●● ● ● ● ● ● ●
● ● ●
● ● ●● ● ● ●
●● ●
● ●

● ●● ●●●
● ● ● ●● ● ● ●

-1.5
● ● ● ● ●●
● ●● ● ● ●
● ● ●● ●●●
● ● ● ● ● ● ●● ●●
● ● ●
● ● ●
●● ● ●
● ● ● ●●
● ● ●
● ●●

-1

● ●
● ● ● ●

−3
0
● ●
● ●



-2 -1 -2 ●
● ●

0 1 -2 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2


x 2 x
−3 −2 −1 0 1 2 3

(a) 3D view. (b) Heat map. (c) Samples.


Fig. 4.9: Truncated two-dimensional Gaussian density.

library(MASS)
Sigma <- matrix(c(1,0,0,1),2,2);N=10000
u<-mvrnorm(N,rep(0,2),Sigma);j=1
for (i in 1:N){
if (u[i,1]>0 && u[i,2]>0) {j<-j+1;}
if (u[i,1]<0 && u[i,2]<0) {j<-j+1;}}
v<-matrix(nrow=j-1, ncol=2);j=1
for (i in 1:N){
if (u[i,1]>0 && u[i,2]>0) {v[j,]=u[i,];j<-j+1;}
if (u[i,1]<0 && u[i,2]<0) {v[j,]=u[i,];j<-j+1;}}
joint_hist(v) # Function defined the previous section

a) Show that (X, Y ) has the Gaussian marginals N (0, σ 2 ) and N (0, η 2 ).
b) Does the couple (X, Y ) have the bivariate Gaussian distribution with
probability density function fΣ (x, y ), where Σ is the covariance matrix
(4.1) of (X, Y )?
c) Show that the random variable X + Y is not Gaussian (take σ = η = 1
for simplicity).
d) Show that under the rotation

cos θ − sin θ
 
R= ,
sin θ cos θ

of angle θ ∈ [0, 2π ] the random vector (X cos θ − Y sin θ, X sin θ + Y cos θ )


can have an arbitrary covariance depending on the value of θ ∈ [0, 2π ].

Exercise 4.6 Let τ1 , τ2 and τ denote three independent exponentially


distributed random times with respective parameters λ1 , λ2 , λ > 0. Consider
two firms with respective default times τ1 ∧ τ = min(τ1 , τ ) and τ2 ∧ τ =
min(τ2 , τ ), where τ represents the time of a macro-economic shock.
" 107

This version: June 9, 2023


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

a) Find the tail (or survival) distribution functions of τ1 ∧ τ and τ2 ∧ τ .


b) Compute the joint survival probability

P(τ1 ∧ τ > s and τ2 ∧ τ > t), s, t ∈ R+ .

Hint: Use the relation Max(s, t) = s + t − min(s, t), s, t ∈ R+ .


c) Compute the joint cumulative distribution function

P(τ1 ∧ τ ⩽ s and τ2 ∧ τ ⩽ t), s, t ∈ R+ .

d) Compute the resulting copula


−1
C (u, v ) := FX,Y (FX (u), FY−1 (v )), 0 ⩽ u, v ⩽ 1.

∂2C
e) Compute the resulting copula density function (u, v ), u, v ∈ [0, 1].
∂u∂v

108 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Part II
Risk Measures
Chapter 5
Superhedging Risk Measure

This chapter introduces the superhedging risk measure, which can be defined
as the superhedging price of a portfolio hedging a financial derivative such
as a call or put option. Our presentation relies on financial derivatives and
their pricing in the Black-Scholes framework.

5.1 Historical Sketch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111


5.2 Financial Derivatives . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
5.3 Black-Scholes Analysis . . . . . . . . . . . . . . . . . . . . . . . . . 126
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132

5.1 Historical Sketch


Early accounts of option contracts can also be found in The Politics Aristotle
(350 BCE) by Aristotle (384-322 BCE). Option credit contracts appear to
have been used as early as the 10th century by traders in the Mediterranean.
More recently, Robert Merton and Myron Scholes shared the 1997 Nobel
Prize in economics: “In collaboration with Fisher Black, developed a pioneer-
ing formula for the valuation of stock options ... paved the way for economic
valuations in many areas ... generated new types of financial instruments
and facilitated more efficient risk management in society.Ӡ See Black and
Scholes (1973) “The Pricing of Options and Corporate Liabilities”. Journal
of Political Economy 81 (3): 637-654.
The development of options pricing tools contributed greatly to the expansion
of option markets and led to development several ventures such as the “Long
Term Capital Management” (LTCM), founded in 1994. The fund yielded

This has to be put in relation with the modern development of risk societies; “societies
increasingly preoccupied with the future (and also with safety), which generates the
notion of risk” (Wikipedia).

" 111

This version: June 9, 2023


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

annualized returns of over 40% in its first years, but registered a loss of
US$4.6 billion in less than four months in 1998, which resulted into its closure
in early 2000.
As of year 2015, the size of the financial derivatives market is estimated
at over one quadrillion (or one million billions, or 1015 ) USD, which is more
than 10 times the size of the total Gross World Product (GWP).

5.2 Financial Derivatives


The following graphs exhibit a correlation between commodity (oil) prices
and an oil-related asset price.

● ●

●● ● ● ●


● ●
●●


● ● ●
● ● ●
● ●
● ●

● ●
● ● ●
● ●

● ●
● ● ● ●


● ●

● ● ●●
● ● ● ● ● ●
● ●
● ●


● ●

● ● ●

● ● ●
● ●
● ●
● ● ●

● ● ● ●
● ● ●
● ● ● ●
● ●
● ●
● ● ●
● ● ●
● ●
● ● ● ● ●
● ● ● ● ● ●
● ●● ●
● ●
● ● ●
● ● ● ● ● ● ●
● ● ● ● ●
● ●
● ● ● ● ●
● ●
● ● ● ● ●
● ● ● ● ● ●●
● ● ● ●
● ● ● ●

● ● ● ●
● ●
100


● ● ● ● ●

10
● ● ● ●
● ●
● ● ● ● ● ●
● ● ● ● ● ●
● ●
● ● ● ● ● ● ●

● ● ● ● ● ●
● ● ● ● ● ● ●
● ● ● ●
● ●●
● ● ● ●
● ●
● ● ● ● ●
● ● ● ● ● ●
● ● ● ●

● ●
● ● ●
● ● ●
● ●
● ● ●
● ● ● ● ●
● ● ● ●
● ● ●
● ●
● ●● ●
● ● ●
● ● ● ● ● ●
● ● ● ● ●
● ● ●
●● ● ● ●
● ●

● ● ● ● ●
● ●
● ● ●
● ●
●● ● ● ● ●
● ● ● ● ● ●
● ●
● ● ● ●
● ● ● ● ●
● ● ● ● ● ●
● ● ●
● ● ● ●
● ●
● ● ● ● ● ● ●
● ●● ● ● ● ● ● ● ●
● ● ●
● ●
●● ● ●
● ● ● ● ●
● ● ● ● ● ● ● ● ● ●

● ● ● ●
● ● ● ● ● ● ● ●
● ● ● ● ● ●

● ●
● ●
● ● ● ● ●
● ● ● ● ● ● ● ●
● ● ● ● ● ● ●
● ●
● ●
● ● ● ● ● ●
● ● ●
● ● ● ●
● ● ● ● ● ●
● ●
● ●
● ● ●
● ● ●
●● ●
● ● ● ● ●

● ● ● ●
● ● ●
● ● ● ● ●
● ● ● ● ●
● ●
● ● ●
● ● ● ●
● ● ● ● ●
● ●
● ● ● ● ● ● ●
● ●●

● ●
● ● ● ●
● ● ● ●
●● ● ●
● ●
● ● ● ● ●
● ● ● ●
● ● ●
●●
● ● ● ● ●

● ● ●

● ●

● ● ●


● ●
●●



● ●

● ●
● ● ●

● ●

● ● ●

● ●

● ● ●
● ●
●● ● ●
● ● ● ●● ●

● ● ●
● ● ● ● ●
● ● ●
● ●
● ● ● ●
● ●
● ● ● ● ● ● ●
● ●
● ● ●
● ● ●

● ● ● ●

9

● ● ●

● ●
● ●
● ● ● ● ●
● ●
● ●
● ●
● ●
● ●
● ●

● ● ●
● ● ● ●

80

● ● ●

● ● ●

● ● ● ●
● ●
● ● ●
● ●
● ● ●
● ●
● ● ● ●

● ●
● ● ●●
● ●
● ●● ● ●
● ● ●
● ●
● ●
● ● ●
● ●
● ●
● ●
● ●



● ●
● ● ●

● ● ● ●
● ● ●
● ●
● ● ●
● ● ●


● ●●
● ● ● ●
● ●
● ● ●




●●
● ● ● ● ●
● ● ●
●●● ● ● ●
● ● ● ●



● ● ●
● ● ●

● ●
●●
● ●
● ●
● ● ● ● ●
● ● ● ● ●
● ●●
● ● ● ●
● ●
● ● ●
● ●
● ●
● ● ● ● ●

● ●

● ●
● ●
● ●


● ● ●

●●
● ● ● ●


● ●● ●
● ●

●● ●
● ●

● ● ● ●


8



● ● ●
● ●











● ●
● ●
●●●
60



● ●

● ●




● ●


● ●



● ●

● ●



● ● ●
● ● ●

●● ●


● ●
● ●


7

● ●


● ● ●




● ●

● ●

● ● ●
● ●
● ●

● ● ●

● ●
● ● ●


● ●

● ●●
● ● ●
40

● ●

● ●

● ●

● ●●
● ●
● ●


● ●


● ● ●

2012 2013 2014 2015 2016 2012 2013 2014 2015 2016

(a) WTI price graph. (b) Graph of Keppel Corp. stock price

Fig. 5.1: Comparison of WTI vs Keppel price graphs.

The study of financial derivatives aims at finding functional relationships


between the price of an underlying asset (a company stock price, a commodity
price, etc.) and the price of a related financial contract (an option, a financial
derivative, etc.).

Option Contracts

Referring to the philosopher Thales of Miletus (c. 624 - c. 546 BCE), Aristotle
writes:
“He (Thales) knew by his skill in the stars while it was yet winter that
there would be a great harvest of olives in the coming year; so, having a
little money, he gave deposits for the use of all the olive-presses in Chios
and Miletus, which he hired at a low price because no one bid against him.
When the harvest-time came, and many were wanted all at once and of a
sudden, he let them out at any rate which he pleased, and made a quantity
of money”.
In the above example, olive oil can be regarded as the underlying asset, while
the oil press stands for the financial derivative.
Next, we move to a description of (European) call and put options, which
are at the basis of risk management.

112 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

European put option contracts

As previously mentioned, an important concern for the buyer of a stock at


time t is whether its price ST can decline at some future date T . The buyer of
the stock may seek protection from a market crash by purchasing a contract
that allows him to sell his asset at time T at a guaranteed price K fixed at
time t. This contract is called a put option with strike price K and exercise
date T .

Fig. 5.2: Graph of the Hang Seng index - holding a put option might be useful here.

Definition 1. A (European) put option is a contract that gives its holder


the right (but not the obligation) to sell a quantity of assets at a predefined
price K called the strike price (or exercise price) and at a predefined date T
called the maturity.
In case the price ST falls down below the level K, exercising the contract will
give the holder of the option a gain equal to K − ST in comparison to those
who did not subscribe the option contract and have to sell the asset at the
market price ST . In turn, the issuer of the option contract will register a loss
also equal to K − ST (in the absence of transaction costs and other fees).
If ST is above K, then the holder of the option contract will not exercise the
option as he may choose to sell at the price ST . In this case the profit derived
from the option contract is 0.
Two possible scenarios (ST finishing above K or below K) are illustrated in
Figure 5.3.

" 113

This version: June 9, 2023


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

10
(K-ST)+=0
9
8 ST

7
Strike price
K=6 K

St 5
K-ST>0
4
3 ST

2
S0.1
1
0
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 T=1

Fig. 5.3: Two put option scenarios.

In general, the payoff of a (so called European) put option contract can be
written as
 K − ST if ST ⩽ K,

+
ϕ(ST ) = (K − ST ) :=
0, if ST ⩾ K.

20
Put option payoff (K-x)+

15

(K-x)+

10

0
80 85 90 95 100 105 110 115 120
K

Fig. 5.4: Payoff function of a put option with strike price K = 100.

See e.g. https://optioncreator.com/stwwxvz.


Example of put option: the buy back guarantee∗ in currency exchange
is a common example of European put option.

Right-click to open or save the attachment.

114 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

Cash settlement vs physical delivery

Physical delivery. In the case of physical delivery, the put option contract
issuer will pay the strike price $K to the option contract holder in exchange
for one unit of the risky asset priced ST .
Cash settlement. In the case of a cash settlement, the put option issuer will
satisfy the contract by transferring the amount C = (K − ST )+ to the option
contract holder.

The derivatives market

As of year 2015, the size of the derivatives market was estimated at more that
$1.2 quadrillion,∗ or more than 10 times the Gross World Product (GWP).
See here or here for up-to-date data on notional amounts outstanding and
gross market value from the Bank for International Settlements (BIS).

European call option contracts

On the other hand, if the trader aims at buying some stock or commodity,
his interest will be in prices not going up and he might want to purchase a
call option, which is a contract allowing him to buy the considered asset at
time T at a price not higher than a level K fixed at time t.
Definition 2. A (European) call option is a contract that gives its holder the
right (but not the obligation) to purchase a quantity of assets at a predefined
price K called the strike price, and at a predefined date T called the maturity.
Here, in the event that ST goes above K, the buyer of the option contract
will register a potential gain equal to ST − K in comparison to an agent who
did not subscribe to the call option.
Two possible scenarios (ST finishing above K or below K) are illustrated in
Figure 5.5.

One thousand trillion, or one million billion, or 1015 .

" 115

This version: June 9, 2023


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

10
ST-K>0
9
8 ST

7
Strike price
K=6 K

St 5
(ST-K)+=0
4
3 ST

2
S0.1
1
0
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 T=1

Fig. 5.5: Two call option scenarios.

In general, the payoff of a (so called European) call option contract can be
written as

 ST − K if ST ⩾ K,

+
ϕ(ST ) = (ST − K ) :=
0, if ST ⩽ K.

20
Call option payoff (K-x)+

15

(x-K)+

10

0
80 85 90 95 100 105 110 115 120
K

Fig. 5.6: Payoff function of a call option with strike price K = 100.

See e.g. https://optioncreator.com/stqhbgn.


Example of call option: the price lock guarantee∗ or price drop protection
in online ticket booking is a common example of a European call option.
According to market practice, options are often divided into a certain number
n of warrants, the (possibly fractional) quantity n being called the entitlement
ratio.

Right-click to open or save the attachment.

116 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

Cash settlement vs physical delivery

Physical delivery. In the case of physical delivery, the call option contract
issuer will transfer one unit of the risky asset priced ST to the option contract
holder in exchange for the strike price $K. Physical delivery may include
physical goods, commodities or assets such as coffee, airline fuel or live cattle.

Cash settlement. In the case of a cash settlement, the call option issuer will
fulfill the contract by transferring the amount C = (ST − K )+ to the option
contract holder.

Option pricing

In order for an option contract to be fair, the buyer of the option contract
should pay a fee (similar to an insurance fee) at the signature of the contract.
The computation of this fee is an important issue, and is known as option
pricing.

Option hedging

The second important issue is that of hedging, i.e. how to manage a given
portfolio in such a way that it contains the required random payoff (K − ST )+
(for a put option) or (ST − K )+ (for a call option) at the maturity date T .

Example: Fuel hedging and the four-way zero-collar option

install.packages("Quandl")
library(Quandl);library(quantmod)
getSymbols("DCOILBRENTEU", src="FRED")
chartSeries(DCOILBRENTEU,up.col="blue",theme="white",name = "BRENT Oil
Prices",lwd=5)
BRENT = Quandl("FRED/DCOILBRENTEU",start_date="2010-01-01",
end_date="2015-11-30",type="xts")
chartSeries(BRENT,up.col="blue",theme="white",name = "BRENT Oil Prices",lwd=5)
getSymbols("WTI", from="2010-01-01", to="2015-11-30")
WTI <- Ad(`WTI`)
chartSeries(WTI,up.col="blue",theme="white",name = "WTI Oil Prices",lwd=5)

" 117

This version: June 9, 2023


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

WTI Oil Prices [2010−01−04/2015−11−27] BRENT Oil Prices [2010−01−04/2015−11−30]


25
Last 3.52 Last 43.73

120

20

100

15

80

10

60

40

Jan 04 Jan 03 Jan 03 Jan 02 Jan 02 Jan 02 Jan 04 Jan 03 Jan 03 Jan 02 Jan 02 Jan 02
2010 2011 2012 2013 2014 2015 2010 2011 2012 2013 2014 2015

(a) WTI price graph. (b) Brent price graph

Fig. 5.7: Brent and WTI price graphs.


(April 2011)
Fuel hedge promises Kenya Airways smooth ride in volatile oil market.∗
(November 2015)
A close look at the role of fuel hedging in Kenya Airways $259 million loss.∗
The four-way call collar call option requires its holder to purchase the un-
derlying asset (here, airline fuel) at a price specified by the blue curve in
Figure 5.8, when the underlying asset price is represented by the red line.

160
four-way collar
150 y=x

140

130

120

110

100

90

80

70
70 80 90 100 110 120 130 140 150
x

Fig. 5.8: Price map of a four-way collar option.

The four-way call collar option contract will result into a positive or negative
payoff depending on current fuel prices, as illustrated in Figure 5.9.

Right-click to open or save the attachment.

118 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

20
four-way collar payoff
15

10

-5

-10

-15

-20
70 80 90 100 110 120 130 140 150
K1 K2 ST K3 K4

Fig. 5.9: Payoff function of a four-way call collar option.

The four-way call collar payoff can be written as a linear combination

ϕ(ST ) = (K1 − ST )+ − (K2 − ST )+ + (ST − K3 )+ − (ST − K4 )+

of call and put option payoffs with respective strike prices

K1 = 90, K2 = 100, K3 = 120, K4 = 130,

see e.g. https://optioncreator.com/st5rf51.

20
(K1-x)+-(K2-x)++(x-K3)+
15 -(x-K4)+

10

-5

-10

-15

-20
70 80 90 100 110 120 130 140 150
K1 K2 ST K3 K4

Fig. 5.10: Four-way call collar payoff as a combination of call and put options.∗

Therefore, the four-way call collar option contract can be synthesized by:
1. purchasing a put option with strike price K1 = $90, and
2. selling (or issuing) a put option with strike price K2 = $100, and

The animation works in Acrobat Reader on the entire pdf file.

" 119

This version: June 9, 2023


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

3. purchasing a call option with strike price K3 = $120, and


4. selling (or issuing) a call option with strike price K4 = $130.
Moreover, the call collar option contract can be made costless by adjusting
the boundaries K1 , K2 , K3 , K4 , in which case it becomes a zero-collar option.

Example - The one-step 4-5-2 model

We close this introduction with a simplified example of the pricing and hedg-
ing technique in a binary model. Consider:
i) A risky underlying stock valued S0 = $4 at time t = 0, and taking only
two possible values 
 $5
S1 =
$2

at time t = 1.
ii) An option contract that promises a claim payoff C whose values are
defined contingent to the market data of S1 as:

 $3 if S1 = $5

C :=
$0 if S1 = $2.

Exercise: Does C represent the payoff of a put option contract? Of a call


option contract? If yes, with which strike price K?
Quiz: Using this form, submit your own intuitive estimate for the price of
the claim C.
At time t = 0 the option contract issuer (or writer) chooses to invest α units
in the risky asset S, while keeping $β on our bank account, meaning that we
invest a total amount

αS0 + $β at time t = 0.

Here, the amount $β may be positive or negative, depending on whether it


is corresponds to savings or to debt, and is interpreted as a liability.
The following issues can be addressed:
a) Hedging: How to choose the portfolio allocation (α, $β ) so that the value

αS1 + $β

of the portfolio matches the future payoff C at time t = 1?


b) Pricing: How to determine the amount αS0 + $β to be invested by the
option contract issuer in such a portfolio at time t = 0?
120 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

S1 = 5 and C = 3
S1 = 5 and C = 3
S0 = 4 S0 = 4
S1 = 2 and C = 0
S1 = 2 and C = 0

Hedging or replicating the contract means that at time t = 1 the portfolio


value matches the future payoff C, i.e.

αS1 + $β = C.

Hedge, then price. This condition can be rewritten as

 $3 = α × $5 + $β if S1 = $5,

C=
$0 = α × $2 + $β if S1 = $2,

i.e.
 5α + β = 3,  α = 1 stock,
 

which yields
2α + β = 0, $β = −$2.
 

In other words, the option contract issuer purchases 1 (one) unit of the stock
S at the price S0 = $4, and borrows $2 from the bank. The price of the
option contract is then given by the portfolio value

αS0 + $β = 1 × $4 − $2 = $2.

at time t = 0.
The above computation is implemented in the attached IPython notebook∗
that can be run here or here. This algorithm is scalable and can be extended
to recombining binary trees over multiple time steps.
Definition 3. The arbitrage-free price of the option contract is defined as
the initial cost αS0 + $β of the portfolio hedging the claim payoff C.
 $3 if S1 = $5

Conclusion: in order to deliver the random payoff C =


$0 if S1 = $2.

to the option contract holder at time t = 1, the option contract issuer (or
writer) will:
1. charge αS0 + $β = $2 (the option contract price) at time t = 0,



Right-click to save as attachment (may not work on .

" 121

This version: June 9, 2023


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

2. borrow −$β = $2 from the bank,


3. invest those $2 + $2 = $4 into the purchase of α = 1 unit of stock valued
at S0 = $4 at time t = 0,
4. wait until time t = 1 to find that the portfolio value has evolved into

 α × $5 + $β = 1 × $5 − $2 = $3 if S1 = $5,

C=
α × $2 + $β = 1 × $2 − $2 = 0 if S1 = $2,

so that the option contract and the equality C = αS1 + $β can be ful-
filled, allowing the option issuer to break even whatever the evolution of
the risky asset price S.
In a cash settlement, the stock is sold at the price S1 = $5 or S1 = $2,
the payoff C = (S1 − K )+ = $3 or $0 is issued to the option contract
holder, and the loan is refunded with the remaining $2.
In the case of physical delivery , α = 1 share of stock is handed in to the
option holder in exchange for the strike price K = $2 which is used to
refund the initial $2 loan subscribed by the issuer.
Here, the option contract price αS0 + $β = $2 is interpreted as the cost of
hedging the option. We will see that this model is scalable and extends to
discrete time.
We note that the initial option contract price of $2 can be turned to C = $3
(%50 profit) ... or into C = $0 (total ruin).
Thinking further
1) The expected claim payoff at time t = 1 is

E[C ] = $3 × P(C = $3) + $0 × P(C = $0)


= $3 × P(S1 = $5).

In absence of arbitrage opportunities (“fair market”), this expected payoff


E[C ] should equal the initial amount $2 invested in the option. In that case
we should have
 E[C ] = $3 × P(S1 = $5) = $2

P(S1 = $5) + P(S1 = $2) = 1.


from which we can infer the probabilities


 2
 P(S1 = $5) = 3


(5.1)
 P(S = $2) = 1 ,


1
3

122 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

which are called risk-neutral probabilities. We see that under the risk-neutral
probabilities, the stock S has twice more chances to go up than to go down
in a “fair” market.
2) Based on the probabilities (5.1) we can also compute the expected value
E[S1 ] of the stock at time t = 1. We find

E[S1 ] = $5 × P(S1 = $5) + $2 × P(S1 = $2)


2 1
= $5 × + $2 ×
3 3
= $4
= S0 .

Here this means that, on average, no extra profit or loss can be made from
an investment on the risky stock, hence the term “risk-neutral”. In a more
realistic model we can assume that the riskless bank account yields an interest
rate equal to r, in which case the above analysis is modified by letting $β
become $(1 + r )β at time t = 1, nevertheless the main conclusions remain
unchanged.
Market-implied probabilities
By matching the theoretical price E[C ] to an actual market price data $M
as

$M = E[C ] = $3 × P(C = $3) + $0 × P(C = $0) = $3 × P(S1 = $5)

we can infer the probabilities



$M
 P(S1 = $5) = 3



(5.2)
 P(S1 = $2) = 3 − $M ,



3
which are implied probabilities estimated from market data, as illustrated in
Figure 5.11. We note that the conditions

0 < P(S1 = $5) < 1, 0 < P(S1 = $2) < 1

are equivalent to 0 < $M < 3, which is consistent with financial intuition in


a non-deterministic market. Figure 5.11 shows the time evolution of proba-
bilities p(t), q (t) of two opposite outcomes.

" 123

This version: June 9, 2023


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

Fig. 5.11: Implied probabilities.


Note that implied probabilities should also be used with caution, as shown
in Figures 5.12-5.13.

Fig. 5.12: Implied probabilities according to bookmakers.

124 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

Fig. 5.13: Implied probabilities according to polling.

Implied probabilities can be estimated using e.g. binary options.


The Practitioner expects a good model to be:
• Robust with respect to missing, spurious or noisy data,
• Fast - prices have to be delivered daily in the morning,
• Easy to calibrate - parameter estimation,
• Stable with respect to re-calibration and the use of new data sets.
Typically, a medium size bank manages 5,000 options and 10,000 deals daily
over 1,000 possible scenarios and dozens of time steps. This can mean a
hundred million computations of E[C ] daily, or close to a billion such com-
putations for a large bank.
The Mathematician tends to focus on more theoretical features, such as:
• Elegance,
• Sophistication,
• Existence of analytical (closed-form) solutions / error bounds,
• Significance to mathematical finance.
This includes:
• Creating new payoff functions and structured products,
• Defining new models for underlying asset prices,
• Finding new ways to compute expectations E[C ] and hedging strategies.
The methods involved include:
• Monte Carlo (60%),

" 125

This version: June 9, 2023


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

10

0.0 0.2 0.4 0.6 0.8 1.0


Time

Fig. 5.14: One hundred sample price paths used for the Monte Carlo method.

• PDEs and finite differences (30%),


• Other analytic methods and approximations (10%),
+ AI and Machine Learning techniques.

5.3 Black-Scholes Analysis

In this section we consider an asset price process (St )t∈R+ modeled as the
geometric Brownian motion (1.9) of Proposition 1.4.

Market Model and Self-Financing Portfolio

Let (r (t))t∈R+ , (µ(t))t∈R+ and (σ (t))t∈R+ be deterministic nonnegative


bounded functions. Let (At )t∈R+ be a risk-free asset with price given by
dAt
= r (t)dt, A0 = 1, t ⩾ 0,
At
i.e. rt
r (s)ds
At = A0 e 0 , t ⩾ 0.
Let (St )t∈[0,T ] be the price process defined by the stochastic differential equa-
tion
dSt = µ(t)St dt + σ (t)St dBt , t ⩾ 0,
i.e., in integral form,
wt wt
St = S0 + µ(u)Su du + σ (u)Su dBu , t ⩾ 0,
0 0

with solution
w wt 1
 
t
St = S0 exp σ (s)dBs + µ(s) − σ 2 (s) ds ,
0 0 2

126 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

t ∈ R+ .
Let ηt and ζt be the numbers of units invested at time t ⩾ 0, respectively
in the assets priced (St )t∈R+ and (At )t∈R+ . The value of the portfolio Vt at
time t ⩾ 0 is given by

Vt = ζt At + ηt St , t ⩾ 0.

Black-Scholes formula for European call options

In the case of European call options with payoff function ϕ(x) = (x − K )+


we have the following Black-Scholes formula.
Proposition 5.1. The price at time t ∈ [0, T ] of the European call option
with strike price K and maturity T is given by

BSc (St , K, r, T − t, σ ) = e−(T −t)r E∗ [(ST − K )+ | Ft ] (5.3)


−(T −t)r
= St Φ d+ (T − t) − Ke Φ d− ( T − t ) ,
 

0 ⩽ t ⩽ T , with

log(St /K ) + (r + σ 2 /2)(T − t)

d+ (T − t ) : = √ ,




 σ T −t

log(St /K ) + (r − σ 2 /2)(T − t)


 d− ( T − t ) : = √ , 0 ⩽ t < T,


σ T −t
where “log” denotes the natural logarithm “ln” and Φ is the standard Gaus-
sian Cumulative Distribution Function.
We note the relation

d+ (T − t) = d− (T − t) + |σ| T − t, 0 ⩽ t < T. (5.4)

Here, “log” denotes the natural logarithm “ln”, and


1 w x −y2 /2
Φ (x) : = P(N ⩽ x) = √ e dy, x ∈ R,
2π −∞
is the standard Gaussian Cumulative Distribution Function (CDF).

" 127

This version: June 9, 2023


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

1.2
1
Gaussian CDF Φ(x)
1

0.8
Φ(x)
0.6

0.4

0.2

0
-4 -3 -2 -1 0 1 2 3 4
x

Fig. 5.15: Graph of the Gaussian Cumulative Distribution Function (CDF).

In other words, the European call option with strike price K and maturity
T is priced at time t ∈ [0, T ] as

BSc (St , K, r, T − t, σ ) = St Φ d+ (T − t) − Ke−(T −t)r Φ d− (T − t) ,


 

0 ⩽ t ⩽ T . The following R script is an implementation of the Black-Scholes


formula for European call options in .∗

BSCall <- function(S, K, r, T, sigma)


{d1 <- (log(S/K)+(r+sigma^2/2)*T)/(sigma*sqrt(T));d2 <- d1 - sigma * sqrt(T)
BSCall = S*pnorm(d1) - K*exp(-r*T)*pnorm(d2)
BSCall}

In comparison with the discrete-time Cox-Ross-Rubinstein (CRR) model, the


interest in the Black-Scholes formula is to provide an analytical solution that
can be evaluated in a single step, which is computationally much more effi-
cient.

Fig. 5.16: Graph of the Black-Scholes call price map with strike price K = 100.†

Download the corresponding IPython notebook that can be run here or here.

128 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

Figure 5.16 presents an interactive graph of the Black-Scholes call price map,
i.e. of the function

(t, x) 7−→ BSc (x, K, r, T − t, σ ) = xΦ d+ (T − t) − Ke−(T −t)r Φ d− (T − t) .


 

70
60
50
40
30
20
10
0
0 40
80
100 120 Time in days
Underlying asset price 60 160

Fig. 5.17: Time-dependent solution of the Black-Scholes PDE (call option).∗

The next proposition is proved by a direct differentiation of the Black-Scholes


function.
Proposition 5.2. The Black-Scholes Delta of the European call option is
given by

BSc (x, K, r, T − t, σ )|x=St = Φ d+ (T − t) ∈ [0, 1], (5.5)

ξt = ξt (St ) =
∂x
where d+ (T − t).
As a consequence of Proposition 5.2, the Black-Scholes call price splits into a
risky component St Φ d+ (T − t) and a riskless component −Ke−(T −t)r Φ d− (T −
t) , as follows:


BSc (St , K, r, T − t, σ ) = St Φ d+ (T − t) − Ke−(T −t)r Φ d− (T − t) , ,


 
| {z } | {z }
Risky investment (held) Risk free investment (borrowed)
(5.6)
0 ⩽ t ⩽ T . The following R script is an implementation of the Black-Scholes
Delta for European call options.

DeltaCall <- function(S, K, r, T, sigma)


{d1 <- (log(S/K)+(r+sigma^2/2)*T)/(sigma*sqrt(T))
DeltaCall = pnorm(d1);DeltaCall}


Right-click on the figure for interaction and “Full Screen Multimedia” view.

The animation works in Acrobat Reader on the entire pdf file.

" 129

This version: June 9, 2023


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

In Figure 5.18 we plot the Delta of the European call option as a function of
the underlying asset price and of the time remaining until maturity.

0.5

150
100 0
Underlying 5
50 10
15
0 Time to maturity T-t
Fig. 5.18: Delta of a European call option with strike price K = 100, r = 3%, σ = 10%.

Black-Scholes formula for European Put Options

The European put option price is computed in the next proposition.

Proposition 5.3. The price at time t ∈ [0, T ] of the European put option
with strike price K and maturity T is given by

BSp (St , K, r, T − t, σ ) = e−(T −t)r E∗ [(K − ST )+ | Ft ]


= Ke−(T −t)r Φ − d− (T − t) − St Φ − d+ (T − t) ,
 

0 ⩽ t ⩽ T , with

log(St /K ) + (r + σ 2 /2)(T − t)

d (T − t) : = √ ,

 +


 σ T −t

log(St /K ) + (r − σ 2 /2)(T − t)


 d− ( T − t ) : = √ , 0 ⩽ t < T,


σ T −t
where “log” denotes the natural logarithm “ln” and Φ is the standard Gaus-
sian Cumulative Distribution Function.
The Black-Scholes formula for European Put Options is plotted in illustrated
in Figure 5.19.

130 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

Fig. 5.19: Graph of the Black-Scholes put price function with strike price K = 100.∗

In other words, the European put option with strike price K and maturity
T is priced at time t ∈ [0, T ] as

Blp (St , K, r, T − t, σ ) = Ke−(T −t)r Φ − d− (T − t) − St Φ − d+ (T − t) , 0 ⩽ t ⩽ T.


 

40

30

20

10

00 60
40 80 100
120 160 Underlying asset price
Time in days

Fig. 5.20: Time-dependent solution of the Black-Scholes PDE (put option).†

The following R script is an implementation of the Black-Scholes formula for


European put options in .
BSPut <- function(S, K, r, T, sigma)
{d1 = (log(S/K)+(r+sigma^2/2)*T)/(sigma*sqrt(T));d2 = d1 - sigma * sqrt(T);
BSPut = K*exp(-r*T) * pnorm(-d2) - S*pnorm(-d1);BSPut}

The Delta of the Black-Scholes put option is obtained in the following propo-
sition.
Proposition 5.4. The Delta of the Black-Scholes put option is given by

Right-click on the figure for interaction and “Full Screen Multimedia” view.

The animation works in Acrobat Reader on the entire pdf file.

" 131

This version: June 9, 2023


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

ξt = −(1 − Φ d+ (T − t) ) = −Φ − d+ (T − t) ∈ [−1, 0], 0 ⩽ t ⩽ T.


 

As a consequence of Proposition 5.4, the Black-Scholes put price splits


into a risky component −St Φ − d+ (T − t) and a riskless component


Ke−(T −t)r Φ − d− (T − t) , as follows:




BSp (St , K, r, T − t, σ ) = Ke−(T −t)r Φ − d− (T − t) − St Φ − d+ (T − t) , 0 ⩽ t ⩽ T.


 
| {z } | {z }
Risk−free investment (savings) Risky investment (short)
(5.7)

DeltaPut <- function(S, K, r, T, sigma)


{d1 <- (log(S/K)+(r+sigma^2/2)*T)/(sigma*sqrt(T)); DeltaPut = -pnorm(-d1);DeltaPut}

In Figure 5.21 we plot the Delta of the European put option as a function of
the underlying asset price and of the time remaining until maturity.

-0.5

-1

150
100 0
Underlying 5
50 10
15
0 Time to maturity T-t

Fig. 5.21: Delta of a European put option with strike price K = 100, r = 3%, σ = 10%.

Exercises

Exercise 5.1 Consider a risky asset valued S0 = $3 at time t = 0 and taking


only two possible values S1 ∈ {$1, $5} at time t = 1, and a financial claim
given at time t = 1 by

 $0 if S1 = $5

C :=
$2 if S1 = $1.

Is C the payoff of a call option or of a put option? Give the strike price of
the option.

132 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

Exercise 5.2 Consider a risky asset valued S0 = $4 at time t = 0, and taking


only two possible values S1 ∈ {$2, $5} at time t = 1. Compute the initial
value V0 = αS0 + $β of the portfolio hedging the claim payoff

 $0 if S1 = $5

C=
$6 if S1 = $2

at time t = 1, and find the corresponding risk-neutral probability measure


P∗ .

Exercise 5.3 Consider a risky asset valued S0 = $4 at time t = 0, and taking


only two possible values S1 ∈ {$5, $2} at time t = 1, and the claim payoff

 $3 if S1 = $5

C= at time t = 1.
$0 if S1 = $2.

We assume that the issuer charges $1 for the option contract at time t = 0.
a) Compute the portfolio allocation (α, β ) made of α stocks and $β in cash,
so that:
i) the full $1 option price is invested into the portfolio at time t = 0,
and
ii) the portfolio reaches the C = $3 target if S1 = $5 at time t = 1.
b) Compute the loss incurred by the option issuer if S1 = $2 at time t = 1.

Exercise 5.4
a) Consider the following market model:
b

a
(1)
(1) (1 + r )S0
S0

i) Does this model allow for arbitrage?


Yes | No |

ii) If this model allows for arbitrage opportunities, how can they be
realized?
By shortselling | By borrowing on savings | N.A. |

" 133

This version: June 9, 2023


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

b) Consider the following market model:


b
(1)
(1 + r )S0
(1)
S0 a

i) Does this model allow for arbitrage?


Yes | No |

ii) If this model allows for arbitrage opportunities, how can they be
realized?
By shortselling | By borrowing on savings | N.A. |

c) Consider the following market model:


(1)
(1 + r )S0

b
(1)
S0 a

i) Does this model allow for arbitrage?


Yes | No |

ii) If this model allows for arbitrage opportunities, how can they be
realized?
By shortselling | By borrowing on savings | N.A. |

Exercise 5.5 In a market model with two time instants t = 0 and t = 1 and
risk-free interest rate r, consider:
(0) (0) (0)
- a riskless asset valued S0 at time t = 0, and value S1 = (1 + r )S0
at time t = 1.
(1)
- a risky asset with price S0 at time t = 0, and three possible values at
time t = 1, with a < b < c, i.e.:
 (1)
 S0 (1 + a),





(1)
S1 = S0(1) (1 + b),




 (1)

S0 (1 + c).

134 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

a) Show that this market is without arbitrage but not complete.


b) In general, is it possible to hedge (or replicate) a claim with three distinct
claim payoff values Ca , Cb , Cc in this market?

Exercise 5.6 Superhedging risk measure. Consider a stock valued S0 at time


t = 0, and taking only two possible values S1 = S 1 or S1 = S 1 at time t = 1,
with S 1 < S 1 .
a) Compute the initial portfolio allocation (α, β ) of a portfolio made of α
units of stock and $β in cash, hedging the call option with strike price
K ∈ [S 1 , S 1 ] and claim payoff

 S 1 − K if S1 = S 1

+
C = (S1 − K ) =
$0 if S1 = S 1 , at time t = 1.

b) Show that the risky asset allocation α satisfies the condition α ∈ [0, 1].
c) Compute the Superhedging Risk Measure SRMC ∗ of the claim C = (S1 −
K )+ .

Exercise 5.7 Given two strike prices K1 < K2 , we consider a long box spread
option, realized as the combination of four legs with same maturity date:
• One long call with strike price K1 and payoff function (x − K1 )+ ,
• One short put with strike price K1 and payoff function −(K1 − x)+ ,
• One short call with strike price K2 and payoff function −(x − K2 )+ ,
• One long put with strike price K2 and payoff function (K2 − x)+ .

Short put at K1
Long put at K2
Short call at K2
Long call at K1

K1 x K2
Fig. 5.22: Graphs of call/put payoff functions.
a) Find the payoff of the long box spread option in terms of K1 and K2 .
b) From Table 5.1, find a choice of strike prices K1 < K2 that can be used
to build a long box spread option on the Hang Seng Index (HSI).
c) Using Table 5.1, price the option built in part (b) in index points, and
then in HK$.
Hints.

“The smallest amount necessary to be paid for a portfolio at time t = 0 so that the
value of this portfolio at time t = 1 is at least as great as C”.

" 135

This version: June 9, 2023


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

i) The closing prices in Table 5.1 are warrant prices quoted in index
points.
ii) Warrant prices are converted to option prices by multiplication by
the number given in the “Entitlement Ratio” column.
iii) The conversion rate from index points to HK$ is HK$50 per index
point.
d) Would you buy the option priced in part (c) ?

Table 5.1: Call and put options on the Hang Seng Index (HSI).

136 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Chapter 6
Value at Risk

Value at risk (VaR) is a measure of risk which is used to estimate the amount
that can potentially be lost on an investment within a certain time range.
This chapter presents the concept of risk measure, including quantile risk
measures and Value at Risk, together with experiments based on financial
data sets.

6.1 Risk Measures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137


6.2 Quantile Risk Measures . . . . . . . . . . . . . . . . . . . . . . . . 142
6.3 Value at Risk (VaR) . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
6.4 Numerical estimates . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155

6.1 Risk Measures


The potential losses asssociated to a given risk will be modeled by the values
of a random variable X.
Definition 6.1. A risk measure is a mapping that assigns a value VX to a
given loss random variable X.
For insurance companies, which need to hold a capital in order to meet future
liabilities, the capital CX required to face the risk induced by a potential loss
X can be defined as
CX := VX − LX , (6.1)
where
a) VX stands for an upper “reasonable” estimate of the potential loss asso-
ciated to X.
b) LX represents the liabilities of the company.

" 137

This version: June 9, 2023


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

When LX < 0 the amount −Lx > 0 corresponds to a debt owed by the
company, while LX > 0 corresponds to positive liabilities such as deferred
revenue or to a debt owed to the company.
When estimating the liabilities of the company by E[X ], the required capital
is given by
CX = VX − E[X ].

Some examples of risk measures (Hardy (2006))

a) The expected value premium principle is the risk measure defined by

VX := E[X ] + αE[X ]

for some α ⩾ 0. For α = 0, VX := E[X ] it is called the pure premium risk


measure.
b) The standard deviation premium principle is the risk measure defined by

VX := E[X ] − α Var[X ]

for some α ⩾ 0, where Var[X ] denotes the variance of X.


c) The Conditional Tail Expectation (CTE) over negative losses X is the risk
measure defined as the conditional mean
E[X 1{X<0} ]
V X : = E[X | X < 0] = ,
P(X < 0)

where 1{X<0} is the indicator function defined as

 1 if X < 0,

1{X<0} =
0 if X ⩾ 0.

We refer to Lemma 12.15 for the following definition.


Definition 6.2. Let A be an event such that P(A) > 0. The conditional
expectation of X : Ω −→ N given the event A is defined as
1
E[X | A] : = E [ X 1A ] .
P(A)

For example, consider the sample space Ω = {1, 3, −1, −2, 5, 7} with the
non-uniform probability measure given by
1 2
P({−1}) = P({−2}) = P({1}) = P({3}) = P({7}) = , P({5}) = ,
7 7

138 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

and the random variable


X : Ω −→ Z
given by
X (k ) = k, k = 1, 3, −1, −2, 5, 7.
Here, E[X | X > 1] denotes the expected value of X given the event

A := {X > 1} = {3, 5, 7} ⊂ Ω,

i.e. the mean value of X given that X is strictly greater than one. This
conditional expectation can be computed as

E[X | X > 1]
= 3 × P(X = 3 | X > 1) + 5 × P(X = 5 | X > 1) + 7 × P(X = 7 | X > 1)
3+2×5+7
=
4
3+5+5+7
=
7 × 4/7
1
E X 1{X>1} ,
 
=
P(X > 1)

where P(X > 1) = 4/7, and the truncated expectation E X 1{X>1} is given
 

by E X 1{X>1} = (3 + 2 × 5 + 7)/7.
 

Next, consider the following market return data.

getSymbols("^HSI",from="2013-06-01",to="2014-10-01",src="yahoo")
stock<-Ad(`HSI`);returns <- as.vector((stock-lag(stock))/lag(stock));
times=index(stock);m=mean(returns[returns<0],na.rm=TRUE)
dev.new(width=16,height=7);par(oma=c(0,1,0,0))
plot(times,returns,pch=19,cex=0.4,col="blue", ylab="", xlab="", main = '', las=1,
cex.lab=1.8, cex.axis=1.8, lwd=3)
segments(x0 = times, x1 = times, y0 = 0, y1 = returns,col="blue")
abline(h=m,col="red",lwd=3); length(!is.na(returns))

" 139

This version: June 9, 2023


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

0.10

0.05

0.00

−0.05

−0.10

2020 2021

Fig. 6.1: Estimating liabilities by the conditional mean E[X | X < 0] over 346 returns.

The next code is used in Figure 6.1 to estimate liabilities using the risk
measure
E[X 1{X<0} ]
V X = E[X | X < 0] = .
P(X < 0)
returns <- returns[!is.na(returns)]
condmean<-mean(returns[returns<0])
n <- length(returns); sum<-sum(returns[returns<0])
proportion<-length(returns[returns<0])/length(returns)
condmean; sum/proportion/n
condmean<-mean(returns[returns<(-0.025)])
n <- length(returns); sum<-sum(returns[returns<(-0.025)])
proportion<-length(returns[returns<(-0.025)])/length(returns)
condmean; sum/proportion/n

Coherent risk measures

Definition 6.3. A risk measure V is said to be coherent if it satisfies the


following four properties, for any two random variables X, Y :
i) Monotonicity:
X ⩽ Y =⇒ VX ⩽ VY ,
ii) (Positive) homogeneity:

VλX = λVX , for constant λ > 0,


iii) Translation invariance:

Vµ + X = µ + VX , for constant µ > 0,


iv) Subadditivity:
140 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

VX +Y ⩽ VX + VY .
Subadditivity means that the combined risk of several portfolios is lower than
the sum of risks of those portfolios, as happens usually through portfolio
diversification. For example, one person traveling might insure the unlikely
loss of her phone for VX = $100. However, two people traveling together
might want to insure the phone loss event at a level VX +Y lower than VX +
VY = $100 + $100 as the simultaneous loss of both phones during a same
trip seems even more unlikely.
The concept of subadditivity is common in pricing, as shown in the fol-
lowing example:

Price ⩽ Price + Price + Price .


   

The expectation of random variables

VX : = E [ X ] ,

also called the pure premium risk measure, is an example of a coherent (and
additive) risk measure satisfying the above conditions (i)-(iv ).

Distortion risk measures

More generally, any risk measure of the form

MX = E[XfX (X )],

cf. e.g. (7.5) below, is homogeneous, and translation invariant, when fX is


a distortion function, i.e. a non-negative, non-decreasing function such that
E[fX (X )] = 1, and satisfying

fλX (λx) = fX (x) and fµ+X (µ + x) = fX (x), x ⩾ 0, λ > 0, µ ⩾ 0.

i) (Positive) homogeneity. For λ > 0 and µ ⩾ 0, we have

E[λXfµ+λX (λX )] = E[λXfµ+X (X )] = λE[Xfµ+X (X )].

ii) Translation invariance: For µ ⩾ 0 we have

E[(µ + X )fµ+X (µ + X )] = E[(µ + X )fX (X )]


= E[XfX (X )] + µE[fX (X )]
= µ + E[XfX (X )].

" 141

This version: June 9, 2023


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

6.2 Quantile Risk Measures


Definition 6.4. The Cumulative Distribution Function (CDF) of a random
variable X is the function

FX : R −→ [0, 1]

defined by
FX ( x ) : = P ( X ⩽ x ) , x ⩾ 0.
Any cumulative distribution function FX satisfies the following properties:
i) x 7→ FX (x) is non-decreasing,
ii) x 7→ FX (x) is right-continuous,
iii) limx→∞ FX (x) = 1,
iv) limx→−∞ FX (x) = 0.
In addition, any cumulative distribution function FX admits left limits in the
following sense.
Proposition 6.5. For any non-decreasing sequence (xn )n⩾1 converging to
x ∈ R, we have

lim FX (xn ) = lim P(X ⩽ xn ) = P(X < x). (6.2)


n→∞ n→∞

Proof. By (12.17), we have

P(X < x) = P(X ∈ (−∞, x))


 
[
=P X∈
 (−∞, xn ]
n⩾1
= lim P(X ∈ (−∞, xn ])
n→∞
= lim FX (xn ).
n→∞

x <- seq(-4, 4, length=1000)


plot(x, pnorm(x, mean=0, sd=1), type="l", lwd=3, xlab = 'x', ylab = '',main = '',
col='blue', ylim=c(-0.001,1.002), las=1, cex.lab=2.5, cex.axis=2.5, xaxs='i', yaxs='i')
grid(4, 10, lwd = 2)
plot(x, pexp(x, 1), type="l", lwd=3, xlab = 'x', ylab = '',main = '', col='blue',
ylim=c(-0.001,1.002), las=1, cex.lab=2.5, cex.axis=2.5, xaxs='i', yaxs='i')
grid(4, 10, lwd = 2)
plot(x, ppois(x, 1), type="l", lwd=3, xlab = 'x', ylab = '',main = '', col='blue',
ylim=c(-0.001,1.002), las=1, cex.lab=2.5, cex.axis=2.5, xaxs='i', yaxs='i')
grid(4, 10, lwd = 2)

142 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

Figure 6.2-(a) shows the continuous Cumulative Distribution Function


1 w x −y2 /2
FX (x) := P(X ⩽ x) = √ e dy, x ⩾ 0,
2π −∞

of a Gaussian random variable X ≃ N (0, 1).

1.0 1.0 1.0

0.8 0.8 0.8

0.6 0.6 0.6

0.4 0.4 0.4

0.2 0.2 0.2

0.0 0.0 0.0


−4 −2 0 2 4 −4 −2 0 2 4 −4 −2 0 2 4
x x x

(a) Normal CDF. (b) Exponential CDF. (c) Poisson CDF.

Fig. 6.2: Cumulative distribution functions.


On the other hand, a random variable X may have a discontinuous cumulative
distribution function, as illustrated in Figure 6.3 with

P(X = 0) = P(X ⩽ 0) − P(X < 0) = 0.25 > 0.

Fig. 6.3: Cumulative distribution function with discontinuities.∗

More generally, by Proposition 6.5 the gap generated by any discontinuity of


a CDF at the point x ∈ R, is given by

P(X = x) = P(X ⩽ x) − P(X < x) = FX (x) − lim FX (y ).


y↗x

On the other hand, if FX (x) is differentiable in x ∈ R then the distribution of


the random variable X is said to admit a probability density function (PDF)
fX (x) given as the derivative

Picture taken from https://www.probabilitycourse.com/.

" 143

This version: June 9, 2023


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


fX (x) = FX (x), x ⩾ 0.

Definition 6.6. Given X a random variable with cumulative distribution


function FX : R −→ [0, 1] and a level p ∈ (0, 1), the p-quantile qXp of X is
defined by
qXp := inf{x ∈ R : P(X ⩽ x) ⩾ p}.

Fig. 6.4: Example of quantiles given as percentiles.

Quantiles of common distributions

The quantiles of various distributions can be obtained in R.


- Gaussian distribution. The command

qnorm(.95, mean=0, sd=1)

shows that the 95%-quantile of a N (0, 1) Gaussian random variable is


1.644854.

144 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

1.0
p=0.95
0.4
0.9

Probability density
0.8
0.3
0.7

qZ0.95
0.6

0.5 0.2
0.4

0.3
0.1
0.2

0.1

0.0 0
−4 −3 −2 −1 0 1 qZ0.95 2 3 4 5 −4 −3 −2 −1 0 1 2 3 4
x

(a) Gaussian quantile and CDF. (b) Gaussian quantile and CDF.

Fig. 6.5: Gaussian quantile qZp = 1.644854 at p = 0.95.

- Exponential distribution. The command

qexp(.95, 1)

displays the 95%-quantile of an exponentially distributed random variable


with CDF
P(X ⩽ x) = 1 − e−λx , x ⩾ 0.
We have

VXp = qX
p

= inf x ∈ R : P(X ⩽ x) ⩾ p


1
= − log(1 − p)
λ
1
= E[X ] log ,
1−p

and when p = 95% and λ = 1 this yields

VXp = 2.995732 ≃ 2.996E[X ].


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
1
0.9
Probability density

0.8
0.7
0.6
0.5
0.4
0.95

0.3
qX

0.2
0.1
0
0 1 2 4 5 6 0 1 2 3 4 5 6
qX0.95

(a) Exponential quantile and CDF. (b) Exponential quantile and CDF.

Fig. 6.6: Exponential quantile qX


p
= 2.995732 at p = 0.95.

- Student distribution. The command

" 145

This version: June 9, 2023


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

qt(.90, df=5)

displays the 90%-quantile of a Student t-distributed random variable with


5 degrees of freedom, which is 1.475884.

Empirical Cumulative Distribution Function

Definition 6.7. The empirical Cumulative Distribution Function (CDF) of


an N -point data set {x1 , x2 , x3 , . . . , xN } is estimated as
N
1 X
FN ( x ) : = 1{xi ⩽x} , x ⩾ 0.
N
i=1

getSymbols("^STI",from="1990-01-03",to="2015-01-03",src="yahoo")
getSymbols("1800.HK",from=Sys.Date()-50,to=Sys.Date(),src="yahoo")
stock=Ad(`1800.HK`);stock.rtn=(stock-lag(stock))/lag(stock);
stock.ecdf=ecdf(as.vector(stock.rtn))
plot(stock.ecdf, xlab = 'Sample Quantiles', ylim=c(-0.001,1.002), xlim=c(-0.15,0.15), ylab =
'', lwd = 3, main = '',col='blue', las=1, cex.lab=1.5, cex.axis=1.5, xaxs='i', yaxs='i')
grid(4, 10, lwd = 2)
getSymbols("1800.HK",from=Sys.Date()-3650,to=Sys.Date(),src="yahoo")
stock=Ad(`1800.HK`);stock.rtn=(stock-lag(stock))/lag(stock);
stock.ecdf=ecdf(as.vector(stock.rtn))
plot(stock.ecdf, xlab = 'Sample Quantiles', ylim=c(-0.001,1.002), xlim=c(-0.15,0.15), ylab =
'', lwd = 2, main = '',col='blue', cex=1, las=1, cex.lab=1.5, cex.axis=1.5, xaxs='i',
yaxs='i')
grid(4, 10, lwd = 2)

1.0 1.0

0.8 0.8

0.6 0.6

0.4 0.4

0.2 0.2

0.0 0.0
−0.15 −0.10 −0.05 0.00 0.05 0.10 0.15 −0.15 −0.10 −0.05 0.00 0.05 0.10 0.15

Sample Quantiles Sample Quantiles

(a) Empirical CDF. (b) Empirical CDF on 50 samples.

Fig. 6.7: Empirical cumulative distribution functions.

Note that the empirical distribution function in Figure 6.7-a) has a visible
discontinuity, or gap, at 0, whose height 0.05483347 is given by

sum(!is.na(stock.rtn[stock.rtn==0]))/sum(!is.na(stock.rtn))

146 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

6.3 Value at Risk (VaR)


Value at Risk has two objectives:
i) to provide a measure for risk, and
ii) to determine an adequate level of capital reserves that matches the cur-
rent level of risk.
In other words, managing risk means here determining a level VX of provision
or capital requirement that will not be “too much” exceeded by X.
In this respect, the probability P(X > V ) that X exceeds the level V is
of a capital importance. Setting V such that for example

P(X ⩽ V ) ⩾ 0.95, i.e. P(X > V ) ⩽ 0.05,

means that insolvency will occur with probability less that 5%.
The 95%-quantile risk measure is the smallest value of V such that

P(X ⩽ V ) ⩾ 0.95, i.e. P(X > V ) ⩽ 0.05.

More precisely, we have the following definition.


Definition 6.8. The Value at Risk VXp of a random variable X at the level
p ∈ (0, 1) is the p-quantile of X defined by

VXp := inf{x ∈ R : P(X ⩽ x) ⩾ p}. (6.3)

In other words, for some decreasing sequence (xn )n⩾1 such that

P ( X ⩽ xn ) ⩾ p for all n ⩾ 1,

we have
VXp := lim xn . (6.4)
n→∞

Proposition 6.9. The Value at Risk VXp of X at the level p ∈ (0, 1) satisfies

P X < VX ⩽ p ⩽ P X ⩽ VXp ,
p
(6.5)


and
0 ⩽ 1 − p − P X > VXp ⩽ P X = VXp . (6.6)
 

In particular, if P(X = VXp ) = 0, then we have

p = P X < VXp = P(X ⩽ VXp ). (6.7)




Proof. Using the above decreasing sequence (xn )n⩾1 and the right continuity
of the cumulative distribution function FX , we have

" 147

This version: June 9, 2023


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

P X ⩽ VXp = P(X ⩽ lim xn )



n→∞
= FX lim xn

n→∞
= lim FX (xn )
n→∞
= lim P(X ⩽ xn )
n→∞
⩾ p.

On the other hand, if P X < VXp > p then there is a strictly increasing


sequence (yn )n⩾1 such that

lim yn = VXp
n→∞

and by (6.2) we have

P X < VXp = lim P(X ⩽ yn ) > p,



n→∞

in which case there would exist n ⩾ 1 such that yn < VXp and P(X ⩽ yn ) >
p, which contradicts (6.3). The inequality (6.6) follows from (6.5) and the
relations

P X ⩾ VXp = 1 − P X < VXp , P X > VXp = 1 − P X ⩽ VXp


   

and
P X ⩽ VXp = P X < VXp + P X = VXp .
  

The inequality (6.7) is similarly a consequence of (6.6). □


p p
When P X = VX > 0 we may have P X > VX = 0, for example in the
case of a Bernoulli random variable X ∈ {0, 1} with the distribution

P(X = 1) = 2%, P(X = 0) = 98%.

In this case, we check from Figure 6.8 that VX0.99 = 1.

FX (x); FY (x)

1.00
p= 0.99

0.98
0.97
0.96

00 1 2 3 x
VX0.99

Fig. 6.8: Cumulative distribution function of X.

148 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

Proposition 6.10. The function p 7→ VXp is a non-decreasing, left-continuous


function of p ∈ [0, 1], and it admits limits on the right.

Proof. By (6.3), the function p 7→ VXp is the generalized inverse of the Cu-
mulative Distribution Function

x 7→ FX (x) := P(X ⩽ x), x ⩾ 0.

of X. By e.g. Proposition 2.3-(2) in Embrechts and Hofert (2013), since FX (x)


is non-decreasing in x ∈ R, its generalized inverse p 7→ VXp is non-decreasing,
left-continuous, and it admits limits on the right. □
In particular, if FX is continuous and strictly increasing it admits an inverse
−1
FX , and in this case we have
−1
V X ( p ) = FX (p), p ∈ (0, 1).

The next proposition also follows from the Definition 6.8 of VXp .
Proposition 6.11. For all x ∈ R we have

VXp ⩽ x ⇐⇒ P(X ⩽ x) ⩾ p. (6.8)


Proof. If P(X ⩽ x) ⩾ p then we have

VXp = inf{y ∈ R : P(X ⩽ y ) ⩾ p} ⩽ x.

On the other hand, choosing a strictly decreasing sequence (xn )n⩾1 such that

lim xn = VXp and P(X ⩽ xn ) ⩾ p, n ⩾ 1,


n→∞

if VXp ⩽ x we have

P(X ⩽ x) ⩾ P(X ⩽ VXp ) = lim P(X ⩽ xn ) ⩾ p


n→∞

by the right continuity of the cumulative distribution function FX of X. □


On the other hand, the Value at Risk VXp does not reveal any information on
how large losses can be beyond VXp .
Proposition 6.12. Assume that the cumulative distribution function FX is
p
continuous and strictly increasing. Then we have V−X = −VX1−p .
Proof. We have

F−X (x) = P(−X ⩽ x)


= P(X ⩾ −x)
= 1 − P(X < −x)

" 149

This version: June 9, 2023


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

= 1 − P(X ⩽ −x)
= 1 − FX (−x),

hence
−1 −1
(p) = 1 − FX − F−X (p) ,
 
p = F−X F−X
which yields
p
V−X −1
= F−X −1
(p) = −FX (1 − p) = −VX1−p , p ∈ (0, 1).


Figure 6.9-(a) shows an example where the continuity of FX ensures the sym-
p
metry property V−X = −VX1−p of Proposition 6.12. On the other hand, Fig-
q
ure 6.9-(b) shows that in the discontinuous case the relation V−X = −VX1−q
fails for q = 0.8, although it holds for p = 0.9.
1−p
V−X
1 1
p = 0.9 p = 0.9

0.8 q = 0.8

0.7 0.7
0.6 0.6
0.5 0.5
0.4 0.4
0.3 0.3
0.2 1 − q = 0.2
1 − p = 0.1 1 − p = 0.1

0 p 4 0 q p 4
-6 -5 -4 V1−p -2 -1 0 1 2 3 VX 5 6 -6 -5 -4 V1−q -2 -1 0 1 VX 3 VX 5 6
−X −X

(a) Continuous CDF. (b) Discontinuous CDF.

Fig. 6.9: Symmetric and nonsymmetric VaR.

Next, we check the properties of Value at Risk.


a) Monotonicity. Value at Risk is a monotone risk measure.
Proof. If X ⩽ Y then

P(Y ⩽ x) = P(X ⩽ Y ⩽ x) ⩽ P(X ⩽ x), x ⩾ 0,

hence
P(Y ⩽ x) ⩾ p =⇒ P(X ⩽ x) ⩾ p, x ⩾ 0,
which shows that
VXp ⩽ VYp
by (6.3). □
b) Positive homogeneity and translation invariance. Value at Risk satisfies
the positive homogeneity and translation invariance properties.
Proof. For all a ∈ R and b > 0 we have

Vap+bX = inf{x ∈ R : P(a + bX ⩽ x) ⩾ p}


150 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

= inf{x ∈ R : P(X ⩽ (x − a)/b) ⩾ p}


= inf{a + by ∈ R : P(X ⩽ y ) ⩾ p}
= a + b inf{y ∈ R : P(X ⩽ y ) ⩾ p}
= a + bVXp .


c) Subadditivity and coherence. Although Value at Risk satisfies the mono-
tonicity, positive homogeneity and translation invariance properties, it is
not subadditive in general. Namely, the Value at Risk VXp +Y of X + Y
may be larger than the sum VXp + VYp . Therefore, Value at Risk is not a
coherent risk measure.
Proof. We show that Value at Risk is not subadditive by considering two
independent Bernoulli random variables X, Y ∈ {0, 1} with the distribu-
tion

 P(X = 1) = P(Y = 1) = 2%,


P(X = 0) = P(Y = 0) = 98%,


hence VX0.975 = VY0.975 = 0.

FX (x); FY (x)

1.00

0.99

0.98
p=0.975
0.97

0.96

0 x
0 1 2 3

Fig. 6.10: Cumulative distribution function of X and Y .

On the other hand, we have

P(X + Y = 2) = (0.02)2 = 0.04%,








P(X + Y = 1) = 2 × 0.02 × 0.98 = 3.92%,



P(X + Y = 0) = (0.98)2 = 96.04%,

hence
+Y = 1 > VX
VX0.975 + VY0.975 = 0.
0.975

" 151

This version: June 9, 2023


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

FX +Y (x)

1.00

0.99

0.98
p=0.975
0.97

0.96

0 x
0 1 2 3

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

In the next proposition, we use the standard Gaussian Cumulative Distribu-


tion Function (CDF)
wx 2 /2 dy
Φ (x) : = e−y √ , x ∈ R,
−∞ 2πT
of a standard normal random variable Z ≃ N (0, 1).
Proposition 6.13. Gaussian Value at Risk. Given X ≃ N (µX , σX
2 ), we

have
VXp = µX + σX qZp (6.9)
where the normal quantile qZp = VZp at the level p satisfies

Φ(qZp ) = P(Z ⩽ qZp ) = p for Z ≃ N (0, 1),

i.e.
qZp = Φ−1 (p) and VXp = µX + σX Φ−1 (p).
Proof. We represent the random variable X ≃ N (µX , σX2 ) as

X = µX + σX Z,

where Z ≃ N (0, 1) is a standard normal random variable, and use the relation

p = P(X ⩽ VXp )
= P(µX + σX Z ⩽ VXp )
= P(Z ⩽ (VXp − µX )/σX )
= P(Z ⩽ qZp ),

which holds provided that VXp = µX + σX qZp . □


The next remark shows that, although Value at Risk is not sub-additive in
general, it is sub-additive (and therefore coherent) on (not necessarily inde-
pendent) Gaussian random variables.
152 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

Remark 6.14. If X and Y are two Gaussian random variables, we have

VXp +Y ⩽ VXp + VYp .


Proof. By (6.9), for any two random variables X and Y , we have

σX2 +Y = Var[X + Y ]
= E (X + Y )2 − (E[X + Y ])2
 

= E X 2 + E Y 2 + 2E[XY ] − E[X ]2 − E[Y ]2 − 2E[X ]E[Y ]


   

= Var[X ] + Var[Y ] + 2(E[XY ] − E[X ]E[Y ])


= Var[X ] + Var[Y ] + 2E[(X − E[X ])(Y − E[Y ])] (6.10)
q  q  2 
⩽ Var[X ] + Var[Y ] + 2 E (X − E[X ]) 2 E Y − E[Y ] (6.11)
q q 2
= Var[X ] + Var[Y ] ,

where, from (6.10) to (6.11) we applied the Cauchy-Schwarz inequality, hence


σX +Y ⩽ σX + σY . Assuming that X and Y are Gaussian, by (6.9) we find

VXp +Y = µX +Y + σX +Y qZp
= µX + µY + σX +Y qZp
⩽ µX + µY + (σX + σY )qZp
= VXp + VYp .

6.4 Numerical estimates


We are using the PerformanceAnalytics package, see also § 6.1.1 page 60
of Mina and Xiao (2001).

install.packages("PerformanceAnalytics")
library(PerformanceAnalytics)
getSymbols("0700.HK",from="2010-01-03",to="2018-02-01",src="yahoo")
stock=Ad(`0700.HK`);chartSeries(stock,up.col="blue",theme="white")
stock.rtn=(stock-lag(stock))/lag(stock)[-1];dev.new(width=16,height=7);
chart.CumReturns(stock.rtn,main="Cumulative Returns")
var=VaR(stock.rtn, p=.95, method="historical");var
length(!is.na(stock.rtn[stock.rtn<var[1]]))/length(!is.na(stock.rtn))
times=index(stock);chartSeries(stock.rtn,up.col="blue",theme="white")
abline(h=var,col="red",lwd=3)

" 153

This version: June 9, 2023


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

stock.rtn [2010−01−05/2018−01−31]
Last 0.00388268727923665
0.10

0.05

0.00

−0.05

−0.10

Jan 05 Jul 02 Jan 04 Jul 04 Jan 04 Jul 03 Jan 03 Jul 02 Jan 02 Jul 02 Jan 02 Jul 02 Jan 04 Jul 04 Jan 03 Jul 03 Dec 29
2010 2010 2011 2011 2012 2012 2013 2013 2014 2014 2015 2015 2016 2016 2017 2017 2017

Fig. 6.12: Market returns vs Value at Risk.

The historical 95%-Value at Risk over N samples (xi )i=1,2,...,N can be es-
timated by inverting the empirical cumulative distribution function FN (x),
x ∈ R. It is found to be equal to VX95% = −0.03165963.

VaR(stock.rtn, p=.95, method="gaussian")


VaR(stock.rtn, p=.95, method="gaussian",invert="FALSE")

The Gaussian 95%-Value at Risk is estimated from (6.9) by

VX95% = µ + σqZp ,

where µ = E[X ] and σ 2 = Var[X ], and is found equal to VX95% =


−0.03115425. It can be recovered up to approximation as

m=mean(stock.rtn,na.rm=TRUE)
s=sd(stock.rtn,na.rm=TRUE)
q=qnorm(.95, mean=0, sd=1)
m-s*q
m+s*q

according to Proposition 6.13, which yields −0.0311592. Note that here we


are concerned about large negative returns, which explains the negative sign
in m − s ∗ q.
The next lemma is useful for random simulation purposes, and it will also be
used in the proof of Propositions 7.4 and 7.10 below.
Lemma 6.15. Any random variable X can be represented as X = VXU where
U is uniformly distributed on [0, 1].

154 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

Proof. It suffices to note that by (6.8) we have

P(VXU ⩽ x) = P(U ⩽ P(X ⩽ x)) = P(X ⩽ x) = FX (x), x ⩾ 0.

Exercises

Exercise 6.1 Consider a random variable X having the Pareto distribution


with probability density function
γθγ
fX (x) = , x ⩾ 0.
(θ + x )γ +1

a) Compute the cumulative distribution function


wx
FX ( x ) : = fX (y )dy, x ⩾ 0.
0

b) Compute the value at risk VXp at the level p for any θ and γ, and then for
p = 99%, θ = 40 and γ = 2.

Exercise 6.2 Consider a random variable X with the following cumulative


distribution function:
FX (x)

1.00

0.99

0.98

0.97

0.96

0 x
−20 −10 0 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160

Fig. 6.13: Cumulative distribution function of X.

a) Give the value of P(X = 100).


b) Give the value of VXq for all q in the interval [0.97, 0.99].
c) Compute the value of VXq for all q in the interval [0.99, 1].
Hint: We have
x − 100
FX (x) = P(X ⩽ x) = 0.99 + 0.01 × , x ∈ [100, 150].
50

" 155

This version: June 9, 2023


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

Exercise 6.3 Discrete distribution. Consider X ∈ {10, 100, 110} with the
distribution

P(X = 10) = 90%, P(X = 100) = 9.5%, P(X = 110) = 0.5%.

Compute the value at risk VX99% .

Exercise 6.4 Exponential distribution. Assume that X has an exponential


distribution with parameter λ > 0 and mean 1/λ, i.e.

P(X ⩽ x) = 1 − e−λx , x ⩾ 0.

a) Compute
VXp := inf x ∈ R : P(X ⩽ x) ⩾ p


and VX95% .
b) Assuming that the liabilities of a company are estimated by E[X ], com-
pute the amount of required capital CX from (6.1).

Exercise 6.5 Given X a random variable having the geometric distribution


with
P(X = k ) = (1 − p)k p, k ⩾ 0,
compute the conditional expectation E[X | X ⩾ a] for a > 0.

Exercise 6.6 Estimating risk probabilities from moments.


a) Using the Chebyshev inequality, show that for every r > 0
1/r
E[|X|r ] ∥X∥Lr (Ω)

VXp ⩽ = ,
1−p (1 − p)1/r

where ∥X∥Lr (Ω) := (E[|X|r ])1/r .


b) Give an upper bound for VX95% when p = 95% and r = 1.

Exercise 6.7 We consider a discrete random variable X having the following


distribution.

156 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

a) Find the following quantities for the above data set, and mark their values
on the graph.
i) Historical “Academic” Value at Risk at p = 0.95. VaR95
Ac-H =
ii) Historical “Academic” Value at Risk at p = 0.80. VaR80
Ac-H =
iii) Historical “Practitioner” Value at Risk at p = 0.95. VaR95
Pr-H =
iv) Historical “Practitioner” Value at Risk at p = 0.80. VaR80
Pr-H =
b) Knowing that mean=1.15, sd=3.048, qnorm(0.95)=1.645 and qnorm(0.80)=0.842,
compute (from Proposition 6.13):
i) Gaussian “Academic” Value at Risk at p = 0.95. VaR95
Ac-G =
ii) Gaussian “Academic” Value at Risk at p = 0.80. VaR80
Ac-G =
iii) Gaussian “Practitioner” Value at Risk at p = 0.95. VaR95
Pr-G =
iv) Gaussian “Practitioner” Value at Risk at p = 0.80. VaR80
Pr-G =

" 157

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Chapter 7
Expected Shortfall

Expected Shortfall (ES) is a risk measure computed by averaging 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.

7.1 Tail Value at Risk (TVaR) . . . . . . . . . . . . . . . . . . . . . . 159


7.2 Conditional Tail Expectation (CTE) . . . . . . . . . . . . . 160
7.3 Expected Shortfall (ES) . . . . . . . . . . . . . . . . . . . . . . . . 164
7.4 Numerical Estimates . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173

7.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 VXp . The next figure
illustrates the limitations of Value at Risk, namely its inability to capture
the properties of a probability distribution beyond VXp .†

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

" 159

This version: June 9, 2023


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

Fig. 7.1: Two distributions having the same Value at Risk VX95% = 2.145.

The Tail Value at Risk (or Conditional Value at Risk) aims at providing a
solution to the tail distribution problem observed with Value at Risk at the
level p ∈ (0, 1) by averaging over confidence levels ranging from p to 1.
Definition 7.1. The Tail Value at Risk (TVaR) of a random variable X at
the level p ∈ (0, 1) is defined by the average
1 w1 q
TVpX := V dq. (7.1)
1−p p X

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

1 w1 q 1 w1 p
TVpX = VX dq ⩾ V dq = VXp .
1−p p 1−p p X

7.2 Conditional Tail Expectation (CTE)

Recall that by Lemma 12.15, given an event A such that P(A) > 0, the
conditional expectation of X : Ω −→ N given the event A satisfies
1
E[X | A] = E [ X 1A ] ,
P(A)

see Section 6.1 for an example.


Definition 7.2. Consider a random variable X such that P X > VXp > 0.


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


1
CTEpX := E X | X > VXp =  E X 1{X>V p } .
   
P X > VXp X

The Conditional Tail Expectation CTEpX at the level p ∈ (0, 1) can be written
as the distorted risk measure

160 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

CTEpX := E[XfX (X )]

where fX is the distortion function defined by


1
fX ( x ) : = 1 p , x ∈ R.
P X > VXp {x>VX }

The use of the strict inequality “>” in the definition of the Conditional Tail
Expectation allows us to avoid any dependence on P(X = VXp ), and to
consider risky values strictly beyond VXp . The Conditional Tail Expectation
is also called Conditional Value at Risk (CVaR).
Examples of Conditional Tail Expectations can be computed as in the fol-
lowing code.

library(quantmod)
getSymbols("^HSI",from="2013-06-01",to="2014-10-01",src="yahoo")
returns <- as.vector(diff(log(Ad(`HSI`))))
library(PerformanceAnalytics)
var=VaR(returns, p=.95, method="historical")
cte=mean(returns[returns<as.numeric(var)],na.rm=TRUE)

The next proposition shows by which amount the Conditional Tail Expecta-
tion exceeds the Value at Risk.
Proposition 7.3. For any p ∈ (0, 1] we have CTEpX > E[X ] and CTEpX >
VXp with, more precisely,
+
CTEpX = E X | X > VXp = VXp + E X − VXp | X > VXp .
   

Proof. We have
1
E X | X > VXp =  E X 1{X>V p }
   
P X > VXp X

1
p  E X − VX 1{X>V p } + VX E 1{X>V p }
 p  p  
=
P X > VX X X

1 p + 
 E X − VX + VXp P X > VXp
 
=
P X > VXp
1 + 
= VXp +  E X − VXp

P X > VXp
+
= VXp + E X − VXp X > VXp .
 

See Exercise 7.2-(d) for a proof of CTEpX > E[X ]. □


Next, we check that when P X = VXp = 0, the Conditional Tail Expectation


coincides with the Tail Value at Risk. Note that in this case we have

P X > VXp = 1 − p > 0




" 161

This version: June 9, 2023


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

by (6.6) in Proposition 6.9.


Proposition 7.4. Assume that P X = VXp = 0. Then we have


CTEpX = TVpX ,

i.e.
1 w1 q
CTEpX = E X | X > VXp = E X | X ⩾ VXp = V dq = TVpX .
   
1−p p X
(7.2)
Proof. By Lemma 6.15 we construct X as X = VXU where U is uniformly
distributed on [0, 1], with

U ⩾ p =⇒ VXU ⩾ VXp =⇒ X ⩾ VXp ,

and
X > VXp =⇒ VXU > VXp =⇒ U > p.
Since P X = VXp = 0 we find that, with probability 1,


U ⩾ p ⇐⇒ U > p ⇐⇒ VXU ⩾ VXp ⇐⇒ X ⩾ VXp ⇐⇒ X > VXp ,

hence

CTEpX = E X | X > VXp


 

= E VX | VXU > VXp


 U 

= E VX | U ⩾ p
 U 

1
E VXU 1{U ⩾p}
 
=
P(U ⩾ p)
1 w1 q
= V dq.
1−p p X

Figure 7.2 shows the locations of Value at Risk and Conditional Tail Ex-
pectation on a given data set. Note that here, the computation is done on
sign-changed data according to Proposition 6.12, i.e. the results are computed
according to the “practitioner” point of view.

162 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

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

The Conditional Tail Expectation of a Gaussian N (µ, σ 2 ) random variable


is computed in the next proposition, see also Proposition 6.13.
Proposition 7.5. Gaussian CTE. Given X ≃ N (µX , σX
2 ) we have

σX σX p 2
CTEpX = µX + ϕ(VZp ) = µX + √ e−(VZ ) /2 , (7.3)
1−p (1 − p) 2π

where VZp = Φ−1 (p) is the Value at Risk of Z ≃ N (0, 1) at the level p ∈ (0, 1)
and
1 2
ϕ(z ) = √ e−z /2 , z ∈ R,

is the standard normal probability density function.
Proof. Using the relation P X ⩾ VXp = P X > VXp = 1 − p, cf. Proposi-
 

tion 6.11, we have

CTEpX = TVpX
= E X | X > VXp
 

1
 E X 1{X>V p }
 
=
P X > VXp X

1 w ∞ −(x−µX )2 /(2σ2 ) dx
= xe X q
1 − p VXp 2πσ 2 X
µ w ∞ −(x−µX )2 /(2σ2 ) dx 1 w∞ −(x−µX )2 /(2σX
2 ) dx
= X e X q + p (x − µX )e
1 − p VXp 1
q
2πσ 2 − p VX
2πσ 2
X X
2
σX i∞
µ h 2 2
= X P(X ⩾ VXp ) + −e−(x−µX ) /(2σX ) p
1−p
q
VX
(1 − p) 2πσX
2

2
σX p 2
= µX + q e−((VX −µX )/σX ) /2
(1 − p) 2πσX
2

" 163

This version: June 9, 2023


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

σX p 2
= µX + √ e−(VZ ) /2
(1 − p) 2π
σ
= µX + X ϕ(VZp ),
1−p

due to the rescaling relation VXp = µX + σX qZ


p
, cf. (6.9). □

7.3 Expected Shortfall (ES)

There are several variants for the definition of the Expected Shortfall ESpX .
Next is a frequently used definition.
Definition 7.6. The Expected Shortfall ESpX of a random variable X at the
level p ∈ (0, 1) is defined by
1
ESpX := VXp + E X − VXp 1{X ⩾V p } . (7.4)
  
1−p X

From the next proposition, we deduce that


 1
E X 1{X ⩾V p } = E X | X > VXp = TVpX if P X = VXp = 0,
    
 1−p


 X

ESpX =
 1 Vp
E X 1{X ⩾V p } + X 1 − p − P X ⩾ VXp if P X = VXp > 0.

    

1−p X 1−p

Proposition 7.7. The Expected Shortfall of X at the level p ∈ (0, 1) can be


written as
1 Vp
ESpX = E X 1{X ⩾V p } + X 1 − p − P X ⩾ VXp .
  
1−p X 1−p
Proof. We have

P X ⩾ VXp 

ESpX = VXp + E X − VXp X ⩾ VXp

1−p
1
= VXp + E X 1{X ⩾V p } − VXp E 1{X ⩾V p }
   
1−p X X

1
= VXp + E X 1{X ⩾V p } − VXp P X ⩾ VXp
  
1−p X

1 Vp
E X 1{X ⩾V p } + X 1 − p − P X ⩾ VXp .
  
=
1−p X 1−p

Proposition 7.8. When P X = VX = 0 the Expected Shortfall ESpX coin-


p

cides with the Conditional Tail Expectation CTEpX and with the Tail Value
164 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

at Risk TVpX , i.e., we have

ESpX = E X | X > VXp = E X | X ⩾ VXp = TVpX .


   

Proof. By Proposition 6.11, when P X = VXp = 0 we have




p = P(X ⩽ VXp ) and 1 − p = P(X > VXp ) = P(X ⩾ VXp ),


hence
1
ESpX = E X 1{X ⩾V p }
 
1−p X

1
E X 1{X>V p }
 
=
1−p X

1
 E X 1{X>V p }
 
=
P X > VXp X

= E X | X > VXp
 

= TVpX ,

by Proposition 7.4. □
When P X = VXp = 0, we also have


1 Vp
ESpX = E X 1{X ⩾V p } + VXp − X P X ⩾ VXp
  
1−p X 1−p
1 Vp
E X 1{X>V p } + X 1 − p − P X > VXp .
  
=
1−p X 1−p
In particular, by Propositions 7.5 and 7.8, the Gaussian Expected Shortfall
of X ≃ N (µ, σ 2 ) at the level p ∈ (0, 1) is also given by
σ σ
√ e−(Φ (p)) /2 .
−1 2
ESpX = µ + ϕ(Φ−1 (p)) = µ +
1−p (1 − p) 2π

Proposition 7.9. The Expected Shortfall ESpX at the level p ∈ (0, 1) can be
written as the distorted risk measure
w1
ESpX = E[XfX (X )] = VXq fX (VXq )dq, (7.5)
0

where fX is the distortion function defined by

1 1 − p − P X > VXp 1

fX ( x ) : = 1{x>VXp } + 1{P(X =VXp )>0} 1 p ⩽ ,
1−p (1 − p)P X = VXp {x=VX } 1 − p


x ∈ R.

" 165

This version: June 9, 2023


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

Proof. By Proposition 7.7, we have

1 Vp
ESpX = E X 1{X ⩾V p } + X 1 − p − P X ⩾ VXp
  
1−p X 1−p
1 Vp
E X 1{X ⩾V p } + 1{P(X =V p )>0} X 1 − p − P X ⩾ VXp
  
=
1−p X X 1−p
1 − p − P X ⩾ VXp
" ! #
1

= E 1{X ⩾VX } + 1{P(X =VX )>0}
p p 1{X =VX } X
p
1−p P X = VXp


1 h
= E 1{X ⩾V p } − 1{P(X =V p )>0} 1{X =V p }
1−p X X X
p
! #
1 − p − P X > VX
+1{P(X =V p )>0} 1 {X =VX } X
p
P X = VXp

X

1 − p − P X > VXp
" ! #
1

= E 1{X>VXp } + 1{P(X =VXp )>0} 1{X =VXp } X .
1−p P X = VXp


In order to conclude that fX (x) is upper bounded by 1/(1 − p), we apply


(6.6). □
Note that the distortion function fX is a non-decreasing function that satisfies

1 − p − P X > VXp
" #
1

E[fX (X )] = E 1{X>V } + 1{P(X =V )>0}
p p 1{X =VX }p
1−p P X = VXp

X X

1  
E 1{X>V p } + 1 − p − P X > VXp
  
=
1−p X

1
P X > VXp + 1 − p − P X > VXp
 
=
1−p
= 1, x ∈ R. (7.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 Tail
Value at Risk TVpX .
Proposition 7.10. The Expected Shortfall ESpX coincides with the Tail Value
at Risk TVpX for any p ∈ (0, 1), i.e. we have

1 w1 q
ESpX = TVpX = V dq.
1−p p X
Proof. Constructing X as X = VXU where U is uniformly distributed on [0, 1]
as in Lemma 6.15, by Proposition 6.10 we have

U ⩾ p =⇒ VXU ⩾ VXp =⇒ X ⩾ VXp

and
166 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

U < p and X ⩾ VXp =⇒ VXU ⩽ VXp and X ⩾ VXp


 

=⇒ X ⩽ VXp and X ⩾ VXp




=⇒ X = VXp .

Hence by (7.4) and the relations

1 − p = E 1{U ⩾p} and P X ⩾ VXp = E 1{X ⩾V p } ,


    
X

we have

VXp 1 − p − P X ⩾ VXp = −VXp E 1{X ⩾V p } − 1{U ⩾p}


  
X

= −VXp E 1{X ⩾V p }\{U ⩾p}


 
X

= −VXp E 1{X ⩾V p }∩{U <p}


 
X

= −E X 1{X ⩾V p }∩{U <p} ,


 
X

hence

1 Vp
ESpX = E X 1{X ⩾V p } + X 1 − p − P X ⩾ VXp
  
1−p X 1−p
1 1
E X 1{X ⩾V p } − E X 1{X ⩾V p }∩{U <p}
   
=
1−p X 1−p X

1 1
E VXU 1{V U ⩾V p } − E VXU 1{V U ⩾V p } 1{U <p}
   
=
1−p X X 1−p X X

1
E VXU 1{V U ⩾V p } 1{U ⩾p}
 
=
1−p X X

1
E VXU 1{U ⩾p}
 
=
1−p
1 w1 q
= V dq,
1−p p X

which is the Tail Value at Risk TVpX . □

Theorem 7.11. Expected Shortfall ESpX and Tail Value at Risk TVpX are
coherent risk measures.

Proof. As ESpX coincides with TVpX for all p ∈ (0, 1) from Proposition 7.10,
we can use either Relation (7.4) in Definition 7.6 or Relation (7.1) in Defini-
tion 7.1.
(i) Monotonicity. If X ⩽ Y , since Value at Risk is monotone we have

" 167

This version: June 9, 2023


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

ESpX = TVpX
1 w1 q
= V dq
1−p p X
1 w1 q
⩽ V dq
1−p p Y
p
= TVY
⩽ ESpY

for all p ∈ (0, 1).


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

ESpµ+λX = TVpµ+λX
1 w1 q
= V dq
1 − p p µ+λX
1 w1
µ + λVXq dq

=
1−p p
1 w1 q
= µ+λ V dq
1−p p X
p
= µ + λTVY
⩽ µ + λESpY

for all p ∈ (0, 1).


(iii) Sub-additivity. By Proposition 7.9, we have

(1 − p) ESpX +Y − ESpX − ESpY




= 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 ))]
⩽ VXp E[fX +Y (X + Y ) − fX (X )] + VYp E[fX +Y (X + Y ) − fY (Y )]
= (1 − 1)VXp − (1 − 1)VYp
= 0,

where we have used (7.6) and the following facts.


• For x < VXp we have

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


} − 1{x>VXp
}
X +Y
p
1 − p − P(X + Y > VX +Y )
+1{P(X +Y =V p )>0} 1{x+y =VXp +Y }
X +Y P(X + Y = VXp +Y )

168 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

1 − p − P X > VXp

−1{P(X =V p )>0} 1{x=VXp }
P X = VXp

X

1 − p − P(X + Y > VXp +Y )


= 1{x+y>V p } + 1{P(X +Y =V p 1{x+y =VXp +Y }
X +Y X +Y
)>0}
P(X + Y = VXp +Y )
⩾ 0, x < VXp ,

where we applied (6.6).


• For x > VXp we have

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


X +Y X

1 − p − P(X + Y > VXp +Y )


+1{P(X +Y p 1{x+y =VXp +Y }
=VX
)>0}
+Y P(X + Y = VXp +Y )
1 − p − P X > VXp

−1{P(X =V p )>0} p 1{x=VXp }
P X = VX

X

= 1{x+y>V p } − 1{x>V p }
X +Y X

1 − p − P(X + Y > VXp +Y )


+1{P(X +Y =V p )>0} 1{x+y =VXp +Y }
X +Y P(X + Y = VXp +Y )
⩽ 1{x+y>V p } − 1{x>V p } + 1{x+y =V p }
X +Y X X +Y
= 1{x+y⩾V p } − 1{x>VX
p
}
X +Y
p
⩽ 0, x > VX ,

where we applied (6.6).


Note that in general, the Conditional Tail Expectation is not a coherent risk
measure when P X = VXp > 0.


7.4 Numerical Estimates


We are using the PerformanceAnalytics package, see also § 6.1.1 page 60
of Mina and Xiao (2001).

Expected Shortfall (ES)

library(PerformanceAnalytics)
ES(returns, p=.95, method="historical")
ES(returns, p=.95, method="historical",invert="FALSE")

" 169

This version: June 9, 2023


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

The 95% Expected Shortfall is ES95%X = −0.02087832. The historical Ex-


pected Shortfall can be exactly recovered by the empirical Condtional Tail
Expectation (CTE) as

mean(returns[returns<(VaR(returns, p=.95, method="historical")[1])],na.rm=TRUE)

The Gaussian Expected Shortfall is given as −0.0191359 by

ES(returns, p=.95, method="gaussian")


ES(returns, p=.95, method="gaussian",invert="FALSE")

and it can be recovered from (7.3) (after sign inversion) as


σ σ p 2
ESpX = µ − ϕ(VZp ) = µ − √ e−(VZ ) /2
1−p (1 − p) 2π

with µ = E[X ] and σ 2 = Var[X ], i.e.

q=qnorm(.95, mean=0, sd=1)


mu=mean(returns,na.rm=TRUE)
sigma=sd(returns,na.rm=TRUE)
mu-sigma*dnorm(q)/0.05
mu+sigma*dnorm(q)/0.05

with output −0.01916536.

The attached code computes the Expected Shortfall and compares its
output to the that of the PerformanceAnalytics package, as illustrated in the
next Figure 7.3.

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

170 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

Fig. 7.3: Value at Risk and Expected Shortfall.

Value at Risk vs Expected Shortfall

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

Risk Confidence Sensitivity of 1800.HK.Adjusted


−0.04
−0.06
Value at Risk

−0.08
−0.10

Historical VaR
Historical ES
−0.12

0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99

Confidence Level

Fig. 7.4: Value at Risk vs Expected Shortfall.

Historical vs Gaussian risk measures

dev.new(width=16,height=8)
chart.VaRSensitivity(ts(returns),methods=c("HistoricalVaR","GaussianVaR"),
colorset=bluefocus, lwd=4)

The next Figure 7.5 uses the above code to compare the historical and
Gaussian values at risk.

" 171

This version: June 9, 2023


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

Risk Confidence Sensitivity of DJI.Adjusted

−0.010
−0.015
Value at Risk

−0.020
−0.025
−0.030

Historical VaR
Gaussian VaR

0.89 0.9 0.905 0.915 0.925 0.935 0.945 0.955 0.965 0.975 0.985

Confidence Level

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

dev.new(width=16,height=8)
chart.VaRSensitivity(ts(returns),methods=c("HistoricalES","GaussianES"),
colorset=bluefocus, lwd=4)

In the next Figure 7.6 we compare the Gaussian and historical estimates of
Expected Shortfall.

Risk Confidence Sensitivity of DJI.Adjusted


−0.045 −0.040 −0.035 −0.030 −0.025 −0.020
Value at Risk

Historical ES
Gaussian ES

0.89 0.9 0.905 0.915 0.925 0.935 0.945 0.955 0.965 0.975 0.985

Confidence Level

Fig. 7.6: Quantile function.

In Table 7.1 we summarize some properties of risk measures.

172 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

Risk Measure Additivity Homogeneity Subadditivity Coherence

VX ✓ ✓ ✗ ✗

CTEX ✓ ✓ ✗ ✗

TVX ✓ ✓ ✓ ✓

ESX ✓ ✓ ✓ ✓

Table 7.1: Summary of Risk Measures.

Note that Value at Risk VXp is coherent on Gaussian random variables ac-
cording to Remark 6.14. Similarly, the Conditional Tail Expectation CTEpX
is coherent on random variables having a continuous CDF by Proposition 7.4
and Theorem 7.11.

Exercises

Exercise 7.1 Let X denote an exponentially distributed random variable with


parameter λ > 0, i.e. the distribution of X has the cumulative distribution
function (CDF)

FX (x) = P(X ⩽ x) = 1 − e−λx , x ⩾ 0,

and the probability density function (PDF)



fX (x) = FX (x) = λe−λx , x ⩾ 0.

" 173

This version: June 9, 2023


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

1.0
p=0.95
1
0.9
0.9

Probability density
0.8
0.8

0.7
0.7

0.6
0.6

0.5
0.5

0.4
0.4

0.95
0.3
0.3

qX
0.2
0.2

0.1
0.1

0
0.0

0 1 2 4 5 6 0 1 2 3 4 5 6
0.95
qX

(a) Exponential quantile and CDF. (b) Exponential PDF.

a) Compute the conditional tail expectation


1 w∞
E[X | X > VaRpX ] = xfX (x)dx.
P(X > VaRpX ) VaRpX

b) Compute the tail value at risk


1 w1 q
TVpX = V dq.
1−p p X

Exercise 7.2 Consider X an (integrable) random variable and z ∈ R such


that 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 ⩽ z ) > 0.
d) Show that CTEpX > E[X ].

Exercise 7.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.
174 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

b) p = 0.8.

Exercise 7.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) VaR
 X,
90

b) E X 1{X>V 90 } ,

X
c) P X > VX ,
90


d) CTE90 = E X | X > VX90 = E X 1{X>V 90 } /P X > VX90 ,


    
 X X
e) E X 1{X ⩾V 90 } ,

X
f) P X ⩾ VX90 ,

1
g) ES90 E X 1{X ⩾V 90 } + VX90 1 − p − P X ⩾ VX90 ,
  
X =
1−p X
1 w1 q
h) TV90
X = V dq,
1−p p X
and mark the values of VaR90%
X , CTEX , ESX , TVX
90% 90% 90%
on the above
graph.

Exercise 7.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 VX98% ,
b) the Tail Value at Risk TV98%
X ,
c) the Conditional Tail Expectation E X | X > VX98% , and
 

d) the Expected Shortfall EX 98%


.

" 175

This version: June 9, 2023


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

Exercise 7.6 Consider two independent random variables X and Y with


same 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:

FX (x)
1.02
1.00
0.98
0.96
0.94
0.92
0.90
0.88
0 x
−20 −10 0 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 190 200 210

Fig. 7.8: Cumulative distribution function of X.

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

FX+Y (x)
1.00
0.98
0.96
0.94
0.92
0.90
0.88
0.86
0.84
0.82
0.80
0 x
−20 −10 0 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 190 200 210

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

c) Give the values at risk VX99%


+ Y , VX + Y , VX + Y .
95% 90%

d) Compute the Tail Value at Risk


1 w1 q
TV90% := V dq
X 1−p p X

at the level p = 90%.


e) Compute the Tail Value at Risk
1 w1 q
TVpX +Y := V dq
1 − p p X +Y

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

Exercise 7.7 (Exercise 6.2 continued).


a) Compute the Tail Value at Risk
1 w1 q
TVpX := V dq
1−p p X

176 "

This version: June 9, 2023


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
1 h i
CTE98% = E X | X > VX98% = p  E X 1{X>VX } .
 
p
X
P X > VX

Exercise 7.8 We assume that the payoff X of a portfolio follows the standard
logistic distribution with cumulative distribution function (CDF)
1
FX ( x ) = P ( X ⩽ x ) = , x ∈ R,
1 + e−x
and the probability density function (PDF)

′ e−x
fX (x) = FX (x) = , x ∈ R.
(1 + e−x )2
1.0

p=0.95 0.3
0.9
0.8

Probability density
0.7

0.2
0.6
0.5

qX
p
0.4

0.1
0.3
0.2
0.1

0
−6 −5 −4 −3 −2 −1 0 1 2 3 4 5 6
0.0

−6 −5 −4 −3 −2 −1 0 1 2 4 5 6
q0.95
X

(b) Logistic PDF.


(a) Logistic quantile and CDF.

p
a) Compute the quantile qX = VaRpX of X at any level p ∈ [0, 1], defined by
the relation
p
FX ( q X ) = P(X ⩽ VaRpX ) = p.
b) Compute the conditional tail expectation
1 w∞
E[X | X > VaRpX ] = p xfX (x)dx.
P(X > VaRX ) VaRpX

Hint. We have
w∞ xe−x aea
dx = log(1 + ea ) − , a ∈ R.
a (1 + e−x )2 1 + ea

c) Compute the tail value at risk


1 w1 q
TVpX = V dq.
1−p p X

" 177

This version: June 9, 2023


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

w1
Hint. We have log qdq = p − 1 − p log p, p ∈ (0, 1).
p

178 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Chapter 8
Credit Scoring

Credit scoring is a statistical assessment of a borrower’s creditworthiness


performed by financial institutions in order to make decisions regarding loan
applications. In this chapter, we review the uses of discriminant analysis and
binomial logistic regression, with application to credit scoring.

8.1 Discriminant Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . 179


8.2 Decision Rule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
8.3 Logistic Regression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
8.4 ROC Curve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194

8.1 Discriminant Analysis

A set Ω of credit applicants is decomposed into a partition

Ω = B ∪ G,

B G

with B ∩ G = ∅, where G denotes the set of “good” (or solvent) applicants


and B denotes the set of “bad” (or insolvent) applicants, in such a way that
" 179

This version: June 9, 2023


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

P(B ) + P(G) = 1,

where P(B ) represents the probability that an applicant chosen at random


will default.
In addition, each applicant ω ∈ Ω is assigned a real-valued rating (or score)
X (ω ) via a random variable∗

X : Ω −→ R
ω 7−→ X (ω ).

Definition 8.1. The functions

R −→ [0, 1]
x 7−→ P(B | X = x)

and

R −→ [0, 1]
x 7−→ P(G | X = x)

are respectively called the probability default curve and the probability ac-
ceptance curve.
Denoting by fX (x), resp. fX (x | B ), the probability density functions of X,
resp. X given B, by the Bayes formula we have

P(B )
P ( B | X = x ) = fX ( x | B )
fX ( x )
P ( B ) fX ( x | B )
= , (8.1)
P(G)fX (x | G) + P(B )fX (x | B )

and
P ( G ) fX ( x | G )
P(G | X = x) = .
P ( G ) fX ( x | G ) + P ( B ) fX ( x | B )
Definition 8.2. The True Positive Rate (TPR) is the tail distribution func-
tion w∞
F G (x) : = P(X > x | G) = fX (y | G)dy, x ∈ R.
x
On the other hand, the False Positive Rate (FPR) is the tail distribution
function
w∞
F B (x) : = P(X > x | B ) = fX (y | B )dy, x ∈ R.
x

See (MOE and UCLES 2016, page 14 lines 4-5) and (MOE and UCLES 2020, page 19
lines 4-5).

180 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

Example. In case X is Gaussian distributed given {G, B} with the condi-


tional densities
1 2 2
fX (x | G) = √ e−(x−µG ) /(2σ ) (8.2)
2πσ
and
1 2 2
fX ( x | B ) = √ e−(x−µB ) /(2σ ) , (8.3)
2πσ
with µB < µG , by (8.1) we find the probability default curve

P(B )fX (x | B )
P(B | X = x) =
P(G)fX (x | G) + P(B )fX (x | B )
2 2
P(B )e−(x−µB ) /(2σ )
=
P(G)e−(x−µG ) /(2σ ) + P(B )e−(x−µB ) /(2σ )
2 2 2 2

1
= , x ∈ R, (8.4)
1 + eα+βx
with
µG − µB
β := >0
σ2
and
µG + µB P(G)
α := −β + log .
2 P(B )

0.8

0.6

0.4

0.2

0
-10 -5 0 5 10
x

Fig. 8.1: Probability default curve x 7→ P(B | X = x) = 1/(1 + ea+x ).

On the other hand, the probability acceptance function is given by

P ( G ) fX ( x | G )
P(G | X = x) =
P(G)fX (x | G) + (1 − P(G))fX (x | B )
2 2
P(G)e−(x−µG ) /(2σ )
=
P(G)e−(x−µG ) /(2σ ) + P(B )e−(x−µB ) /(2σ )
2 2 2 2

" 181

This version: June 9, 2023


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

1
= , x ∈ R. (8.5)
1 + e−α−βx

0.8

0.6

0.4

0.2

0
-10 -5 0 5 10
x

Fig. 8.2: Probability acceptance curve x 7→ P(G | X = x) = 1/(1 + e−a−x ).

8.2 Decision Rule

We decide to accept the applicants whose rating X (ω ) belongs to a decision


(or acceptance) set A ⊂ R, and to reject those whose rating X (ω ) belongs
to the rejection set A c = R \ A , complement of A in R. Let
• L(x) represents the loss (or missed earnings) incurred by the rejection of
an applicant with rating x ∈ A c , and
• D (x) represents the cost incurred by the default of an applicant with rating
x∈A.
The cost associated to this decision rule becomes

D (X )1{X∈A }∩B + L(X )1{X∈A c }∩G .


| {z } | {z }
Cost of accepting a ”bad” applicant Loss from rejecting a ”good” applicant

Proposition 8.3. The optimal acceptance set A ∗ ⊂ R that minimizes the


expected cost
E D (X )1{X∈A }∩B + L(X )1{X∈A c }∩G
 

is given by
D (x) P(B )
 
A∗ = x ∈ R : λ(x) ⩾ ,
L(x) P(G)
where λ(x) is the likelihood ratio

fX (x | G) P(G | X = x) P(B )
λ(x) : = = , x ∈ R.
fX (x | B ) P(B | X = x) P(G)
182 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

Proof. The expected cost corresponding to an acceptance set A ⊂ R can be


written as

E D (X )1{X∈A }∩B + L(X )1{X∈A c }∩G


 
w w
= D (x)P(B ∩ X ∈ dx) + L(x)P(G ∩ X ∈ dx)
wA Ac w
= D (x)P(B | X = x)fX (x)dx + L(x)P(G | X = x)fX (x)dx
A Ac
w∞ 
E D (X )1{X∈A }∩B X = x fX (x)dx

=
−∞
w∞ 
E L(X )1{X∈A c }∩G X = x fX (x)dx

+
−∞
w∞ 
E D (X )1{X∈A }∩B + L(X )1{X∈A c }∩G X = x fX (x)dx,

=
−∞

where

E D (X )1{X∈A }∩B + L(X )1{X∈A c }∩G X = x


 

= 1A ( x ) D ( x ) P ( B | X = x ) + 1A c ( x ) L ( x ) P ( G | X = x )

is the conditional expected cost given that X = x. The expected cost can
be minimized pointwise by finding the set A that minimizes the conditional
expected cost function

x 7−→ D (x)P(B | X = x)1A (x) + L(x)P(G | X = x)1A c (x).

We note that

x 7−→ D (x)P(B | X = x)1A (x) + L(x)P(G | X = x)1A c (x)


⩾ min(D (x)P(B | X = x), L(x)P(G | X = x))
= D (x)P(B | X = x)1{D (x)P(B|X =x)⩽L(x)P(G|X =x)}
+ L(x)P(G | X = x)1{L(x)P(G|X =x)<D (x)P(B|X =x)} ,

and that the set A ∗ which achieves equality in the above bound is given by

A ∗ := {D (x)P(B | X = x) ⩽ L(x)P(G | X = x)}


D (x) P(G | X = x)
 
= x∈R : ⩽ .
L(x) P(B | X = x)

In addition, the set A ∗ can be rewritten in terms of the likelihood ratio

fX (x | G) P(G | X = x) P(B )
λ(x) : = = , x ∈ R,
fX ( x | B ) P(B | X = x) P(G)
as
D (x) P(B )
 
A∗ = x ∈ R : λ(x) ⩾ .
L(x) P(G)

" 183

This version: June 9, 2023


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


For simplicity, in the sequel we assume that D = D (x) and L = L(x) are
constant in x ∈ R, in which case we have

D P(B )
 
A ∗ = x ∈ R : λ(x) ⩾ .
L P(G)

Proposition 8.4. In the Gaussian example (8.2)-(8.3) the optimal accep-


tance set A ∗ is given by

µG + µB 1 D P(B )
   
A ∗ = [ x∗ , ∞ ) = + log ,∞ , (8.6)
2 β L P(G)

where
µG + µB 1 D P(B )
 
x∗ : = + log ,
2 β L P(G)
under the condition

E[X | B ] = µB < µG = E[X | G].


Proof. In the Gaussian example (8.2)-(8.3), the likelihood ratio is given by

fX (x | G)
λ(x) =
fX ( x | B )
2 2 2 2
= e−(x−µG ) /(2σ )+(x−µB ) /(2σ )
2 2 2
= e−(µG −µB −2x(µG −µB ))/(2σ )
2 2 2
= eβx−(µG −µB )/(2σ ) , x ∈ R,

hence the condition


2 2 2) D P(B )
λ(x) = eβx−(µG −µB )/(2σ ⩾
L P(G)

is equivalent to

µ2G − µ2B 1 D P(B )


 
x⩾ + log
2βσ 2 β L P(G)
µ2G − µ2B 1 D P(B )
 
⩾ + log
2(µG − µB ) β L P(G)
µG + µB 1 D P(B )
 
⩾ + log ,
2 β L P(G)

which yields (8.6), provided that


µG − µB
β := > 0.
σ2
184 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics


We note that the optimal boundary point x∗ satisfies the relation

P ( X = x∗ | G ) P ( G | X = x∗ ) P ( G ) D P(B )
λ ( x∗ ) = = = ,
P(X = x | B )
∗ P ( B | X = x∗ ) P ( B ) L P(G)
i.e.
P ( G | X = x∗ ) D
= . (8.7)
P ( B | X = x∗ ) L
Figure 8.3 illustrates the optimal decision rule by taking L = D = $1 and
using the default and acceptance curves (8.4)-(8.5).

1
D(x)P(B|X=x)
L(x)P(G|X=x)
0.8

0.6

0.4

0.2

0
-5 0 x* 5 10 15
Ac A*

Fig. 8.3: Animated graph of optimal decision rule.∗

The purple curve corresponds to the conditional expected cost function

x 7−→ D (x)P(B | X = x)1A (x) + L(x)P(G | X = x)1A c (x)

for a given set A , and its uniform minimum is obtained for A ∗ of the form
A ∗ = [x∗ , ∞) with x∗ at the intersection of the curves x 7→ D (x)P(B | X =
x) and x 7→ L(x)P(G | X = x) as in (8.7).
The acceptance rate, or probability that an applicant is accepted according
to the rule A , is given by

P(X ∈ A ) = P({X ∈ A } ∩ G) + P({X ∈ A } ∩ B )


= P(X ∈ A | G)P(G) + P(X ∈ A | B )P(B ),

where
P({X ∈ A } ∩ B ) = P(X ∈ A | B )P(B )

The animation works in Acrobat Reader on the entire pdf file.

" 185

This version: June 9, 2023


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

is the default rate, or probability that an applicant accepted according to the


rule A will default.
We can also minimize the default rate P({X ∈ A } ∩ B ) subject to a given
acceptance rate P(X ∈ A ) = a.

8.3 Logistic Regression

We consider a set of m financial criteria or indicators (xi,j )j =1,2,...,m applying


to each of n credit applicants i = 1, 2, . . . , n.

install.packages("caret")
library(caret); data(GermanCredit); head(GermanCredit)

j Age ForeignWorker Property.RealEstate Housing.Own CreditHistory Class


xi,j xi,1 = 67 xi,2 = 1 xi,3 = 0 xi,4 = 1 xi,5 = 0 ci = 1

The credit rating class (“good” or “bad”) of applicant n◦ i is denoted by


ci ∈ {0, 1} depending on his status, i.e. ci = 1 for “good” applicants and
ci = 0 for “bad” applicants.

Linear regression

The score zi of a given credit applicant in row no i is modeled as


 
Xm
zi = F  βj xi,j  , i = 1, 2, . . . , n.
j =1

where (βj )j =1,2,...,m is a family of linear coefficients, where pi := 1 − zi rep-


resents the probability that applicant no i may default. In a linear regression
model we would take F (z ) := z, hence the system of equations
m
X
ci = βj xi,j , i = 1, 2, . . . , n,
j =1

would be used to estimate the coefficients (βj )j =1,2,...,m .

Binomial logistic regression

The shortcoming of linear models is that F (zi ), which is assumed to represent


a probability value, may exit the interval [0, 1]. Logistic regression models
address this issue by replacing F (x) = x with the logistic CDF FL defined
as
ex
FL ( x ) : = , x ∈ R.
1 + ex
186 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

0.8

0.6

0.4

0.2

0
-10 -5 0 5 10
x

Fig. 8.4: Logistic CDF x 7→ FL (x) = ex /(1 + ex ).

Modeling the probability pi = P(i ∈ G) that applicant no i is rated “good”,


i.e. the score of applicant no i, as
 
Xm
pi = P(i ∈ G) = F L  βj xi,j  ,
j =1

we aim at maximizing the log-likelihood ratio


n
Y
log L(β|x) := log (P(i ∈ B ))1−ci (P(i ∈ G))ci


i=1
  1−ci   ci 
n
Y m
X m
X
= log FL  βj xi,j  F L  βj xi,j  
i=1 j =1 j =1
 Pm 1−ci !ci 
n β x
Y e j =1 j i,j  1
= log   P m P m

β x β x
i=1 1 + e j =1 j i,j 1 + e j =1 j i,j
Pm
n β x n
X e j =1 j i,j X 1
= (1 − ci ) log Pm + ci log Pm
β x β x
i=1 1 + e j = 1 j i,j
i=1 1 + e j =1 j i,j

over β = (βj )j =1,2,...,m . The default probabilities are then given from
 
Xm
1 − pi = 1 − FL  βj xi,j  , i = 1, . . . , n,
j =1

and the logit

" 187

This version: June 9, 2023


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

m
pi
FL−1 (pi ) = log
X
= βj xi,j , i = 1, . . . , n,
1 − pi
j =1

or log-odds, represents probabilities on a logit scale.

ggplot(GermanCredit, aes(x = Class)) + geom_bar(aes(y =


(..count..)/sum(..count..)),fill=c( "red","darkgreen")) + labs(y = "prob.") +
theme_bw()
Train <- createDataPartition(GermanCredit$Class, p=0.6, list=FALSE)
training <- GermanCredit[ Train, ];testing <- GermanCredit[ -Train, ]

The data is randomly split into a training set and a testing set using the
createDataPartition command in . The training set is used to fit the data
in a generalized linear model using the glm() command. The testing set is
then used to estimate the corresponding default probabilities.

mod.glm<-glm(Class ~ Age + ForeignWorker + Property.RealEstate + Housing.Own +


CreditHistory.Critical, data=training, family="binomial")
head(testing$Class)
head(predict(mod.glm, newdata=testing, type="response"))
testing <- cbind(rownames(testing), testing); colnames(testing)[1] <- "ID"
testing$Score5<-predict(mod.glm, newdata=testing, type="response")
testsamp <- head(testing,100);colnames(testsamp) <- make.unique(names(testsamp))
ggplot(testsamp, aes(x=ID, y=Score5, fill=Class)) + geom_bar(stat="identity") +
scale_fill_manual(values=c( "red","darkgreen")) +
scale_y_continuous(limits=c(0,1),expand = c(0,0)) + theme_bw(base_size = 18) +
xlab(NULL) + theme(axis.text.x = element_blank(),aspect.ratio=0.5) +
geom_hline(yintercept = 0.75,lwd=1.6)

1.00

0.75
Score5

Class
0.50 Bad
Good
0.25

0.00
Fig. 8.5: Logistic regression output on 5 criteria.

Based on the above 100 samples, the next code identifies the True
Positive Rate (TPR) = 34/77 = 44.16%, and the False Positive Rate
(FPR) = 8/23 = 34.78%, at the threshold p = 0.75.

188 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

cat('TPR5=',length(testsamp$Score5[testsamp$Score5>0.75 & testsamp$Class=="Good"])


/length(testsamp$Score5[testsamp$Class=="Good"]),'\n')
cat('FPR5=',length(testsamp$Score5[testsamp$Score5>0.75 & testsamp$Class=="Bad"])
/length(testsamp$Score5[testsamp$Class=="Bad"]),'\n')
pred <- ifelse(testsamp$Score5 > 0.75, "Good", "Bad")
confusionMatrix(factor(noquote(pred)),factor(testsamp$Class))

mod.glm<-glm(Class ~ Duration + Amount + InstallmentRatePercentage +


ResidenceDuration + Age + NumberExistingCredits + NumberPeopleMaintenance +
Telephone + ForeignWorker + CheckingAccountStatus.lt.0 +
CheckingAccountStatus.0.to.200 + CheckingAccountStatus.gt.200 +
CheckingAccountStatus.none + CreditHistory.NoCredit.AllPaid +
CreditHistory.ThisBank.AllPaid + CreditHistory.PaidDuly + CreditHistory.Delay +
CreditHistory.Critical + Purpose.NewCar + Purpose.UsedCar +
Purpose.Furniture.Equipment + Purpose.Radio.Television +
Purpose.DomesticAppliance + Purpose.Repairs + Purpose.Education +
Purpose.Vacation + Purpose.Retraining + Purpose.Business + Purpose.Other +
SavingsAccountBonds.lt.100 + SavingsAccountBonds.100.to.500 +
SavingsAccountBonds.500.to.1000 + SavingsAccountBonds.gt.1000 +
SavingsAccountBonds.Unknown + EmploymentDuration.lt.1 +
EmploymentDuration.1.to.4 + EmploymentDuration.4.to.7 +
EmploymentDuration.gt.7 + EmploymentDuration.Unemployed +
Personal.Male.Divorced.Seperated + Personal.Female.NotSingle +
Personal.Male.Single + Personal.Male.Married.Widowed + Personal.Female.Single +
OtherDebtorsGuarantors.None + OtherDebtorsGuarantors.CoApplicant +
OtherDebtorsGuarantors.Guarantor + Property.RealEstate + Property.Insurance +
Property.CarOther + Property.Unknown + OtherInstallmentPlans.Bank +
OtherInstallmentPlans.Stores + OtherInstallmentPlans.None + Housing.Rent +
Housing.Own + Housing.ForFree + Job.UnemployedUnskilled +
Job.UnskilledResident + Job.SkilledEmployee +
Job.Management.SelfEmp.HighlyQualified, data=training, family="binomial")
testing$Score61<-predict(mod.glm, newdata=testing, type="response")
testsamp <- head(testing,100);colnames(testsamp) <- make.unique(names(testsamp))
ggplot(testsamp, aes(x=ID, y=Score61, fill=Class)) + geom_bar(stat="identity") +
scale_fill_manual(values=c( "red","darkgreen")) +
scale_y_continuous(limits=c(0,1),expand = c(0,0)) + theme_bw(base_size = 18) +
xlab(NULL) + theme(axis.text.x = element_blank(),aspect.ratio=0.5) +
geom_hline(yintercept = 0.75,lwd=1.6)

1.00

0.75
Score61

Class
0.50 Bad
Good
0.25

0.00
Fig. 8.6: Logistic regression output on 61 criteria.

In comparison with Figure 8.5, the 100 samples in Figure 8.6 above yield
a higher True Positive Rate (TPR) = 48/77 = 62.34% and a lower False

" 189

This version: June 9, 2023


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

Positive Rate (FPR) = 5/23 = 21.74% at the level p = 0.75. In other words,
the count of true positive samples has increased from 34 to 48, and the count
of false positive samples has decreased from 6 to 5.

cat('TPR61=',length(testsamp$Score61[testsamp$Score61>0.75 &
testsamp$Class=="Good"])/length(testsamp$Score61[testsamp$Class=="Good"]),'\n')
cat('FPR61=',length(testsamp$Score61[testsamp$Score61>0.75 &
testsamp$Class=="Bad"])/length(testsamp$Score61[testsamp$Class=="Bad"]),'\n')
pred <- ifelse(testsamp$Score61 > 0.75, "Good", "Bad")
confusionMatrix(factor(noquote(pred)),factor(testsamp$Class))

8.4 ROC Curve

Definition 8.5. The Receiver Operating Characteristic (ROC) curve is the


function of the threshold p ∈ [0, 1] defined as

[0, 1] −→ [0, 1]
p 7−→ ROC(p) := F G F −1
B (p) ,


where F −1
B denotes the inverse of the tail distribution function F B .
In other words, the ROC curve is a plot of the True Positive Rate values

x 7−→ F G (x)

against the False Positive Rate function

x 7−→ F B (x).

Proposition 8.6. The ROC function can be rewritten as the integral


 wp
ROC(p) = F G F −1 λ F −1 0 ⩽ p ⩽ 1,

B (p) = B (q ) dq,
0

where the likelihood ratio λ(x) is given by

fX ( x | G )
λ(x) = , x ∈ R.
fX (x | B )
Proof. The slope of the ROC curve at the point p ∈ [0, 1] is given by

d  d −1
F G F −1 ′ −1

dp B (p) = F G F B (p) dp F B (p)

F ′ F −1 (p)

= ′G B −1

F B F B (p)
F ′G (x)
=
F ′B (x)
190 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

= λ(x)

with x := F −1
B (p), hence we have
 wp
F −1 λ F −1 0 ⩽ p ⩽ 1.

FG B (p) = 0 B (q ) dq,


When X is Gaussian distributed given {G, B} with the conditional densi-
ties
1 2 2
fX (x | G) = √ e−(x−µG ) /(2σ )
2πσ
and
1 2 2
fX ( x | B ) = √ e−(x−µB ) /(2σ ) ,
2πσ
the likelihood ration is given by

fX ( x | G ) 2 2 2
λ(x) = = eβx−(µG −µB )/(2σ ) , x ∈ R,
fX (x | B )

with β := (µG − µB )/σ 2 . Figure 8.7 presents three samples of ROC curves in
the Gaussian example with successively (µB , µG ) = (1, 4), (µB , µG ) = (1, 2),
and (µB , µG ) = (1, 1).

1
0.9
True Positive Rate (TPR)

0.8
0.7
0.6
0.5
0.4
0.3
0.2 µB=1,µG=4
µB=1,µG=2
0.1
µB=1,µG=1
0
0 0.2 0.4 0.6 0.8 1
False Positive Rate (FPR)

Fig. 8.7: Gaussian ROC curves.

We check that the classification is better when µB << µG . The ROC Curve
shows the performance of the classification procedure, which is quantified
by the Area Under The Curve (AUC). A perfect classification would corre-
spond to a single point with coordinates (0, 1) and AUC equal to 1, which
corresponds to FPR=0% false negatives and TPR=100% true positives. The
closer the AUC is to 1, the better the classification is performing.

" 191

This version: June 9, 2023


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

On the other hand, a completely random guess would correspond to a point


on the diagonal line. Points above the diagonal represent good classification
results (better than random), while points below the line represent poor re-
sults (worse than random) (Wikipedia).

TPR5<-length(testing$Score5[testing$Score5>0.75 &
testing$Class=="Good"])/length(testing$Score5[testing$Class=="Good"])
FPR5<-length(testing$Score5[testing$Score5>0.75 &
testing$Class=="Bad"])/length(testing$Score5[testing$Class=="Bad"])
cat('TPR5=',TPR5,'\n')
cat('FPR5=',FPR5,'\n')
TPR61<-length(testing$Score61[testing$Score61>0.75 &
testing$Class=="Good"])/length(testing$Score61[testing$Class=="Good"])
FPR61<-length(testing$Score61[testing$Score61>0.75 &
testing$Class=="Bad"])/length(testing$Score61[testing$Class=="Bad"])
cat('TPR61=',TPR61,'\n')
cat('FPR61=',FPR61,'\n')

The above True Positive Rates (TPR) and False Positive Rates (FPR) based
on 5 and 61 criteria at the level p = 0.75 are recomputed in the above code
on the whole 400 samples, and plotted on the next ROC graphs of Figure 8.8.

install.packages("ROCR")
library(ROCR)
pred5<-prediction(as.numeric(testing$Score5),as.numeric(testing$Class))
perf5 <- performance(pred5,"tpr","fpr")
dev.new(width=16,height=7);par(mar = c(4.5,4.5,2,2))
plot(perf5,col="purple",lwd=3, xaxs = "i", yaxs = "i",cex.lab=2,las=1)
segments(FPR5,0,FPR5,TPR5, col="purple", lwd =2)
segments(0,TPR5,FPR5,TPR5, col="purple", lwd =2)
pred61<-prediction(as.numeric(testing$Score61),as.numeric(testing$Class))
perf61 <- performance(pred61,"tpr","fpr")
par(new=TRUE)
plot(perf61,col="blue",lwd=3,main="", ann=FALSE, xaxs="i", yaxs="i")
legend("bottomright", legend=c("61 criteria","5 criteria"),col=c("blue","purple"), lwd=3,
cex=3)
segments(FPR61,0,FPR61,TPR61, col="blue", lwd =2)
segments(0,TPR61,FPR61,TPR61, col="blue", lwd =2)

The ROC graphs in the next Figure 8.8 confirm the improvement in classifi-
cation reached when switching from 5 to 61 criteria.

192 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

1.0
0.8
True positive rate
0.6
0.4

61 criteria
0.2

5 criteria
0.0

0.0 0.2 0.4 0.6 0.8 1.0

False positive rate

Fig. 8.8: ROC curves based on 5 criteria and 61 criteria.

Using a neural network in

Restarting is needed before running the following code.


install.packages("neuralnet");
library(neuralnet);library(caret);data(GermanCredit);library(ROCR);
Train <- createDataPartition(GermanCredit$Class, p=0.6, list=FALSE)
training <- GermanCredit[ Train, ];testing <- GermanCredit[ -Train, ]
nn <- neuralnet(Class ~ Age + ForeignWorker + Property.RealEstate + Housing.Own +
CreditHistory.Critical, data=training, hidden=c(3,1), linear.output=FALSE,
threshold=0.05)
nn$result.matrix
plot(nn,col.intercept = "blue")
temp_test <- subset(testing, select = c("Age", "ForeignWorker", "Property.RealEstate",
"Housing.Own", "CreditHistory.Critical"))
head(temp_test)
nn.results <- compute(nn, temp_test)
results <- data.frame(actual = testing$Class, prediction = nn.results$net.result)
head(results)
pred <- ifelse(results[,3] > 0.75, "Good", "Bad")
confusionMatrix(factor(results$actual),factor(noquote(pred)))
pred2<-prediction(as.numeric(results[,3]),as.numeric(results$actual))
perf <- performance(pred2,"tpr","fpr")
plot(perf,col="purple",lwd=3, xaxs = "i", yaxs = "i")

Improved performance may be achieved by rescaling the binary variables to


{−1, 1}.

" 193

This version: June 9, 2023


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

training$ForeignWorker <- ifelse(training$ForeignWorker == 0, -1, 1)


training$Property.RealEstate <- ifelse(training$Property.RealEstate == 0, -1, 1)
training$Housing.Own <- ifelse(training$Housing.Own == 0, -1, 1)
training$CreditHistory.Critical <- ifelse(training$CreditHistory.Critical == 0, -1, 1)
nn2 <- neuralnet(Class ~ Age + ForeignWorker + Property.RealEstate + Housing.Own +
CreditHistory.Critical, data=training, hidden=c(3,1), linear.output=FALSE,
threshold=0.05)
nn2.results <- compute(nn2, temp_test)
results2 <- data.frame(actual = testing$Class, prediction = nn2.results$net.result)
pred3 <- ifelse(results2[,3] > 0.75, "Good", "Bad")
confusionMatrix(factor(results2$actual),factor(noquote(pred3)))
pred4<-prediction(as.numeric(results2[,3]),as.numeric(results$actual))
dev.new(width=16,height=7);par(mar = c(4.5,4.5,2,2))
plot(perf,col="purple",lwd=3, xaxs = "i", yaxs = "i",cex.lab=2,las=1)
perf3 <- performance(pred4,"tpr","fpr")
par(new=TRUE)
plot(perf3,col="blue",lwd=3,main="", ann=FALSE, xaxs="i", yaxs="i")
legend("bottomright", legend=c("Rescaled","Non rescaled"),col=c("blue","purple"), lwd=3,
cex=3)

Using a neural network in Python

Download the corresponding IPython notebook that can be run here us-
ing this data file.

Using random forests in Python

Download the corresponding IPython notebook that can be run here us-
ing this data file.

Using XGBoost in

Download the corresponding code.

Exercises

Exercise 8.1 Consider a set Ω of applicants decomposed into the partition


Ω = G ∪ B, where each applicant ω is assigned a rating X (ω ) which is
exponentially distributed given {G, B} with the conditional densities

fX (x | G) = λG e−λG x 1[0,∞) (x)

and
fX (x | B ) = λB e−λB x 1[0,∞) (x),
where λB > λG > 0.
a) Compute the conditional expected values E[X | G] and E[X | B ].
b) Compute the probability default curve

194 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

P ( B ) fX ( x | B )
x 7−→ P(B | X = x) =
P(G)fX (x | G) + P(B )fX (x | B )

in terms of the likelihood ratio λ(x) := fG (x)/fB (x), x ∈ R.


c) Determine the acceptance set

A := x ∈ R : DP(B | X = x) ⩽ LP(G | X = x) ,


where
• L represents the loss incurred by the rejection of an applicant, and

• D represents the loss incurred by the default of an applicant.


−1
d) Compute the ROC function x 7→ F G F B (x) , x ∈ [0, 1].


Exercise 8.2 Consider a set Ω of applicants decomposed into the partition


Ω = G ∪ B, where each applicant ω is assigned a uniformly distributed rating
X (ω ) given {G, B}, with the conditional densities
1
fX ( x | G ) = 1 (x)dx
λG [0,λG ]
and
1
fX ( x | B ) = 1 (x)dx,
λB [0,λB ]
where 0 < λB < λG .
a) Compute the probability default curve

P(B )fX (x | B )
x 7−→ P(B | X = x) = .
P(G)fX (x | G) + P(B )fX (x | B )

b) Determine the acceptance set

A := x ∈ R+ : DP(B | X = x) ⩽ LP(G | X = x) ,


where
• L represents the missed earnings incurred by the rejection of applicant,

• D represents the loss incurred by the default of an applicant.

Exercise 8.3 Consider a set Ω of customers decomposed as the partition


Ω = G ∪ B, where each customer ω is assigned a uniformly distributed rating
X (ω ) given {G, B}, with the conditional densities
1 2 2
fX (x | G) = √ e−(x−µG ) /(2σ )
2πσ
" 195

This version: June 9, 2023


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

and
1 2 2
fX ( x | B ) = √ e−(x−µB ) /(2σ ) ,
2πσ
with µB < µG .
a) Compute the probability default curve

P ( B ) fX ( x | B )
x 7−→ P(B | X = x) := .
P(G)fX (x | G) + P(B )fX (x | B )

b) Compute the likelihood ratio λ(x) defined as λ(x) := fX (x | G)/fX (x |


B ), x ∈ R.
c) Letting
• L(x) := e−ax represent the missed earnings incurred by rejecting an
applicant with score x ∈ R, with a > 0,
• D (x) := ebx represent the loss incurred by the default of an applicant
with score x ∈ R, with b > 0,
determine the acceptance set

A : = x ∈ R+ : D (x )P (B | X = x ) ⩽ L (x )P (G | X = x ) .


196 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Part III
Credit Risk
Chapter 9
Credit Risk - Structural Approach

The structural approach to credit risk modeling focuses on modeling bankruptcy


from a firm’s asset value, in contrast to the reduced form approach in which
default probabilities are modeled as stochastic processes. Here, the credit de-
fault event occurs when the assets of a firm drop below a certain pre-defined
level. This chapter also considers the modeling of correlation and dependence
between multiple default times.

9.1 Merton Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199


9.2 Default Bonds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
9.3 Black-Cox Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
9.4 Correlated Default Times . . . . . . . . . . . . . . . . . . . . . . . 206
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211

9.1 Merton Model


The Merton (1974) credit risk model reframes corporate debt as an option on
a firm’s underlying value. Precisely the value St of a firm’s asset is modeled
by a geometric Brownian motion

dSt = µSt dt + σSt dBt

under the historical (or physical) measure P. Recall that, using the standard
Brownian motion
bt = µ − r t + Bt ,
B t ⩾ 0,
σ
under the risk-neutral probability measure P∗ , the process (St )t∈R+ is mod-
eled as
bt .
dSt = rSt dt + σSt dB
The company’s debt is represented by an amount K > 0 in bonds to be paid
at maturity T , cf. § 4.1 of Grasselli and Hurd (2010).
" 199

This version: June 9, 2023


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

Default occurs if ST < K with probability P(ST < K ), the bond holder
will receive the recovery value ST . Otherwise, if ST ⩾ K the bond holder
receives K and the equity holder is entitled to receive ST − K, which can be
represented as (ST − K )+ in general.
Proposition 9.1. The default probability P(ST < K | Ft ) can be computed
from the lognormal distribution of ST as

P(ST < K | Ft ) = Φ − dµ− ,




where Φ is the cumulative distribution function of the standard normal dis-


tribution, and

(µ − σ 2 /2)(T − t) + log(St /K )
dµ− := √ .
σ T −t
Proof. The default probability P(ST < K | Ft ) can be computed from the
lognormal distribution of ST as
2 /2)T
P(ST < K | Ft ) = P(S0 eσBT +(µ−σ < K | Ft )
= P(BT < (−(µ − σ 2 /2)T + log(K/S0 ))/σ | Ft )
= P(BT − Bt + y < (−(µ − σ 2 /2)T + log(K/S0 ))/σ )y =Bt
1 w (−(µ−σ2 /2)(T −t)+log(K/St ))/σ 2
= p e−x /(2(T −t)) dx
2(T − t)π −∞

1 w (−(µ−σ2 /2)(T −t)+log(K/St ))/(σ T −t) −x2 /2
= √ e dx
2π −∞

(µ − σ 2 /2))(T − t) + log(St /K ))
 
= 1−Φ √
σ T −t
µ
= 1 − Φ ( d− )
= Φ(−dµ− ).


Note that under the risk-neutral probability measure P∗ we have, replacing
µ with r,
P∗ (ST < K | Ft ) = Φ(−dr− ),
with
(r − σ 2 /2)(T − t) + log(St /K )
dr− = √ ,
σ T −t
which implies the relation
µ − r√
dr− = dµ− − T − t,
σ
or, denoting by Φ−1 the inverse function of Φ,

200 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

µ − r√
Φ−1 (P(ST < K | Ft )) = − T − t + Φ−1 (P∗ (ST < K | Ft )).
σ
If the level of the firm’s assets falls below the level K at time T , default may
have occurred at a random time τ such that

P(τ < T | Ft ) = P(ST < K | Ft ).

In this case, the result of Proposition 9.1 can be reinterpreted in the next
corollary.
Corollary 9.2. The conditional distribution of the default time τ is given by

(µ − σ 2 /2)(T − t) + log(St /K ))
 
P(τ < T | Ft ) = P(ST < K | Ft ) = Φ − √ ,
σ T −t
(9.1)
0 ⩽ t ⩽ T.
We also have

P(τ < T | Ft ) = P(ST < K | Ft )


µ − r√
 
= Φ Φ−1 (P∗ (ST < K | Ft )) − T −t
σ
µ − r√
 
−1 ∗
= Φ Φ (P (τ < T | Ft )) − T −t
σ

and

P∗ (τ < T | Ft ) = P∗ (ST < K | Ft )


(r − σ 2 /2))(T − t) + log(St /K ))
 
=Φ − √
σ T −t
µ − r√
 
−1
= Φ Φ (P(ST < K | Ft )) + T −t
σ
µ − r√
 
−1
= Φ Φ (P(τ < T | Ft )) + T −t . (9.2)
σ

Note that when µ < r, we have

P(τ < T | Ft ) > P∗ (τ < T | Ft ),

whereas when µ > r we get

P(τ < T | Ft ) < P∗ (τ < T | Ft ),

as illustrated in the next Figure 9.1.

" 201

This version: June 9, 2023


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

0.8

0.6
P*(τ < T)

µ > r

0.4
µ < r

0.2

0
0 0.2 0.4 0.6 0.8 1
P(τ < T)


Fig. 9.1: Graph of the function x 7−→ Φ Φ−1 (x) − (µ − r ) T /σ for µ > r, µ = r,

and µ < r.

The discounted expected cash flow e−(T −t)r E∗ [(ST − K )+ | Ft ] received by


the equity holder can be estimated at time t ∈ [0, T ] as the price of a Euro-
pean call option from the Black-Scholes formula

(r + σ 2 /2)(T − t) + log(St /K )
 
e−(T −t)r E∗ [(ST − K )+ | Ft ] = St Φ √
σ T −t
(r − σ 2 /2)(T − t) + log(St /K )
 
−(T −t)r
−Ke Φ √ , 0 ⩽ t ⩽ T.
σ T −t

9.2 Default Bonds

In the following proposition we price at time t ∈ [0, T ] the amount min(ST , K )


received by the bond holder (or junior creditor) at maturity, based on the
recovery value ST . This price can interpreted at the price P (t, T ) at time
t ∈ [0, T ] of a default bond with face value $1, maturity T and recovery value
min(ST /K, 1).
Proposition 9.3. The amount received by the bond holder (or junior credi-
tor) at maturity is priced at time t ∈ [0, T ] as

e−(T −t)r E∗ min(ST , K ) | Ft = Ke−(T −t)r Φ(dr− ) − St Φ(−dr+ ), 0 ⩽ t ⩽ T.


 

Proof. Using the Black-Scholes put option pricing formula and the identity

min(x, K ) = K − (K − x)+ , x ∈ R,

we have

e−(T −t)r E∗ min(ST , K ) | Ft = e−(T −t)r E∗ K − (K − ST )+ | Ft


   

= e−(T −t)r K − e−(T −t)r E∗ (K − ST )+ | Ft


 

= e−(T −t)r K − St Φ(−dr+ ) − Ke−(T −t)r Φ(−dr− )




202 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

= Ke−(T −t)r Φ(dr− ) − St Φ(−dr+ ).


Writing

P (t, T ) = e−(T −t)yt,T


1
= e−(T −t)r E∗ [min(ST , K ) | Ft ]
K
St
= e−(T −t)r Φ(dr− ) − Φ(−dr+ ),
K
gives the default bond yield
1
yt,T = − log(P (t, T ))
T −t
1
    
ST
= − log e−(T −t)r E∗ min 1, Ft
T −t K
1
    
∗ ST
= r− log E min 1, Ft
T −t K
1 1 ∗h
 i
= r− log E min (K, ST ) Ft
T −t K
1
 
St
= r− log Φ(dr− ) − e(T −t)r Φ(−dr+ ) ,
T −t K

which is usually higher than the risk-free yield r.

9.3 Black-Cox Model


In the Black and Cox (1976) model the firm has to maintain an account
balance above the level K throughout time, therefore default occurs at the
first time the process St hits the level K, cf. § 4.2 of Grasselli and Hurd
(2010). The default time τK is therefore the first hitting time
n 2
o
τK := inf t ⩾ 0 : St := S0 eσBt +(µ−σ /2)t ⩽ K ,

of the level K by
2 /2)t
(St )t∈R+ = S0 eσBt +(µ−σ ,

t∈R+

after starting from S0 > K.


Proposition 9.4. The probability distribution function of the default time
τK is given by

" 203

This version: June 9, 2023


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

1−2µ/σ2
log(K/S0 ) + (µ − σ 2 /2)T
  
S0
P τK ⩽ T = P(ST ⩽ K ) + Φ ,


K σ T
with S0 ⩾ K.
Proof. By e.g. Corollary 7.2.2 and pages 297-299 of Shreve (2004), or from
Relation (10.13) in Privault (2022), we have
 
P τK ⩽ T = P min St ⩽ K

t∈[0,T ]
 
2 K
= P min eσBt +(µ−σ /2)t ⩽
t∈[0,T ] S0
(µ − σ 2 /2)t 1
    
K
= P min Bt + ⩽ log
t∈[0,T ] σ σ S0
log(K/S0 ) − (µ − σ 2 /2)T
 
=Φ √
σ T
 1−2µ/σ2 
log(K/S0 ) + (µ − σ 2 /2)T

S0
+ Φ √ (9.3)
K σ T
 1−2µ/σ2 
log(K/S0 ) + (µ − σ 2 /2)T

S0
= P(ST ⩽ K ) + Φ √ ,
K σ T
with S0 ⩾ K. □
The cash flow

(ST − K )+ 1{τK >T } = (ST − K )+ 1 


min St > K
t∈[0,T ]

received at maturity T by the equity holder can be priced at time t ∈ [0, T ]


as a down-and-out barrier call option with strike price K and barrier level
K is priced in the next proposition, in which BSc denotes the Black-Scholes
call pricing formula.

Proposition 9.5. We have


 

E ∗
(ST − K ) 1n
+ o F t  = 1  g (t, St ),
min St > K min St > B
0⩽t⩽T t∈[0,T ]

t ∈ [0, T ], where
 2r/σ2
K
g (t, St ) = BSc (St , K, r, T − t, σ ) − St BSc (K/St , 1, r, T − t, σ ),
St

204 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

0 ⩽ t ⩽ T.

Proof. By e.g. Relation (11.10) and Exercise 11.1 in Privault (2022), we have
 

E∗ (ST − K )+ 1n o Ft  = 1  g (t, St ),
min St > K min St > B
0⩽t⩽T t∈[0,T ]

t ∈ [0, T ], where

g (t, St )
     
T −t St T −t St
= St Φ δ+ − e−(T −t)r KΦ δ−
K K
 2r/σ2     1−2r/σ2   
K T −t K St T −t K
−K Φ δ+ + e−(T −t)r K Φ δ−
St St K St
= BSc (St , K, r, T − t, σ )
 −2r/σ2     −2r/σ2   
St T −t K St T −t K
−K Φ δ+ + e−(T −t)r St Φ δ−
K St K St
 2r/σ2
K
= BSc (St , K, r, T − t, σ ) − St BSc (K/St , 1, r, T − t, σ ),
St

0 ⩽ t ⩽ T. □
For t ⩾ 0, taking now
2
τK := inf u ∈ [t, ∞) : Su := S0 eσBu +(µ−σ /2)u ⩽ K ,


the recovery value received by the bond holder at time min τK , T is K, and


it can be priced as in the next proposition.


Proposition 9.6. After discounting from time min τK , T to time t ∈ [0, T ],


we have

E∗ Ke−(min(τK ,T )−t)r | Ft
 
wT
= K 1{τK ⩾t} e−(u−t)r dP∗ τK ⩽ u | Ft + Ke−(T −t)r P∗ τK > T | Ft .
 
t
Proof. We have

E∗ Ke−(min(τK ,T )−t)r | Ft
 

= E∗ Ke−(τK −t)r 1{t⩽τK ⩽T } + Ke−(T −t)r 1{τK >T } | Ft


 

= KE∗ e−(τK −t)r 1{t⩽τK ⩽T } | Ft + Ke−(T −t)r P∗ τK > T | Ft


  

" 205

This version: June 9, 2023


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

= K 1{τK ⩾t} E∗ e−(τK −t)r 1{t⩽τK ⩽T } | Ft + Ke−(T −t)r P∗ τK > T | Ft


  
wT
= K 1{τK ⩾t} e−(u−t)r dP τK ⩽ u | Ft + Ke−(T −t)r P∗ τK > T | Ft ,
 
t

0 ⩽ t ⩽ T. □
The above probabilities P∗
τK ⩽ u | Ft and P∗ = 1−
 
τK > T | Ft
P∗ τK ⩽ T | Ft can be computed from (9.3) as


log(K/St ) − (r − σ 2 /2)(u − t)
 
P∗ τK ⩽ u | Ft = Φ


σ u−t
1−2r/σ2
log(St /K ) + (r − σ 2 /2)(u − t)
  
St
+ Φ √
K σ u−t
 1−2r/σ2 
log(St /K ) + (r − σ 2 /2)(u − t)

St
= P(Su ⩽ K | Ft ) + Φ √ ,
K σ u−t
with St ⩾ K and u > t, from which the probability density function of the
hitting time τK can be estimated by differentiation with respect to u > t.
Note also that we have

P∗ τK < ∞ | Ft = lim P∗ τK ⩽ u | Ft
 
u→∞
  −1+2r/σ2
K
if r > σ 2 /2



= St


1 if r ⩽ σ 2 /2.

9.4 Correlated Default Times

In order to model correlated default and possible “domino effects”, one can
regard two given default times τ1 and τ2 are correlated random variables.
Namely, given τ1 and τ2 two default times we can consider the correlation

Cov(τ1 , τ2 )
ρ= p ∈ [−1, 1].
Var[τ1 ] Var[τ2 ]

When trying to build a dependence structure for the default times τ1 and τ2 ,
the idea of Li (2000) is to use the normalized Gaussian copula CΣ (x, y ), with

1 ρ
 
Σ= ,
ρ 1

with correlation parameter ρ ∈ [−1, 1], and to model the joint default prob-
ability P(τ1 ⩽ T and τ2 ⩽ T ) as

206 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

P(τ1 ⩽ T and τ2 ⩽ T ) := CΣ (P(τ1 ⩽ T ), P(τ2 ⩽ T )) ,

where CΣ is given by (4.4). Given two default events A = {τ1 ⩽ T } and


B = {τ2 ⩽ T } with probabilities
 w   w 
T T
P(τ1 ⩽ T ) = 1 − exp − λ1 (s)ds and P(τ2 ⩽ T ) = 1 − exp − λ2 (s)ds
0 0

we can also define the default correlation ρD ∈ [−1, 1] as

P(A ∩ B ) − P(A)P(B )
ρD = p (9.4)
P(A)(1 − P(A)) P(B )(1 − P(B ))
p

C (P(τ1 ⩽ T ), P(τ2 ⩽ T )) − P(τ1 ⩽ T )P(τ2 ⩽ T )


= p Σ .
P(τ1 ⩽ T )(1 − P(τ1 ⩽ T )) P(τ2 ⩽ T )(1 − P(τ2 ⩽ T ))
p

In this case, the default correlation ρD in (9.4) can be written as

When the default probabilities are specified in the Merton model of credit
risk as

P(τi ⩽ T ) = P (ST < K )


 
2 K
= P eσi BT +(µi −σi /2)T <
S0
(µi − σi2 /2)T 1
 
K
= P BT ⩽ − + log
σi σi S0
log(K/S0 ) − (µi − σi2 /2)T
 
=Φ √ , i = 1, 2,
σi T
where
2
Ait := S0 eσi Bt +(µ−σi /2)t , i = 1, 2,
 
t∈R+ t∈R+

the default correlation ρD becomes

P(τ1 ⩽ T and τ2 ⩽ T ) − P(τ1 ⩽ T )P(τ2 ⩽ T )


ρD = p
P(τ1 ⩽ T )(1 − P(τ1 ⩽ T )) P(τ2 ⩽ T )(1 − P(τ2 ⩽ T ))
p

log(S0 /K )+(µ1 −σ12 /2)T log(S0 /K )+(µ2 −σ22 /2)T


 
ΦΣ √ , √ − P(τ1 ⩽ T )P(τ2 ⩽ T )
σ1 T σ2 T
= .
P(τ1 ⩽ T )(1 − P(τ1 ⩽ T )) P(τ2 ⩽ T )(1 − P(τ2 ⩽ T ))
p p

In Li (2000) it was suggested to use a single average correlation estimate,


see (8.1) page 82 of the Credit Metrics™ Technical Document Gupton et al.
(1997), and also the Appendix F therein.

" 207

This version: June 9, 2023


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

It is worth noting that the outcomes of this methodology have been discussed
in a number of magazine articles in recent years, to name a few:
“Recipe for disaster: the formula that killed Wall Street”, Wired Magazine,
by F. Salmon (2009);

“The formula that felled Wall Street”, Financial Times Magazine, by


S. Jones (2009);

“Formula from hell”, Forbes.com, by S. Lee (2009),


see also here.
On the other hand, a more proper definition of the default correlation ρD
should be
P(τ1 ⩽ T and τ2 ⩽ T ) − P(τ1 ⩽ T )P(τ2 ⩽ T )
ρD : = p ,
P(τ1 ⩽ T )(1 − P(τ1 ⩽ T )) P(τ2 ⩽ T )(1 − P(τ2 ⩽ T ))
p

which requires the actual computation of the joint default probability P(τ1 ⩽
T and τ2 ⩽ T ). An exact expression for this joint default probability in the
first passage time Black-Cox model, and the associated correlation, have been
recently obtained in Li and Krehbiel (2016).

Multiple default times

Consider now a sequence (τk )k=1,2,...,n of random default times and, for more
flexibility, a standardized random variable M with probability density func-
tion ϕ(m) and variance Var[M ] = 1.
As in the Merton (1974) model, cf. § 9.1, a common practice, see Vašiček
(1987), Gibson (2004), Hull and White (2004) is to parametrize the default
probability associated to each τk by the conditioning
 
Φ −1 (P(τ ⩽ T )) − a m
k k
P(τk ⩽ T | M = m) = Φ  q  , k = 1, 2, . . . , n,
1 − a2k
(9.5)
see (9.2), where ak ∈ (−1, 1), k = 1, 2, . . . , n. Note that we have
w∞
P ( τk ⩽ T ) = P(τk ⩽ T | M = m)ϕ(m)dm
−∞
 
w∞ Φ−1 (P(τk ⩽ T )) − ak m 
= Φ  q ϕ(m)dm, (9.6)
−∞
1 − a2k

and ϕ(m) can be typically chosen as a standard normal Gaussian probability


density function.
208 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

Next, we present a dependence structure which implements of the Gaussian


copula correlation method of Li (2000) in the case of multiple default times.
Definition 9.7. Given n Gaussian samples X1 , X2 , . . . , Xn defined as
q
Xk := ak M + 1 − a2k Zk , k = 1, 2, . . . , n, (9.7)

conditionally to M , where Z1 , Z2 , . . . , Zn are normal random variables with


same cumulative distribution function Φ, independent of M , we let the cor-
related default times (τ1 , . . . , τn ) be defined as

τk := Fτ−1
k
(Φ(Xk )), k = 1, 2, . . . , n, (9.8)

where Fτ−1
k
denotes the inverse function of Fτk .
In the next proposition we compute the joint distribution of the default times
(τ1 , . . . , τn ) according to the above dependence structure.
Proposition 9.8. The default times (τk )k=1,2,...,n have the joint distribution

P(τ1 ⩽ y1 , . . . , τn ⩽ yn ) = C P(τ1 ⩽ y1 ), . . . , P(τn ⩽ yn ) ,




where

C ( x1 , . . . , xn )
 
w∞
!
Φ −1 (x ) − a m
1 1 Φ−1 (xn ) − an m
:= Φ ···Φ ϕ(m)dm,
1 − a2n
q p
−∞
1 − a21

x1 , x2 , . . . , xn ∈ [0, 1], is a Gaussian copula on [0, 1]n with covariance matrix

1 a1 a2 · · · a1 an−1 a1 an
 
. .
 a2 a1 1 . . . .. ..
 

 
Σ =  ... .. . . .. ..
. (9.9)
 
 . . . . 
 . .. . .
.

 . . . 1 a a 
n−1 n
an a1 an a2 · · · an an−1 1
Proof. We start by recovering the conditional distribution (9.5), as follows:

P(τk ⩽ T | M = m) = P Fτ−1 (Φ(Xk )) ⩽ T | M = m



k

= P Φ(Xk ) ⩽ Fτk (T ) | M = m


= P(Xk ⩽ Φ−1 (Fτk (T )) | M = m)


 q 
= P ak m + 1 − a2k Zk ⩽ Φ−1 (Fτk (T ))

" 209

This version: June 9, 2023


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

q 
=P 1 − a2k Zk ⩽ Φ−1 (Fτk (T )) − ak m
 
1 −1
= P  Zk ⩽ q Φ (Fτk (T )) − ak m 

1 − a2k
 
Φ −1 (P(τ ⩽ T )) − a m
k k
= Φ q , k = 1, 2, . . . , n.
1 − a2k

Note that the above recovers the correct marginal distributions (9.6), i.e. we
have

P(τk ⩽ yk ) = P(τ1 ⩽ ∞, . . . , τk−1 ⩽ ∞, τk ⩽ yk , τk+1 ⩽ ∞, . . . , τn ⩽ ∞)


 
w∞ Φ −1 (P(τ ⩽ y )) − a m
k k k
= Φ q  ϕ(m)dm
−∞
1 − a2k
w∞
= P(τk ⩽ T | M = m)ϕ(m)dm, k = 1, 2, . . . , n.
−∞

Knowing that, given the sample M = m, the default times τk , k = 1, 2, . . . , n,


are independent random variables, we can compute the joint distribution

P(τ1 ⩽ y1 , . . . , τn ⩽ yn | M = m)
= P(τ1 ⩽ y1 | M = m) × · · · × P(τn ⩽ yn | M = m),

conditionally to M = m. This yields


w∞
P(τ1 ⩽ y1 , . . . , τn ⩽ yn ) = P(τ1 ⩽ y1 , . . . , τn ⩽ yn | M = m)ϕ(m)dm
−∞
w∞
= P(τ1 ⩽ y1 | M = m) · · · P(τn ⩽ yn | M = m)ϕ(m)dm
−∞
 
w∞
!
Φ −1 (P(τ ⩽ y )) − a m
1 1 1  · · · Φ Φ (P(τp
−1
n ⩽ yn )) − an m
= Φ ϕ(m)dm.
1 − a2n
q
−∞
1 − a2
1

In other words, we have

P(τ1 ⩽ y1 , . . . , τn ⩽ yn ) = C P(τ1 ⩽ y1 ), . . . , P(τn ⩽ yn ) ,




where the function

C ( x1 , . . . , xn )
 
w∞
!
Φ −1 (x ) − a m
1 1 Φ−1 (xn ) − an m
:= Φ ···Φ ϕ(m)dm,
1 − a2n
q p
−∞
1 − a21

210 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

x1 , x2 , . . . , xn ∈ [0, 1], is a Gaussian copula on [0, 1]n , built as

C (x1 , . . . , xn ) = F Φ−1 (x1 ), . . . , Φ−1 (xn ) ,




from the Gaussian cumulative distribution function


 
w∞
!
x 1 − a1 m  · · · Φ xpn − an m
F ( x1 , . . . , xn ) : = Φ q ϕ(m)dm
−∞
1 − a21 1 − a2n
 
w∞
!
x 1 − a 1 m  · · · P Zn ⩽ xp n − an m
= P Z1 ⩽ q ϕ(m)dm
−∞
1 − a21 1 − a2n
w∞
= P(X1 ⩽ x1 , . . . , Xn ⩽ xn | M = m)ϕ(m)dm
−∞
= P(X1 ⩽ x1 , . . . , Xn ⩽ xn ), 0 ⩽ x1 , x2 , . . . , xn ⩽ 1,

of the vector (X1 , . . . , Xn ), with covariance matrix given by (9.9). □

Exercises

Exercise 9.1 Compute the conditional probability density function of the


default time τ defined in (9.1).

Exercise 9.2 Credit Default Contract. The assets of a company are modeled
using a geometric Brownian motion (St )t∈R+ with drift r > 0 under the risk-
neutral probability measure P∗ . A Credit Default Contract pays $1 as soon
as the asset St hits a level K > 0. Price this contract at time t > 0 assuming
that St > K.

Exercise 9.3
a) Check that the vector (X1 , X2 , . . . , Xn ) defined in (9.7) has the covariance
matrix given by (9.9).
b) Show that the vector (X1 , X2 , . . . , Xn ), with covariance matrix (9.9) has
standard Gaussian marginals.
c) By computing explicitly the probability density function of (X1 , . . . , Xn ),
recover the fact that it is a jointly Gaussian random vector with covariance
matrix (9.9).

Exercise 9.4 Compute the inverse Σ−1 of the covariance matrix (9.9) in case
n = 2.

" 211

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Chapter 10
Credit Risk - Reduced-Form Approach

The reduced-form approach to credit risk modeling focuses on modeling de-


fault probabilities as stochastic processes, in contrast to the structural ap-
proach in which bankruptcy is modeled from the firm’s asset value. The
modeling of default risk using failure rate processes and exogeneous random
variables results into the use of enlarged filtration that can incorporate in-
formation on default events.

10.1 Survival Probabilities . . . . . . . . . . . . . . . . . . . . . . . . . . 213


10.2 Stochastic Default . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
10.3 Defaultable Bonds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222

10.1 Survival Probabilities

Given t > 0, let P(τ > t) denote the probability that a random system
with lifetime τ survives at least t years. Assuming that survival probabilities
P(τ > t) are strictly positive for all t > 0, we can compute the conditional
probability for that system to survive up to time T , given that it was still
functioning at time t ∈ [0, T ], as

P(τ > T and τ > t) P(τ > T )


P(τ > T | τ > t) = = , 0 ⩽ t ⩽ T,
P(τ > t) P(τ > t)

with

P(τ ⩽ T | τ > t) = 1 − P(τ > T | τ > t)


P(τ > t) − P(τ > T )
=
P(τ > t)
P(τ ⩽ T ) − P(τ ⩽ t)
=
P(τ > t)
" 213

This version: June 9, 2023


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

P(t < τ ⩽ T )
= , 0 ⩽ t ⩽ T. (10.1)
P(τ > t)

Such survival probabilities are typically found in life (or mortality) tables:

Age t P(τ ⩽ t + 1 | τ > t)


20 0.0894%
30 0.1008%
40 0.2038%
50 0.4458%
60 0.9827%

Table 10.1: Mortality table.

The corresponding conditional survival probability distribution can be


computed as follows:

P(τ ∈ dx | τ > t) = P(x < τ ⩽ x + dx | τ > t)


= P(τ ⩽ x + dx | τ > t) − P(τ ⩽ x | τ > t)
P(τ ⩽ x + dx) − P(τ ⩽ x)
=
P(τ > t)
1
= dP(τ ⩽ x)
P(τ > t)
1
=− dP(τ > x), x > t.
P(τ > t)

Proposition 10.1. The failure rate function, defined as

P(τ ⩽ t + dt | τ > t)
λ(t) : = ,
dt
satisfies  w 
t
P(τ > t) = exp − λ(u)du , t ⩾ 0. (10.2)
0

Proof. By (10.1), we have

P(τ ⩽ t + dt | τ > t)
λ(t) : =
dt
1 P(t < τ ⩽ t + dt)
=
P(τ > t) dt
1 P(τ > t) − P(τ > t + dt)
=
P(τ > t) dt
d
= − log P(τ > t)
dt

214 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

1 d
= − P(τ > t), t > 0,
P(τ > t) dt

and the differential equation


d
P(τ > t) = −λ(t)P(τ > t),
dt
which can be solved as in (10.2) under the initial condition P(τ > 0) = 1.

Proposition 10.1 allows us to rewrite the (conditional) survival probability as
 w
P(τ > T )

T
P(τ > T | τ > t) = = exp − λ(u)du , 0 ⩽ t ⩽ T,
P(τ > t) t

with
P(τ > t + h | τ > t) = e−λ(t)h ≃ 1 − λ(t)h, [h ↘ 0],
and
P(τ ⩽ t + h | τ > t) = 1 − e−λ(t)h ≃ λ(t)h, [h ↘ 0],
as h tends to 0. When the failure rate λ(t) = λ > 0 is a constant function of
time, Relation (10.2) shows that

P(τ > T ) = e−λT , T ⩾ 0,

i.e. τ has the exponential distribution with parameter λ. Note that given
(τn )n⩾1 a sequence of i.i.d. exponentially distributed random variables, let-
ting
Tn = τ1 + τ2 + · · · + τn , n ⩾ 1,
defines the sequence of jump times of a standard Poisson process with inten-
sity λ > 0.

10.2 Stochastic Default

When the random time τ is a stopping time with respect to (Ft )t∈R+ we have

{τ > t} ∈ Ft , t ⩾ 0,

i.e. the knowledge of whether default or bankruptcy has already occurred at


time t is contained in Ft , t ∈ R+ , cf. e.g. Section 14.3 of Privault (2022). As
a consequence, we can write

P(τ > t | Ft ) = E 1{τ >t} | Ft = 1{τ >t} , t ⩾ 0.


 

In what follows we will not assume that τ is an Ft -stopping time, and by


analogy with (10.2) we will write P(τ > t | Ft ) as

" 215

This version: June 9, 2023


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

 w 
t
P(τ > t | Ft ) = exp − λu du , t ⩾ 0, (10.3)
0

where the failure rate function (λt )t∈R+ is modeled as a random process
adapted to a filtration (Ft )t∈R+ .
The process (λt )t∈R+ can also be chosen among the classical mean-reverting
diffusion processes, including jump-diffusion processes. In Lando (1998), the
process (λt )t∈R+ is constructed as λt := h(Xt ), t ∈ R+ , where h is a nonneg-
ative function and (Xt )t∈R+ is a stochastic process generating the filtration
(Ft )t∈R+ .
The default time τ is then defined as
 wt 
τ := inf t ∈ R+ : h(Xu )du ⩾ L ,
0

where L is an exponentially distributed random variable with parameter


µ > 0 and distribution function P(L > x) = e−µx , x ⩾ 0, independent
of (Ft )t∈R+ . In this case, as τ is not an (Ft )t∈R+ -stopping time, we have
w 
t
P(τ > t | Ft ) = P h(Xu )du < L Ft
0
 wt 
= exp −µ h(Xu )du
0
 wt 
= exp −µ λu du , t ⩾ 0.
0

Definition 10.2. Let (Gt )t∈R+ be the filtration defined by G∞ := F∞ ∨ σ (τ )


and

Gt := B ∈ G∞ : ∃A ∈ Ft such that A ∩ {τ > t} = B ∩ {τ > t} , (10.4)




with Ft ⊂ Gt , t ⩾ 0.
In other words, Gt contains insider information on whether default at time τ
has occurred or not before time t, and τ is a (Gt )t∈R+ -stopping time. Note
that this information on τ may not be available to a generic user who has
only access to the smaller filtration (Ft )t∈R+ . The next key Lemma 10.3, see
Lando (1998), Guo et al. (2007), allows us to price a contingent claim given
the information in the larger filtration (Gt )t∈R+ , by only
 using information
rT 
in (Ft )t∈R+ and factoring in the default rate factor exp − t λu du .

Lemma 10.3. (Guo et al. (2007), Theorem 1) For any FT -measurable in-
tegrable random variable F , we have

E F 1{τ >T } | Gt = 1{τ >t} E F P(τ > T | τ > t) | Ft


   

216 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

  w  
T
= 1{τ >t} E F exp − λu du Ft .
t

Proof. By (10.3) we have


rT  w
P(τ > T | FT ) e− 0 λu du

T
= rt = exp − λu du ,
P(τ > t | Ft ) e− 0 λu du t

hence, since F is FT -measurable,


 w
P(τ > T | FT )
    
T
1{τ >t} E F exp − λu du Ft = 1{τ >t} E F Ft
t P(τ > t | Ft )
1{τ >t}
E F E[1{τ >T } | FT ] | Ft
 
=
P(τ > t | Ft )
1{τ >t}
E E[F 1{τ >T } | FT ] | Ft
 
=
P(τ > t | Ft )
E F 1{τ >T } Ft
 
= 1{τ >t}
P(τ > t | Ft )
= 1{τ >t} E F 1{τ >T } Gt
 

= E F 1{τ >T } Gt , 0 ⩽ t ⩽ T.
 

In the last step of the above argument we used the key relation
h i 1{τ >t}
1{τ >t} E F 1{τ >T } Gt = E F 1{τ >T } | Ft ,
 
P(τ > t | Ft )

cf. Relation (75.2) in § XX-75 page 186 of Dellacherie et al. (1992), The-
orem VI-3-14 page 371 of Protter (2004), and Lemma 3.1 of Elliott et al.
(2000), under the conditional probability measure P|Ft , 0 ⩽ t ⩽ T . Indeed,
according to (10.4), for any B ∈ Gt we have, for some event A ∈ Ft ,

E 1B 1{τ >t} F 1{τ >T } = E 1B∩{τ >t} F 1{τ >T }


   

= E 1A∩{τ >t} F 1{τ >T }


 

= E 1A 1{τ >t} F 1{τ >T }


 

E[1{τ >t} | Ft ]
" #
= E 1A 1{τ >t} F 1{τ >T }
P(τ > t | Ft )
E[1A 1{τ >t} | Ft ]
" #
=E F 1{τ >T }
P(τ > t | Ft )
E[1A 1{τ >t} | Ft ] 
" #
=E E F 1{τ >T } | Ft

P(τ > t | Ft )

" 217

This version: June 9, 2023


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

1A 1{τ >t}
 
=E E F 1{τ >T } | Ft
 
P(τ > t | Ft )
E[1A 1{τ >t} | Ft ] 
" #
=E E F 1{τ >T } | Ft

P(τ > t | Ft )
1A 1{τ >t} 
 
=E E F 1{τ >T } | Ft

P(τ > t | Ft )
1B 1{τ >t} 
 
=E E F 1{τ >T } | Ft ,

P(τ > t | Ft )

hence by a standard characterization of conditional expectations, see e.g.


Relation (12.26), we have
1{τ >t}
E 1{τ >t} F 1{τ >T } | Gt = E F 1{τ >T } | Ft
   
P(τ > t | Ft )


Taking F = 1 in Lemma 10.3 allows one to write the survival probability up
to time T , given the information known up to time t, as

P(τ > T | Gt ) = E 1{τ >T } | Gt (10.5)


 
  w  
T
= 1{τ >t} E exp − λu du Ft , 0 ⩽ t ⩽ T .
t

In particular, applying Lemma 10.3 for t = T and F = 1 shows that

E 1{τ >t} | Gt = 1{τ >t} ,


 

which shows that {τ > t} ∈ Gt for all t > 0, and recovers the fact that τ is a
(Gt )t∈R+ -stopping time, while in general, τ is not (Ft )t∈R+ -stopping time.
The computation of P(τ > T | Gt ) according to (10.5) is then similar to that
of a bond price, by considering the failure rate λ(t) as a “virtual” short-term
interest rate. In particular the failure rate λ(t, T ) can be modeled in the HJM
framework, cf. e.g. Chapter 18.3 of Privault (2022), and
  w  
T
P(τ > T | Gt ) = E exp − λ(t, u)du Ft
t

can then be computed by applying HJM bond pricing techniques.


The computation of expectations given Gt as in Lemma 10.3 can be useful
for pricing under insider trading, in which the insider has access to the aug-
mented filtration Gt while the ordinary trader has only access to Ft , therefore
generating two different prices E∗ [F | Ft ] and E∗ [F | Gt ] for the same claim
payoff F under the same risk-neutral probability measure P∗ . This leads to

218 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

the issue of computing the dynamics of the underlying asset price by decom-
posing it using a Ft -martingale vs a Gt -martingale instead of using different
forward measures as in e.g. § 19.1 of Privault (2022). This can be obtained
by the technique of enlargement of filtration, cf. Jeulin (1980), Jacod (1985),
Yor (1985), Elliott and Jeanblanc (1999).

10.3 Defaultable Bonds

Bond pricing models are generally based on the terminal condition P (T , T ) =


$1 according to which the bond payoff at maturity is always equal to $1, and
default does not occurs. In this chapter we allow for the possibility of default
at a random time τ , in which case the terminal payoff of a bond is allowed
to vanish at maturity.
The price Pd (t, T ) at time t of a default bond with maturity T , (random)
default time τ and (possibly random) recovery rate ξ ∈ [0, 1] is given by
  w  
T
Pd (t, T ) = E∗ 1{τ >T } exp − ru du Gt
t
  w  
T
+E∗ ξ 1{τ ⩽T } exp − ru du Gt , 0 ⩽ t ⩽ T.
t

Proposition 10.4. The default bond with maturity T and default time τ can
be priced at time t ∈ [0, T ] as

  w  
T
Pd (t, T ) = 1{τ >t} E∗ exp − (ru + λu )du Ft
t
  w  
T
+E ξ 1{τ ⩽T } exp −

ru du Gt , 0 ⩽ t ⩽ T .
t
 r 
T
Proof. We take F = exp − t ru du in Lemma 10.3, which shows that
  w     w  
T T
E∗ 1{τ >T } exp − ru du Gt = 1{τ >t} E∗ exp − (ru + λu )du Ft ,
t t

cf. e.g. Lando (1998), Duffie and Singleton (2003), Guo et al. (2007). □
In the case of complete default (zero-recovery), we have ξ = 0 and
  w  
T
Pd (t, T ) = 1{τ >t} E∗ exp − (rs + λs )ds Ft , 0 ⩽ t ⩽ T . (10.6)
t

From the above expression (10.6) we note that the effect of the presence of
a default time τ is to decrease the bond price, which can be viewed as an
increase of the short rate by the amount λu . In a simple setting where the

" 219

This version: June 9, 2023


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

interest rate r > 0 and failure rate λ > 0 are constant, the default bond price
becomes
Pd (t, T ) = 1{τ >t} e−(r +λ)(T −t) , 0 ⩽ t ⩽ T.
In this case, the failure rate λ can be estimated at time t ∈ [0, T ] from a
default bond price Pd (t, T ) and a non-default bond price P (t, T ) = e−(T −t)r
as
1 P (t, T )
λ= log .
T −t Pd (t, T )
Finally, from e.g. Proposition 19.1 in Privault (2022) the bond price (10.6)
can also be expressed under the forward measure P b with maturity T , as
  w  
T
Pd (t, T ) = 1{τ >t} E∗ exp − (rs + λs )ds Ft
t
  w     w  
T T
= 1{τ >t} E∗ exp − rs ds Ft Eb exp − λs ds Ft
t t

= 1{τ >t} Nt P
b (τ > T | Gt ),

where (Nt )t∈R+ is the numéraire process


  w  
T
Nt := P (t, T ) = E∗ exp − rs ds Ft , 0 ⩽ t ⩽ T,
t

and by (10.5),
  w  
T
b (τ > T | Gt ) = 1{τ >t} E
P b exp − λs ds Ft
t

is the survival probability under the forward measure P


b defined as

dP
b NT − r T rt dt
:= e 0 ,
dP N0
see Chen and Huang (2001) and Chen et al. (2008).

Estimating the default rates

Recall that the price of a default bond with maturity T , (random) default
time τ and (possibly random) recovery rate ξ ∈ [0, 1] is given by
  w  
T
Pd (t, T ) = 1{τ >t} E∗ exp − (ru + λu )du Ft
t
  w  
T
+E ξ 1{τ ⩽T } exp −

ru du Gt , 0 ⩽ t ⩽ T,
t

220 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

where ξ denotes the recovery rate. We consider a simplified deterministic step


function model with zero recovery rate and tenor structure

{t = T0 < T1 < · · · < Tn = T },

where
n−1 n−1
rl 1(Tl ,Tl+1 ] (t) λl 1(Tl ,Tl+1 ] (t),
X X
r (t) = and λ(t) = t ⩾ 0. (10.7)
l =0 l =0

i) Estimating the default rates from default bond prices.


From Proposition 10.4, we have
 w 
Tk
Pd (t, Tk ) = 1{τ >t} exp − (r (u) + λ(u))du
t
k−1
!
= 1{τ >t} exp −
X
(rl + λl )(Tl+1 − Tl ) ,
l =0

k = 1, 2, . . . , n, from which we can infer

1 P (t, Tk )
λk = −rk + log d > 0, k = 0, 1, . . . , n − 1.
Tk+1 − Tk Pd (t, Tk+1 )

ii) Estimating (implied) default probabilities P∗ (τ < T | Gt ) from default


rates.
Based on the expression

P∗ (τ > T | Gt ) = E∗ 1{τ >T } | Gt (10.8)


 
  w  
T
= 1{τ >t} E∗ exp − λu du Ft , 0 ⩽ t ⩽ T,
t

of the survival probability up to time T , see (10.3), and given the infor-
mation known up to time t, in terms of the hazard rate process (λu )u∈R+
adapted to a filtration (Ft )t∈R+ , we find
 w 
T
P(τ > T | GTk ) = 1{τ >Tk } exp − λu du
Tk
n−1
!
= 1{τ >t} exp −
X
λl (Tl+1 − Tl ) , k = 0, 1, . . . , n − 1,
l =k

where
Gt = Ft ∨ σ ({τ ⩽ u} : 0 ⩽ u ⩽ t), t ⩾ 0,

" 221

This version: June 9, 2023


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

i.e. Gt contains the additional information on whether default at time τ


has occurred or not before time t.
In Table 10.2, bond ratings are determined according to hazard (or failure)
rate thresholds.

Bond Credit Moody’s S&P


Ratings Municipal Corporate Municipal Corporate
Aaa/AAAs 0.00 0.52 0.00 0.60
Aa/AA 0.06 0.52 0.00 1.50
A/A 0.03 1.29 0.23 2.91
Baa/BBB 0.13 4.64 0.32 10.29
Ba/BB 2.65 19.12 1.74 29.93
B/B 11.86 43.34 8.48 53.72
Caa-C/CCC-C 16.58 69.18 44.81 69.19
Investment Grade 0.07 2.09 0.20 4.14
Non-Invest. Grade 4.29 31.37 7.37 42.35
All 0.10 9.70 0.29 12.98

Table 10.2: Cumulative historic default rates (in percentage).∗

Exercises

Exercise 10.1 Consider a standard zero-coupon bond with constant yield


r > 0 and a defaultable (risky) bond with constant yield rd and default prob-
ability α ∈ (0, 1). Find a relation between r, rd , α and the bond maturity T .

Exercise 10.2 A standard zero-coupon bond with constant yield r > 0 and
maturity T is priced P (t, T ) = e−(T −t)r at time t ∈ [0, T ]. Assume that the
company can get bankrupt at a random time t + τ , and default on its final
$1 payment if τ < T − t.
a) Explain why the defaultable bond price Pd (t, T ) can be expressed as

Pd (t, T ) = e−(T −t)r E∗ 1{τ >T −t} . (10.9)


 

b) Assuming that the default time τ is exponentially distributed with pa-


rameter λ > 0, compute the default bond price Pd (t, T ) using (10.9).
c) Find a formula that can estimate the parameter λ from the risk-free rate
r and the market data PM (t, T ) of the defaultable bond price at time
t ∈ [0, T ].


Sources: Moody’s, S&P.

222 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

Exercise 10.3 Consider a (random) default time τ with cumulative distri-


bution function
 w 
t
P(τ > t | Ft ) = exp − λu du , t ⩾ 0,
0

where λt is a (random) default rate process which is adapted to the filtration


(Ft )t∈R+ . Recall that the probability of survival up to time T , given the
information known up to time t, is given by
  w  
T
P(τ > T | Gt ) = 1{τ >t} E∗ exp − λu du Ft ,
t

where Gt = Ft ∨ σ ({τ < u} : 0 ⩽ u ⩽ t), t ∈ R+ , is the filtration de-


fined by adding the default time information to the history (Ft )t∈R+ . In this
framework, the price P (t, T ) of defaultable bond with maturity T , short-term
interest rate rt and (random) default time τ is given by
  w  
T
P (t, T ) = E∗ 1{τ >T } exp − ru du Gt (10.10)
t
  w  
T
= 1{τ >t} E∗ exp − (ru + λu )du Ft .
t

In what follows we assume that the processes (rt )t∈R+ and (λt )t∈R+ are
modeled according to the Vasicek processes

(1)
 drt = −art dt + σdBt ,

(2)
dλt = −bλt dt + ηdBt ,

(1)  (2) 
where Bt t∈R+
and Bt t∈R+
are standard (Ft )t∈R+ -Brownian motions
(1) (2)
with correlation ρ ∈ [−1, 1], and dBt • dBt = ρdt.
a) Give a justification for the fact that
  w  
T
E∗ exp − (ru + λu )du Ft
t

can be written as a function F (t, rt , λt ) of t, rt and λt , t ∈ [0, T ].


b) Show that
 w    w  
t T
t 7−→ exp − (rs + λs )ds E∗ exp − (ru + λu )du Ft
0 t

is an Ft -martingale under P.

" 223

This version: June 9, 2023


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

c) Use the Itô formula with two variables to derive a PDE on R2 for the
function F (t, x, y ).
d) Taking r0 := 0, show that we have
wT wT
(1)
rs ds = C (a, t, T )rt + σ C (a, s, T )dBs ,
t t

and wT wT
(2)
λs ds = C (b, t, T )λt + η C (b, s, T )dBs ,
t t
where
1
C (a, t, T ) = − (e−(T −t)a − 1).
a
e) Show that the random variable
wT wT
rs ds + λs ds
t t

is has a Gaussian distribution, and compute its conditional mean


w wT 
T
E∗ rs ds + λs ds Ft
t t

and variance w wT 
T
Var rs ds + λs ds Ft ,
t t

conditionally to Ft .
f) Compute P (t, T ) from its expression (10.10) as a conditional expectation.
g) Show that the solution F (t, x, y ) to the 2-dimensional PDE of Question (c)
is

F (t, x, y ) = exp (−C (a, t, T )x − C (b, t, T )y )


 2w
η2 w T 2

σ T 2
× exp C (a, s, T )ds + C (b, s, T )ds
2 t 2 t
 wT 
× exp ρση C (a, s, T )C (b, s, T )ds .
t

h) Show that the defaultable bond price P (t, T ) can also be written as
  w  
T
P (t, T ) = eU (t,T ) P(τ > T | Gt )E∗ exp − rs ds Ft ,
t

where
ση
U (t, T ) = ρ (T − t − C (a, t, T ) − C (b, t, T ) + C (a + b, t, T )) .
ab

224 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

i) By partial differentiation of log P (t, T ) with respect to T , compute the


corresponding instantaneous short rate

f (t, T ) = − log P (t, T ).
∂T
j) Show that P(τ > T | Gt ) can be written using an HJM type default rate
as  w 
T
P(τ > T | Gt ) = 1{τ >t} exp − f2 (t, u)du ,
t

where
η2 2
f2 (t, u) = λt e−(u−t)b − C (b, t, u).
2
(1) 
k) Show how the result of Question (h) can be simplified when Bt t∈R+
(2) 
and Bt t∈R are independent.
+

" 225

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Chapter 11
Credit Derivatives

Credit derivatives are option contracts that offer protection against default
risk in a creditor/debtor relationship by transferring risk to a third party. The
credit derivatives considered in this chapter are Collateralized Debt Obliga-
tions (CDOs) and Credit Default Swaps (CDSs) that may be used as a pro-
tection against default risk. We also deal with counterparty default risk via
Credit Valuation Adjustments (CVAs).

11.1 Credit Default Swaps (CDS) . . . . . . . . . . . . . . . . . . . . 227


11.2 Collateralized Debt Obligations (CDO) . . . . . . . . . . 231
11.3 Credit Valuation Adjustment (CVA) . . . . . . . . . . . . 237
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241

11.1 Credit Default Swaps (CDS)


According to the Bank for International Settlements, the outstanding no-
tional amounts of credit default swap (CDS) contracts has decreased from
$61.2 trillion at year-end 2007 to $7.6 trillion at year-end 2019.
We work with a tenor structure {t = Ti < · · · < Tj = T }. Here, τ is a default
time and the filtration Gt := Ft ∨ σ (τ ) contains the additional information
on τ , as defined in (10.4).
Definition 11.1. A Credit Default Swap (CDS) is a contract consisting in
- A premium leg: the buyer is purchasing protection at time t against de-
fault at time Tk , k = i + 1, . . . , j, and has to make a fixed spread payment
Sti,j at times Ti+1 , . . . , Tj between t and T in compensation.
- A protection leg: the seller or issuer of the contract makes a compensa-
tion payment 1 − ξk+1 to the buyer in case default occurs at time Tk+1 ,
k = i, . . . , j − 1, where ξk+1 is the recovery rate.

" 227

This version: June 9, 2023


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

In the sequel, we let


  w  
Tk
P (t, Tk ) := 1{τ >t} E exp − (rs + λs )ds Ft , 0 ⩽ t ⩽ Tk ,
t

denote the default bond price with maturity Tk , k = i, . . . , j − 1, see


Lemma 10.3 and Proposition 10.4.
Proposition 11.2. The discounted value at time t of the premium leg is
given by
V p (t, T ) = Sti,j P (t, Ti , Tj ), (11.1)
where δk := Tk+1 − Tk , k = i, . . . , j − 1, and
j−1
X
P (t, Ti , Tj ) := δk P (t, Tk+1 )
k =i

is the (default) annuity numéraire, cf. e.g. Relation (19.27) in Privault


(2022).
Proof. We have
"j−1  w  #
Tk + 1
Sti,j δk 1{τ >Tk+1 } exp −
X
V p (t, T ) = E rs ds Gt
t
k =i
j−1   w  
Tk + 1
Sti,j δk E 1{τ >Tk+1 } exp −
X
= rs ds Gt
t
k =i
j−1
= Sti,j
X
δk P (t, Tk+1 )
k =i
= Sti,j P (t, Ti , Tj ).


For simplicity, in the above proof we have ignored a possible accrual interest
term over the time interval [Tk , τ ] when τ ∈ [Tk , Tk+1 ] in the above value of
the premium leg. Similarly, we have the following result.
Proposition 11.3. The value at time t of the protection leg is given by
"j−1  w  #
Tk + 1
1(Tk ,Tk+1 ] (τ )(1 − ξk+1 ) exp −
X
V (t, T ) := E
d
rs ds Gt ,
t
k =i
(11.2)
where ξk+1 is the recovery rate associated with the maturity Tk+1 , k =
i, . . . , j − 1.

228 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

In the case of a non-random recovery rate ξk , the value of the protection leg
becomes
j−1   w  
Tk + 1
(1 − ξk+1 )E 1(Tk ,Tk+1 ] (τ ) exp −
X
rs ds Gt .
t
k =i

The spread Sti,j is computed by equating the values of the premium (11.1)
and protection (11.2) legs as V p (t, T ) = V d (t, T ), i.e. from the relation

V p (t, T ) = Sti,j P (t, Ti , Tj )


"j−1  w  #
Tk + 1
1(Tk ,Tk+1 ] (τ )(1 − ξk+1 ) exp −
X
=E rs ds Gt
t
k =i
= V (t, T ),
d

which yields
j−1  w
1
  
Tk+1
Sti,j = 1(Tk ,Tk+1 ] (τ )(1 − ξk+1 ) exp −
X
E rs ds Gt .
P (t, Ti , Tj ) t
k =i
(11.3)
The spread Sti,j , which is quoted in basis points per year and paid at regular
time intervals, gives protection against defaults on payments of $1. For a
notional amount N the premium payment will become N × Sti,j .

Fig. 11.1: CDS price evolution on Credit Suisse, 2023.

In the case of a constant recovery rate ξ, we find


j−1  w
1−ξ
  
Tk + 1
Sti,j = 1(Tk ,Tk+1 ] (τ ) exp −
X
E rs ds Gt ,
P (t, Ti , Tj ) t
k =i

and if τ is constrained to take values in the tenor structure {t = Ti , . . . , Tj },


we get

" 229

This version: June 9, 2023


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

1−ξ h  wτ  i
Sti,j = E 1(t,T ] (τ ) exp − rs ds Gt .
P (t, Ti , Tj ) t

The buyer of a Credit Default Swap (CDS) is purchasing protection at time


t against default at time Tk , k = i + 1, . . . , j, by making a fixed payment
Sti,j (the premium leg) at times Ti+1 , . . . , Tj . On the other hand, the issuer
of the contract makes a payment 1 − ξk+1 to the buyer in case default occurs
at time Tk+1 , k = i, . . . , j − 1.
The contract is priced in terms of the swap rate Sti,j (or spread) computed
by equating the values V d (t, T ) and V p (t, T ) of the protection and premium
legs, and acts as a compensation that makes the deal fair to both parties.
Recall that from (11.3) and Lemma 10.3, we have
j−1  w
1
  
Tk+1
Sti,j = 1(Tk ,Tk+1 ] (τ )(1 − ξk+1 ) exp −
X
E rs ds Gt
P (t, Ti , Tj ) t
k =i
j−1  w
1
  
Tk+1
E (1{Tk <τ } − 1{Tk+1 <τ } )(1 − ξk+1 ) exp −
X
= rs ds Gt
P (t, Ti , Tj ) t
k =i

1{τ >t} j−1   w    w 


X Tk Tk + 1
= E (1 − ξk+1 ) exp − λs ds − exp − λs ds
P (t, Ti , Tj ) t t
k =i
 w  
Tk + 1
× exp − rs ds Ft .
t

Estimating a deterministic failure rate

In case the rates r (s), λ(s) and the recovery rate ξk+1 are deterministic, the
above spread can be written as
j−1  w 
Tk + 1
Sti,j P (t, Ti , Tj ) = 1{τ >t}
X
(1 − ξk ) exp − r (s)ds
t
k =i
  w   w 
Tk Tk + 1
× exp − λs ds − exp − λs ds .
t t

Given that
j−1
X
P (t, Ti , Tj ) = (Tk+1 − Tk )P (t, Tk+1 ), Ti ⩽ t ⩽ Ti+1 ,
k =i

we can write
j−1  wT 
X k +1
Sti,j (Tk+1 − Tk ) exp − (r (s) + λ(s))ds
t
k =i

230 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

j−1  wT   wT   wT 
= 1{τ >t}
X k +1 k k +1
(1 − ξk ) exp − r (s)ds exp − λ(s)ds − exp − λ(s)ds .
t t t
k =i

In particular, when r (t) and λ(t) are written as in (10.7) and assuming that
ξk = ξ, k = i, . . . , j, we get, with t = Ti and writing δk = Tk+1 − Tk ,
k = i, . . . , j − 1,
j−1 k
!
STi,ji
X X
δk exp − δp (rp + λp )
k =i p=i
j−1 k
!
= 1{τ >t} (1 − ξ )
X X
exp eδk λk − 1 .

− δp (rp + λp )
k =i p=i

Assuming further that λk = λ, k = i, . . . , j, we have


j−1 k k
!
i,j
X X X
STi δk exp − δp rp − λ δp (11.4)
k =i p=i p=i
j−1 k k
!
X X X
= (1 − ξ ) e−λδk − 1 exp δp ,

− δp rp − λ
k =i p=i p=i

which can be solved numerically for λ, cf. Sections 4 and 5 of Castellacci


(2008) for the JP Morgan model, and Exercise 11.1. Note that, as λ tends to
∞, the ratio
j−1 k k
!
STi,ji
X X X
δk exp − δp rp − λ δp
k =i p=i p=i
j−1 k k
!
X X X
(1 − ξ ) 1 − e−λδk exp

− δp rp − λ δp
k =i p=i p=i

converges to 0, while it tends to +∞ as λ goes to 0. Therefore, the equation


(11.4) admits a numerical solution.

11.2 Collateralized Debt Obligations (CDO)

Consider a portfolio consisting of N = j − i bonds with default times τk ∈


(Tk , Tk+1 ], k = i, . . . , j − 1, and recovery rates ξk ∈ [0, 1], k = i + 1, . . . , j.
A synthetic CDO is a structured investment product constructed by split-
ting the above portfolio into n ordered tranches numbered i = 1, 2, . . . , n,
where tranche n◦ i represents a percentage pi % of the total portfolio value.
We let

" 231

This version: June 9, 2023


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

αl := p1 + p2 + · · · + pl , l = 1, 2, . . . , n, (11.5)
denote the corresponding cumulative percentages, with α0 = 0 and αn =
p1 + p2 + · · · + pn = 100%.
The tranches are ordered according to increasing default risk, tranche n◦ 1
being the riskiest one (“equity tranche”), and tranche n◦ n being the safest
one (“senior tranche”), while the intermediate tranches are referred to as
“mezzanine tranches”. In practice, losses occur first to the “equity” tranches,
next to the “mezzanine” tranche holders, and finally to “senior” tranches.

AAA

Aaa
Aa
Baa
Equity

Fig. 11.2: A representation of CDO tranches.

CDOs can attract different types of investors.


• Unfunded investors (usually for the higher tranches) are receiving premi-
ums and make payments in case of default.
• Funded investors (usually in the lower tranches) are investing in risky
bonds to receive principal payments at maturity, and they are the first in
line to incur losses.
• A CDO can also be used as a Credit Default Swap (CDS) for the “short
investors” who make premium payments in exchange for credit protection
in case of default.
The market for synthetic CDOs has been significantly reduced since the 2006-
2008 subprime crisis.
Synthetic CDOs are based on N = j − i bonds that can potentially generate
a cumulative loss
j−1
(1 − ξl+1 )1{τl ⩽t} ∈ [0, N ],
X
Lt :=
l =i

at time t ∈ [Ti , Tj ], based on the default time τl and recovery rate ξl+1 of
each involved CDS, k = i, . . . , j − 1, with N = j − i.

232 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

When the first loss occurs, tranche n◦ 1 is the first in line, and it loses the
amount

L1t = Lt 1{Lt ⩽p1 N } + N p1 1{Lt >p1 N } = N min(Lt /N , p1 ).

In case Lt > p1 N , then tranche n◦ 2 takes the remaining loss up to the amount
N p2 , that means the loss L2t of tranche n◦ 2 is

L2t = (Lt − N p1 )1{p1 N <Lt ⩽(p1 +p2 )N } + N p2 1{Lt >(p1 +p2 )N }


= (Lt − N p1 )1{p1 N <Lt ⩽α2 N } + N p2 1{Lt >α2 N }
= (Lt − N p1 )+ 1{Lt ⩽α2 N } + N p2 1{Lt >α2 N }
= min((Lt − N p1 )+ , N p2 )
= Max(min(Lt , N p1 + N p2 ) − N p1 , 0)
= Max(min(Lt , N α2 ) − N p1 , 0).

By induction, the potential loss taken by tranche n◦ i is given by

Lit = (Lt − N αi−1 )1{αi−1 N <Lt ⩽αi N } + N pi 1{Lt >αi N }


= (Lt − N αi−1 )+ 1{Lt ⩽αi N } + N pi 1{Lt >αi N }
= min((Lt − N αi−1 )+ , N pi )
= Max(min(Lt , N αi ) − N αi−1 , 0),

where αi := p1 + p2 + · · · + pi , i = 1, 2, . . . , n.
In the end, tranche n◦ n will take the loss

Lnt = (Lt − N αn−1 )1{αn−1 N <Lt } = (Lt − N αn−1 )+ .

Super senior AAA

Senior Aaa

Mezzanine Aa

Mezzanine Baa
Equity

Fig. 11.3: A Titanic-style representation of cumulative tranche losses.

The CDO tranche n◦ l, l = 1, 2, . . . , n, can be decomposed into:


- A premium leg: the short investor in tranche n◦ l is purchasing protection
at time t against default at time Tk , k = i + 1, . . . , j, by making fixed
" 233

This version: June 9, 2023


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

payments Sti,j at times Ti+1 , . . . , Tj between t and T in compensation.


This premium can also be received by the unfunded investor.
The discounted value at time t of the premium leg for the tranche n◦ l is
"j−1  w  #
p
X Tk+1
Vl (t, T ) = E St δk (N pl − LTk+1 ) exp −
l l
rs ds Gt
t
k =i
j−1   w  
X Tk+1
= Stl δk E (N pl − LlTk+1 ) exp − rs ds Gt (11.6)
,
t
k =i

l = 1, 2, . . . , N , where the premium spread Stl is quoted as a proportion


of the compensation N pl − LlTk+1 and is paid at each time Tk+1 until
k = j − 1 or LTk+1 = 100%, whichever comes first.
- A protection leg: the short investor receives protection against default
from the premium leg, which can also be paid by the unfunded investors.
Noting that at each default time τk ∈ (Tk , Tk+1 ], k = i, . . . , j − 1, the loss
Llt taken by tranche n◦ l jumps by the amount ∆Llτk = Llτk − Ll − , the
τk
value at time t of the protection leg for tranche n◦ l can be written as
"j−1
 w τk
#

1[Ti ,Tj ] (τk )∆Llτk exp −
X
Vld (t, T ) = E ru du Gt
t
k =i
w  ws 
Tj 
=E exp − ru du dLls Gt (11.7)
Ti t
  w   w  
Tj Ti
= E exp − ru du LlTj − exp − ru du LlTi Gt
t t
w  ws 
Tj 
+E rs exp − ru du Lls ds Gt
Ti t
  w   w  ws 
Tj Tj 
= E exp − ru du LlTj Gt + E rs exp − ru du Lls ds Gt ,
t Ti t

l = 1, 2, . . . , n, where we applied integration by parts on [Ti , Tj ] and used


the fact that LTi = 0.
The spread Stl paid by tranche n◦ l is computed by equating the values
Vlp (t, T ) = Vld (t, T ) of the protection and premium legs in (11.6) and (11.7),
which yields
hr rs i
T
E Tij exp − t ru du dLls Gt

l
St = P h  r  i
j−1 Tk + 1
k =i δk E (N pl − LTk+1 ) exp − t
l rs ds Gt

234 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

h  r  i hr rs i
T T
E exp − t j ru du LlTj Gt + E Tij rs exp − t ru du Lls ds Gt

= h  r  i
Pj−1 Tk + 1
k =i δk E (N pl − LTk+1 ) exp − t
l rs ds Gt
⩾ 0,

l = 1, 2, . . . , n.

Expected tranche loss

The expected cumulative loss given the parameter M can be computed by


linearity in the multiple default time model (9.5) of Chapter 9 as
j−1
E (1 − ξl+1 )1{τl ⩽t} | M = m
X
E[Lt | M = m] =
 

l =i
j−1
X
= (1 − ξl+1 )P (τl ⩽ t | M = m)
l =i
 
j−1
X Φ −1 (P(τ
l ⩽ t)) + ak m 
= (1 − ξl+1 )Φ  q ,
l =i 1 − a2k

by (9.5), and the expected cumulative loss can be written as


w∞ 1 w∞ 2
E[Lt ] = E [Lt | M = m] ϕ(m)dm = √ E [Lt | M = m] e−m /2 dm.
−∞ 2π −∞
The situation is different for the expected loss of tranche n◦ k is written as
the expected value

E[Lkt ] = E min((Lt − N αk−1 )+ , N pk ) , k = 1, 2, . . . , n,


 

of the nonlinear function fk (x) := min((x − N αk−1 )+ , N pk ) of Lt , where


αk−1 is defined in (11.5).

" 235

This version: June 9, 2023


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

3
Npi
2.5

f(x) 1.5

0.5

0
0 1 Nαi-1 2 3 4 Nαi-1+Npi 5 6
x

Fig. 11.4: Function fk (x) = min((x − N αk−1 )+ , N pk ).

The expected tranche loss E[Lkt ] n◦ k can be estimated by the Monte Carlo
method when the default times are generated according to (9.8).
In order to compute expected tranche losses we can use the fact that the
cumulative loss Lt is a discrete random variable, with for example
j−1
!
X
P Lt = N − ξk+1 = P(τi ⩽ t, . . . , τj−1 ⩽ t),
k =i

and
P(Lt = 0) = P(τi > t, . . . , τj−1 > t),
which require the knowledge of the joint distribution of the default times
τi , . . . , τj−1 .
If the τk′ s are independent and identically distributed with common cumula-
tive distribution function Fτ and ak = a, ξk = ξ, k = i + 1, . . . , j, then the
cumulative loss Lt has a binomial distribution given M , given by
 
N
P(Lt = (1 − ξ )k | M ) = (1 − P(τ ⩽ T | M ))N −k (P(τ ⩽ T | M ))k
k
N −k   −1 k
Φ (Fτ (T )) − aM Φ (Fτ (T )) − aM
   −1
N
= 1−Φ √ Φ √ ,
k 1 − a2 1 − a2
k = 0, 1, . . . , N . The expected loss of tranche n◦ k can then be expressed as
w∞
E[Lkt ] = E [fk (Lt ) | M = m] ϕ(m)dm
−∞
1 w∞ 2
= √ E [fk (Lt ) | M = m] e−m /2 dm,
2π −∞

k = 1, 2, . . . , n, where E [fk (Lt ) | M = m] is computed either by the Monte


Carlo method, from the distribution of Lt .

236 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

In Vašiček (2002), the tranche loss has been approximated by a Gaussian


random variable for very large portfolios with N → ∞.
The α-percentile loss of the portfolio can be estimated as
 
j−1
X Φ−1 (P(τk ⩽ T )) − ak Φ−1 (α) 
E[Lt | M = m] = (1 − ξk+1 )Φ  q ,
k =i 1 − a2k

where m = Φ−1 (α).


Such (Gaussian) Merton (1974) and Vašiček (2002) type models have been im-
plemented in the Basel II recommandations on Banking Supervision (2005).
Namely in Basel II, banks are expected to hold capital in prevision of unex-
pected losses in a worst case scenario, according to the Internal Ratings-Based
(IRB) formula
   
j−1
X Φ−1 (P(τk ⩽ T )) − ak Φ−1 (α) 
( 1 − ξk + 1 ) Φ
  q − P(τk ⩽ T ) ,
k =i 1 − a2k

with confidence level set at α = 0.999 i.e. m = Φ−1 (0.999) = 3.09, cf.
Relation (2.4) page 10 of Aas (2005). Recall that the function
 
Φ−1 (x) + ak Φ−1 (α) 
x 7−→ Φ  q
1 − a2k

always lies above the graph of x when ak < 0, as in the next figure.

1
Φ ( ( Φ-1(x) - a Φ-1(0.999)))/ (1-a2)1/2)

0.8

0.6

0.4

0.2

0
0 0.2 0.4 0.6 0.8 1
x

Fig. 11.5: Internal Ratings-Based (IRB) formula.

11.3 Credit Valuation Adjustment (CVA)


Credit Valuation Adjustments (CVA) aim at estimating the amount of capi-
tal required in the event of counterparty default, and are specially relevant to
" 237

This version: June 9, 2023


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

the Basel III regulatory framework. Other credit value adjustments (XVA)
include the Funding Valuation Adjustments (FVA), Debit Valuation Adjust-
ments (DVA), Capital Valuation Adjustments (KVA), and Margin Valuation
Adjustments (MVA). The purpose of XVAs is also to take into account the
future value of trades and their associated risks. The real-time estimation of
XVA measures is generally highly demanding from a computational point of
view.

Net Present Value (NPV) of a CDS

As above, we work with a tenor structure {t = Ti < · · · < Tj = T }. Let

Π(Tl , Tj ) := protection_leg − premium_leg


j−1  w 
Tk+1
1(Tk ,Tk+1 ] (τ )(1 − ξk+1 ) exp −
X
= rs ds
t
k =l
j−1  w 
Tk + 1
Sti,j δk 1{τ >Tk+1 } exp −
X
− rs ds
t
k =l
j−1  w 
Tk + 1
1(Tk ,Tk+1 ] (τ ) exp −
X
= (1 − ξ ) rs ds
t
k =l
j−1  w 
Tk + 1
Sti,j δk 1{τ >Tk+1 } exp −
X
− rs ds
t
k =l
j−1   w 
Tk + 1
(1 − ξ )1(Tk ,Tk+1 ] (τ ) exp −
X
= rs ds
t
k =l
 w 
Tk+1
−δk 1{τ >Tk+1 } exp − rs ds
t

denote the difference between the remaining protection and premium legs
from time Tl until time Tj . Note that by definition of the spread Sti,j we have
Π(t, Tj ) = 0, 0 ⩽ t ⩽ Ti .
Definition 11.4. The Net Present Value (NPV) at time Tl of the CDS is
the conditional expected value

NPV(Tl , Tj ) := E Π(Tl , Tj ) | GTl


 

of the difference between the values at time Tl of the remaining protection


and premium legs from time Tl until time Tj , where (Gt )t∈R+ is the filtration
(10.4) enlarged as with the additional information on the default time τ .
The Net Present Value (NPV) at time Tl of the CDS satisfies

238 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

NPV(Tl , Tj ) := E Π(Tl , Tj ) | GTl


 
"j−1  w  #
Tk+1
1(Tk ,Tk+1 ] (τ )(1 − ξk+1 ) exp −
X
=E rs ds GTl (11.8)
t
k =l
"j−1  w  #
Tk + 1
Sti,j δk 1{τ >Tk+1 } exp −
X
−E rs ds GTl
t
k =l
j−1   w   j−1
Tk+1
E 1(Tk ,Tk+1 ] (τ ) exp − Gt − Sti,j
X X
= (1 − ξ ) rs ds δk P (t, Tk+1 )
t
k =l k =l
j−1    w   
Tk + 1
(1 − ξ )E 1(Tk ,Tk+1 ] (τ ) exp − Gt − Sti,j δk P (t, Tk+1 )
X
= rs ds
t
k =l

of the difference between the values at time Tl of the remaining protection


and premium legs from time Tl until time Tj .
In addition to the credit default time τ we introduce a second stopping
time ν ∈ [Tl , Tj ] representing the possible default time of the party providing
the protection leg.
The Net Present Value NPV(ν, Tj ) is estimated when default occurs at
time ν.
i) If NPV(ν, Tj ) > 0 then a payment is due from the party providing the
protection leg, and only a fraction ηNPV(ν, Tj ) of this payment may be
recovered, where η ∈ [0, 1] is the recovery rate of the party providing
protection in the CDS.

ii) On the other hand, if NPV(ν, Tj ) < 0 then the original fee payment
−NPV(ν, Tj ) is still due.
As a consequence, in the event of default at time ν ∈ [Tl , Tj ], the net present
value of the CDS at time ν is

ηNPV(ν, Tj )1{NPV(ν,Tj )>0} + NPV(ν, Tj )1{NPV(ν,Tj )<0}


+ −
= η NPV(ν, Tj ) − NPV(ν, Tj )
+ +
= η NPV(ν, Tj ) − − NPV(ν, Tj )
+ + 
= η NPV(ν, Tj ) + NPV(ν, Tj ) − NPV(ν, Tj )
+
= NPV(ν, Tj ) − (1 − η ) NPV(ν, Tj ) . (11.9)

Credit Valuation Adjustment (CVA)

Under the event of counterparty default at a time ν ∈ [Tl , Tj ], the discounted


payment estimated at time Tl becomes

" 239

This version: June 9, 2023


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

 w 
ν + + 
Π(Tl , ν ) + exp − rs ds η NPV(ν, Tj ) − − NPV(ν, Tj )
Tl
 w 
ν + 
= Π(Tl , ν ) + exp − rs ds NPV(ν, Tj ) − (1 − η ) NPV(ν, Tj )
Tl
 w 
ν +
= Π(Tl , Tj ) − (1 − η ) exp − rs ds NPV(ν, Tj ) ,
Tl

since  w 
ν
Π(Tl , Tj ) = Π(Tl , ν ) + exp − rs ds NPV(ν, Tj ).
Tl

More generally, the total discounted payment due at time Tl under counter-
party risk rewrites as

ΠD (Tl , Tj ) = 1{Tj <ν} Π(Tl , Tj )


  w  
ν + + 
+ 1{Tl <ν ⩽Tj } Π(Tl , ν ) + exp − rs ds η NPV(ν, Tj ) − − NPV(ν, Tj )
Tl

= 1{Tj <ν} Π(Tl , Tj )


  w  
ν +
+ 1{Tl <ν ⩽Tj } Π(Tl , Tj ) − (1 − η ) exp − rs ds NPV(ν, Tj )
Tl
 w 
ν +
= Π(Tl , Tj ) − 1{Tl <ν ⩽Tj } (1 − η ) exp − rs ds NPV(ν, Tj ) , (11.10)
Tl

see Brigo and Chourdakis (2009), Brigo and Masetti (2006). As a consequence
of (11.10), we derive the following result.
Proposition 11.5. The price at time Tl of the payoff ΠD (Tl , Tj ) under
counterparty risk is given by

E ΠD (Tl , Tj ) | FTl = E Π(Tl , Tj ) | FTl


   
  w  
ν +
−(1 − η )E 1{Tl <ν ⩽Tj } exp − rs ds NPV(ν, Tj ) FTl .
Tl

The quantity
  w  
ν +
(1 − η )E 1{Tl <ν ⩽Tj } exp − rs ds NPV(ν, Tj ) FTl
Tl

is called the (positive) Counterparty Risk (CR) Credit Valuation Adjustment


(CVA).

240 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

Exercises

Exercise 11.1 Credit default swaps. Estimate the first default rate λ1 and
the associated default probability in the framework of (11.4), based on CDS
market data, cf. also Castellacci (2008).

Exercise 11.2 We work with a tenor structure {t = Ti < · · · < Tj = T }. Let

j−1   w  
Tk + 1
1(Tk ,Tk+1 ] (τ )(1 − ξk+1 ) exp −
X
E r (s)ds Gt
t
k =i
j−1   w  
Tk+1
E (1{Tk <τ } − 1{Tk+1 <τ } )(1 − ξk+1 ) exp −
X
= r (s)ds Gt
t
k =i
j−1   r r Tk + 1  rT 
Tk k +1
= 1{τ >t} r (s)ds
X
E (1 − ξk+1 ) e− t λs ds − e− t λs ds
e− t Ft
k =i
j−1 r Tk+1  r r Tk+1 
Tk
= 1{τ >t} (1 − ξ ) r (s)ds
X
e− t E e− t λs ds − e− t λs ds
Ft
k =i
j−1
= 1{τ >t} (1 − ξ )
X
P (t, Tk+1 ) (Q(t, Tk ) − Q(t, Tk+1 )) ,
k =i

denote the discounted value at time t of the protection leg, where


 w 
Tk
P (t, Tk ) = exp − r (s)ds = e−(Tk −t)rk , k = i, . . . , j,
t

is a deterministic discount factor, and


  w  
Tk
Q(t, Tk ) = E exp − λs ds Ft
t

is the survival probability. Let


j−1   w  
Tk+1
V p (t, T ) = Sti,j 1{τ >Tk+1 } exp −
X
δk E r (s)ds Gt
t
k =i
j−1   w  
Tk+1
= Sti,j δk E 1{Tk+1 <τ } exp −
X
r (s)ds Gt
t
k =i
j−1   w   w  
Tk+1 Tk + 1
= 1{τ >t} Sti,j
X
δk E exp − λs ds exp − r (s)ds Ft
t t
k =i

" 241

This version: June 9, 2023


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

j−1  w    w  
Tk + 1 Tk + 1
= Sti,j 1{τ >t}
X
δk exp − r (s)ds E exp − λs ds Ft
t t
k =i
j−1
= 1{τ >t} Sti,j
X
δk P (t, Tk+1 )Q(t, Tk+1 ),
k =i

denote the discounted value at time t of the premium leg, where δk := Tk+1 −
Tk , k = i, . . . , j − 1.
a) By equating the protection and premium legs, find the value of Q(t, Ti+1 )
with Q(t, Ti ) = 1, and derive a recurrence relation between Q(t, Tj +1 )
and Q(t, Ti ), . . . , Q(t, Tj ).
b) For a given underlying asset, retrieve the corresponding CDS spreads Sti,j
and discount factors P (t, Ti ), . . . , P (t, Tn ), and estimate the correspond-
ing survival probabilities Q(t, Ti ), . . . , Q(t, Tn ).

242 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Part IV
Appendix
Background on Probability Theory

In this appendix we review a number of basic probabilistic tools that are


needed in option pricing and hedging. We refer to Jacod and Protter (2000),
Devore (2003), Pitman (1999) for additional relevant probability background
material.

12.1 Probability Sample Space and Events . . . . . . . . . . . . 245


12.2 Probability Measures . . . . . . . . . . . . . . . . . . . . . . . . . . . 249
12.3 Conditional Probabilities and Independence . . . . . . 250
12.4 Random Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
12.5 Probability Distributions . . . . . . . . . . . . . . . . . . . . . . . 254
12.6 Expectation of Random Variables . . . . . . . . . . . . . . . 262
12.7 Conditional Expectation . . . . . . . . . . . . . . . . . . . . . . . . 275
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280

12.1 Probability Sample Space and Events


We will need the following notation coming from set theory. Given A and
B to abstract sets, “A ⊂ B” means that A is contained in B, and in this
case, B \ A denotes the set of elements of B which do not belong to A. The
property that the element ω belongs to the set A is denoted by “ω ∈ A”,
and given two sets A and Ω such that A ⊂ Ω, we let Ac = Ω \ A denote
the complement of A in Ω. The finite set made of n elements ω1 , . . . , ωn is
denoted by {ω1 , . . . , ωn }, and we will usually distinguish between the element
ω and its associated singleton set {ω}.
A probability sample space is an abstract set Ω that contains the possible
outcomes of a random experiment.
Examples
i) Coin tossing: Ω = {H, T }.

" 245

This version: June 9, 2023


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

ii) Rolling one die: Ω = {1, 2, 3, 4, 5, 6}.


iii) Picking one card at random in a pack of 52: Ω = {1, 2, 3, . . . , 52}.
iv) An integer-valued random outcome: Ω = N = {0, 1, 2, . . .}.
In this case the outcome ω ∈ N can be the random number of trials
needed until some event occurs.
v) A nonnegative, real-valued outcome: Ω = R+ .
In this case the outcome ω ∈ R+ may represent the (nonnegative) value
of a continuous random time.
vi) A random continuous parameter (such as time, weather, price or wealth,
temperature, ...): Ω = R.
vii) Random choice of a continuous path in the space Ω = C (R+ ) of all
continuous functions on R+ .
In this case, ω ∈ Ω is a function ω : R+ −→ R and a typical example is
the graph t 7−→ ω (t) of a stock price over time.

Product spaces:
Probability sample spaces can be built as product spaces and used for the
modeling of repeated random experiments.

i) Rolling two dice: Ω = {1, 2, 3, 4, 5, 6} × {1, 2, 3, 4, 5, 6}.


In this case a typical element of Ω is written as ω = (k, l ) with k, l ∈
{1, 2, 3, 4, 5, 6}.
ii) A finite number n of real-valued samples: Ω = Rn .
In this case the outcome ω is a vector ω = (x1 , . . . , xn ) ∈ Rn with n
components.
Note that to some extent, the more complex Ω is, the better it fits a practical
and useful situation, e.g. Ω = {H, T } corresponds to a simple coin tossing
experiment while Ω = C (R+ ) the space of continuous functions on R+ can
be applied to the modeling of stock markets. On the other hand, in many
cases and especially in the most complex situations, we will not attempt to
specify Ω explicitly.

Events

An event is a collection of outcomes, which is represented by a subset of Ω. In


what follows we consider collections of events, called σ-algebras (or σ-fields),
according to the following definition.

246 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

Definition 12.6. A collection G of events is a σ-algebra provided that it


satisfies the following conditions:
(i) ∅ ∈ G,
[ all countable sequences (An )n⩾1 such that An ∈ G, n ⩾ 1, we have
(ii) For
An ∈ G,
n⩾1
(iii) A ∈ G =⇒ (Ω \ A) ∈ G,
where Ω \ A := {ω ∈ Ω : ω ∈
/ A}.
Note that Properties (ii) and (iii) above also imply the stability of σ-algebras
under intersections, as
!c
\ [
An = Acn ∈ G, (12.11)
n⩾1 n⩾1

for all countable sequences An ∈ G, n ⩾ 1.


The collection of all events in Ω will often be denoted by F. The empty set
∅ and the full space Ω are considered as events but they are of less importance
because Ω corresponds to “any outcome may occur” while ∅ corresponds to
an absence of outcome, or no experiment.
In the context of stochastic processes, two σ-algebras F and G such that
F ⊂ G will refer to two different amounts of information, the amount of
information associated to F being here lower than the one associated to G.
The formalism of σ-algebras helps in describing events in a short and precise
way.
Examples
i) Let Ω = {1, 2, 3, 4, 5, 6}.
The event A = {2, 4, 6} corresponds to
“the result of the experiment is an even number”.

ii) Taking again Ω = {1, 2, 3, 4, 5, 6},

F := {Ω, ∅, {2, 4, 6}, {1, 3, 5}}

defines a σ-algebra on Ω which corresponds to the knowledge of parity


of an integer picked at random from 1 to 6.
Note that in the set-theoretic notation, an event A is a subset of Ω, i.e.
A ⊂ Ω, while it is an element of F, i.e. A ∈ F. For example, we have
Ω ⊃ {2, 4, 6} ∈ F, while {{2, 4, 6}, {1, 3, 5}} ⊂ F.

" 247

This version: June 9, 2023


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

iii) Taking

G := {Ω, ∅, {2, 4, 6}, {2, 4}, {6}, {1, 2, 3, 4, 5}, {1, 3, 5, 6}, {1, 3, 5}} ⊃ F,

defines a σ-algebra on Ω which is bigger than F and includes the parity


information contained in F, in addition to information on whether the
outcome of the experiment is equal to 6 or not.
iv) Take

Ω = {H, T } × {H, T } = {(H, H ), (H, T ), (T , H ), (T , T )}.

In this case, the collection F of all possible events is given by

F = {∅, {(H, H )}, {(T , T )}, {(H, T )}, {(T , H )}, (12.12)
{(T , T ), (H, H )}, {(H, T ), (T , H )}, {(H, T ), (T , T )},
{(T , H ), (T , T )}, {(H, T ), (H, H )}, {(T , H ), (H, H )},
{(H, H ), (T , T ), (T , H )}, {(H, H ), (T , T ), (H, T )},
{(H, T ), (T , H ), (H, H )}, {(H, T ), (T , H ), (T , T )}, Ω} .

Note that the set F of all events considered in (12.12) above has altogether
 
n
1= event of cardinality 0,
0
 
n
4= events of cardinality 1,
1
 
n
6= events of cardinality 2,
2
 
n
4= events of cardinality 3,
3
 
n
1= event of cardinality 4,
4
with n = 4, for a total of
4  
X 4
16 = 2n = = 1+4+6+4+1
k
k =0

events. The collection of events

G := {∅, {(T , T ), (H, H )}, {(H, T ), (T , H )}, Ω}

defines a sub σ-algebra of F, which corresponds to the restricted information


“the results of two coin tossings are different”.
Exercise: Write down the set of all events on Ω = {H, T }.

248 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

Note also that (H, T ) is different from (T , H ), whereas {(H, T ), (T , H )} is


equal to {(T , H ), (H, T )}.
In addition, we will distinguish between the outcome ω ∈ Ω and its associated
event {ω} ∈ F, which satisfies {ω} ⊂ Ω.

12.2 Probability Measures

Definition 12.7. A probability measure is a mapping P : F −→ [0, 1] that


assigns a probability P(A) ∈ [0, 1] to any event A ∈ F, with the properties
a) P(Ω) = 1, and
 
[ X
b) P  An  = P(An ), whenever Ak ∩ Al = ∅, k ̸= l.
n⩾1 n⩾1

Property (b) above is named the law of total probability. It states in particular
that we have

P ( A1 ∪ · · · ∪ An ) = P ( A1 ) + · · · + P ( An )

when the subsets A1 , . . . , An of Ω are disjoint, and

P(A ∪ B ) = P(A) + P(B ) (12.13)

if A ∩ B = ∅. We also have the complement rule

P ( Ac ) = P ( Ω \ A ) = P ( Ω ) − P ( A ) = 1 − P ( A ) .

When A and B are not necessarily disjoint we can write

P(A ∪ B ) = P(A) + P(B ) − P(A ∩ B ),

which extends to arbitrary families of events (Ai )i∈I indexed by a finite set
I as the inclusion-exclusion principle
!  
|J|+1 
[ X \
P Ai = (−1) P Aj  , (12.14)
i∈I J⊂I j∈J

and   !
(−1)|I|+1 P
\ X [
P Aj  = Ai . (12.15)
j∈J I⊂J i∈I

The triple
(Ω, F, P) (12.16)

" 249

This version: June 9, 2023


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

is called a probability space, and was introduced by A.N. Kolmogorov (1903-


1987). This setting is generally referred to as the Kolmogorov framework.
A property or event is said to hold P-almost surely (also written P-a.s.) if
it holds with probability equal to one.
Example
Take
Ω = (T , T ), (H, H ), (H, T ), (T , H )


and
F = {∅, {(T , T ), (H, H )}, {(H, T ), (T , H )}, Ω} .
The uniform probability measure P on (Ω, F ) is given by setting
1 1
P({(T , T ), (H, H )}) := and P({(H, T ), (T , H )}) := .
2 2
In addition, we have the following convergence properties.

1. Let (An )n∈N be a non-decreasing sequence of events, i.e. An ⊂ An+1 ,


n ⩾ 0. Then we have
!
[
P An = lim P(An ). (12.17)
n→∞
n∈N

2. Let (An )n∈N be a non-increasing sequence of events, i.e. An+1 ⊂ An ,


n ⩾ 0. Then we have
!
\
P An = lim P(An ). (12.18)
n→∞
n∈N

Theorem 12.8. Borel-Cantelli Lemma. Let (An )n⩾1 denote a sequence of


events on (Ω, F, P), such that
X
P(An ) < ∞.
n⩾1

Then we have \ [ 
P Ak = 0,
n⩾1 k⩾n

i.e. the probability that An occurs infinitely many times occur is zero.

12.3 Conditional Probabilities and Independence


We start with an example.
250 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

Consider a population Ω = M ∪ W made of a set M of men and a set W of


women. Here the σ-algebra F = {Ω, ∅, W , M } corresponds to the information
given by gender. After polling the population, e.g. for a market survey, it turns
out that a proportion p ∈ [0, 1] of the population declares to like apples, while
a proportion 1 − p declares to dislike apples. Let A ⊂ Ω denote the subset
of individuals who like apples, while Ac ⊂ Ω denotes the subset individuals
who dislike apples, with

p = P(A) and 1 − p = P ( Ac ) ,

e.g. p = 60% of the population likes apples. It may be interesting to get a


more precise information and to determine
P(A ∩ W )
- the relative proportion of women who like apples, and
P(W )
P(A ∩ M )
- the relative proportion of men who like apples.
P(M )
Here, P(A ∩ W )/P(W ) represents the probability that a randomly chosen
woman in W likes apples, and P(A ∩ M )/P(M ) represents the probability
that a randomly chosen man in M likes apples. Those two ratios are inter-
preted as conditional probabilities, for example P(A ∩ M )/P(M ) denotes
the probability that a given individual likes apples given that he is a man.
For another example, suppose that the population Ω is split as Ω = Y ∪ O
into a set Y of “young” people and another set O of “old” people, and denote
by A ⊂ Ω the set of people who voted for candidate A in an election. Here
it can be of interest to find out the relative proportion

P(Y ∩ A)
P(A | Y ) =
P(Y )

of young people who voted for candidate A.

Definition 12.9. Given any two events A, B ⊂ Ω with P(B ) ̸= 0, we call

P(A ∩ B )
P(A | B ) : =
P(B )

the probability of A given B, or conditionally to B.


Remark 12.10. We note that if P(B ) = 1 we have P(A ∩ B c ) ⩽ P(B c ) = 0,
hence P(A ∩ B c ) = 0, which implies

P(A) = P(A ∩ B ) + P(A ∩ B c ) = P(A ∩ B ),

and P(A | B ) = P(A).


We also recall the following property:

" 251

This version: June 9, 2023


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

! !
[ [
P B∩ An =P ( B ∩ An )
n⩾1 n⩾1
X
= P ( B ∩ An )
n⩾1
X
= P ( B | An ) P ( An )
n⩾1
X
= P ( An | B ) P ( B ) ,
n⩾1

for any family of disjoint events (An )n⩾1 with Ai ∩ Aj = ∅, i ̸= j, and


P(B ) > 0, n ⩾ 1. This also shows that conditional probability measures are
probability measures, in the sense that whenever P(B ) > 0, we have
a) P(Ω | B ) = 1, and
!
[ X
b) P An B = P(An | B ), whenever Ak ∩ Al = ∅, k ̸= l.
n⩾1 n⩾1

[
In particular, if An = Ω, (An )n⩾1 becomes a partition of Ω and we get
n⩾1
the law of total probability
X X X
P(B ) = P ( B ∩ An ) = P ( An | B ) P ( B ) = P ( B | An ) P ( An ) ,
n⩾1 n⩾1 n⩾1
(12.19)
provided that Ai ∩ Aj = ∅, i ̸= j, and P(B ) > 0, n ⩾ 1.
Remark. In general we have
!
[ X
P A Bn ̸= P ( A | Bn ) ,
n⩾1 n⩾1

even when Bk ∩ Bl = ∅, k ̸= l. Indeed, taking for example A = Ω = B1 ∪ B2


with B1 ∩ B2 = ∅ and P(B1 ) = P(B2 ) = 1/2, we have

1 = P(Ω | B1 ∪ B2 ) ̸= P(Ω | B1 ) + P(Ω | B2 ) = 2.

Independent events

Definition 12.11. Two events A and B such that P(A), P(B ) > 0 are said
to be independent if
P(A | B ) = P(A). (12.20)
We note that the independence condition (12.20) is equivalent to

252 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

P(A ∩ B ) = P(A)P(B ).

12.4 Random Variables

A real-valued random variable is a mapping∗

X : Ω −→ R
ω 7−→ X (ω )

from a probability sample space Ω into the state space R. Given

X : Ω −→ R

a random variable and a (measurable)† subset A of R, we denote by {X ∈ A}


the event
{X ∈ A} := {ω ∈ Ω : X (ω ) ∈ A}.
Examples
i) Let Ω := {1, 2, 3, 4, 5, 6} × {1, 2, 3, 4, 5, 6}, and consider the mapping

X : Ω −→ R
(k, l ) 7−→ k + l.

Then X is a random variable giving the sum of the two numbers appear-
ing on each die.
ii) the time needed everyday to travel from home to work or school is a
random variable, as the precise value of this time may change from day
to day under unexpected circumstances.
iii) the price of a risky asset can be modeled using a random variable.

In what follows, we will often use the notion of indicator function 1A of an


event A ⊂ Ω.
Definition 12.12. For any A ⊂ Ω, the indicator function 1A is the random
variable

1A : Ω −→ {0, 1}
ω 7−→ 1A (ω )

defined by

See (MOE and UCLES 2016, page 14) and (MOE and UCLES 2020, page 19).

Measurability of subsets of R refers to Borel measurability, a concept which will not
be defined in this text.

" 253

This version: June 9, 2023


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

1 if ω ∈ A,

1A (ω ) = 0 if ω ∈/ A.
Indicator functions satisfy the property

1A∩B (ω ) = 1A (ω )1B (ω ), (12.21)

since

1A∩B (ω ) = 1 ⇐⇒ ω ∈ A ∩ B
⇐⇒ ω ∈ A and ω ∈ B
⇐⇒ 1A (ω ) = 1 and 1B (ω ) = 1
⇐⇒ 1A (ω )1B (ω ) = 1.
We also have

1A∪B = 1A + 1B − 1A∩B = 1A + 1B − 1A 1B ,
and
1A∪B = 1A + 1B , (12.22)
if A ∩ B = ∅.
For example, if Ω = N and A = {k}, for all l ⩾ 0 we have

 1 if k = l,

1{k} (l) =
0 if k ̸= l.

Given X a random variable, we also let

 1 if X = n,

1{X =n} =
0 if X ̸= n,

and
 1 if X < n,

1{X<n} =
0 if X ⩾ n.

12.5 Probability Distributions


The probability distribution of a random variable X : Ω −→ R is the collection

{P(X ∈ A) : A is a measurable subset of R}.

254 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

As the collection of measurable subsets of R coincides with the σ-algebra


generated by the intervals in R, the distribution of X can be reduced to the
knowledge of the probabilities

{P(a < X ⩽ b) = P(X ⩽ b) − P(X ⩽ a) : a < b ∈ R},

or of the cumulative distribution functions

{P(X ⩽ a) : a ∈ R}, or {P(X ⩾ a) : a ∈ R},

see e.g. Corollary 3.8 in Çınlar (2011).


Two random variables X and Y are said to be independent under the
probability P if their probability distributions satisfy

P(X ∈ A , Y ∈ B ) = P(X ∈ A)P(Y ∈ B )

for all (measurable) subsets A and B of R.

Distributions admitting a density

We say that the distribution of X admits a probability density distribution


function φX : R −→ R+ if, for all a ⩽ b, the probability P(a ⩽ X ⩽ b) can
be written as wb
P(a ⩽ X ⩽ b) = φX (x)dx.
a

0.4
Probability density

0.3

0.2

0.1

0
−4 −3 −2 −1 a 0 1 b 2 3 4

Fig. 12.6: Probability density function φX .


We also say that the distribution of X is absolutely continuous, or that X
is an absolutely continuous random variable. This, however, does not imply
that the density function φX : R −→ R+ is continuous.
In particular, we always have
w∞
φX (x)dx = P(−∞ ⩽ X ⩽ ∞) = 1
−∞

" 255

This version: June 9, 2023


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

for any probability density functions φX : R −→ R+ .


Remark 12.13. Note that if the distribution of X admits a probability den-
sity function φX , then for all a ∈ R we have
wa
P(X = a) = φX (x)dx = 0, (12.23)
a

and this is not a contradiction.


In particular, Remark 12.13 shows that

P(a ⩽ X ⩽ b) = P(X = a) + P(a < X ⩽ b) = P(a < X ⩽ b) = P(a < X < b),

for a ⩽ b. Property (12.23) appears for example in the framework of lottery


games with a large number of participants, in which a given number “a”
selected in advance has a very low (almost zero) probability to be chosen.
The probability density function φX can be recovered from the Cumulative
Distribution Functions (CDFs)
wx
x 7−→ FX (x) := P(X ⩽ x) = φX (s)ds,
−∞

and w∞
x 7−→ 1 − FX (x) = P(X ⩾ x) = φX (s)ds,
x
as
∂FX ∂ wx ∂ w∞
φX (x) = (x) = φX (s)ds = − φX (s)ds, x ∈ R.
∂x ∂x −∞ ∂x x

Examples
i) The uniform distribution on an interval.
The probability density function of the uniform distribution on the in-
terval [a, b], a < b, is given by
1
φ(x) = 1 (x), x ∈ R.
b − a [a,b]
ii) The Gaussian distribution.
The probability density function of the standard normal distribution is
given by
1 2
φ(x) = √ e−x /2 , x ∈ R.

More generally, the probability density function of the Gaussian distri-
bution with mean µ ∈ R and variance σ 2 > 0 is given by

256 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

1 2 / (2σ 2 )
φ(x) : = √ e−(x−µ) , x ∈ R.
2πσ 2

In this case, we write X ≃ N (µ, σ 2 ).


iii) The exponential distribution.
The probability density function of the exponential distribution with
parameter λ > 0 is given by

 λe−λx , x ⩾ 0

φ(x) := λ1[0,∞) (x)e−λx


= (12.24)
0, x < 0.

1.0

1
0.9
0.8

Probability density

0.8
0.7
0.6

0.6
0.5
0.4

0.4
0.3
0.2

0.2
0.1
0.0

0
0 1 2 3 4 5 6 0 1 2 3 4 5 6

(a) Exponential CDF. (b) Exponential PDF.

Fig. 12.7: Exponential CDF and PDF.

We also have
P(X > t) = e−λt , t ⩾ 0. (12.25)

iv) The gamma distribution.


The probability density function of the gamma distribution is given by
 λ
λ
 a xλ−1 e−ax , x ⩾ 0

1[0,∞) (x)xλ−1 e−ax = Γ(λ)
a 
φ(x) : =
Γ (λ) 
0, x < 0,

where a > 0 and λ > 0 are scale and shape parameters, and
w∞
Γ (λ) : = xλ−1 e−x dx, λ > 0,
0

is the gamma function.


v) The Cauchy distribution.
The probability density function of the Cauchy distribution is given by
1
φ(x) : = , x ∈ R.
π ( 1 + x2 )
" 257

This version: June 9, 2023


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

vi) The lognormal distribution.


The probability density function of the lognormal distribution is given
by
 1 −(µ−log x)2 /(2σ 2 )
1  √ e
 , x⩾0
φ(x) := 1[0,∞) (x) √ e−(µ−log x) /(2σ ) = xσ 2π
2 2

xσ 2π 
0, x < 0.

Exercise: For each of the above probability density functions φ, check that
the condition w∞
φ(x)dx = 1
−∞
is satisfied.

Joint densities

Given two absolutely continuous random variables X : Ω −→ R and Y :


Ω −→ R, we can form the R2 -valued random variable (X, Y ) defined by

(X, Y ) : Ω −→ R2
ω 7−→ (X (ω ), Y (ω )).

We say that (X, Y ) admits a joint probability density

φ(X,Y ) : R2 −→ R+

when
w w
P((X, Y ) ∈ A × B ) = P(X ∈ A and Y ∈ B ) = φ(X,Y ) (x, y )dxdy
B A

for all measurable subsets A, B of R, see Figure 12.8.

258 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

0.1

0
-1
0
x
1 1 1.5
-0.5 0 0.5
-1 y

Fig. 12.8: Probability P((X, Y ) ∈ [−0.5, 1] × [−0.5, 1]) computed as a volume integral.

The probability density function φ(X,Y ) can be recovered from the joint cu-
mulative distribution function
wx wy
(x, y ) 7−→ F(X,Y ) (x, y ) := P(X ⩽ x and Y ⩽ y ) = φ(X,Y ) (s, t)dsdt,
−∞ −∞

and
w∞w∞
(x, y ) 7−→ P(X ⩾ x and Y ⩾ y ) = φ(X,Y ) (s, t)dsdt,
x y

as
∂2
φ(X,Y ) (x, y ) = F (x, y ) (12.26)
∂x∂y (X,Y )
∂2 w x w y
= φ (s, t)dsdt (12.27)
∂x∂y −∞ −∞ (X,Y )
∂ 2 w w
∞ ∞
= φ(X,Y ) (s, t)dsdt,
∂x∂y x y
x, y ∈ R.
The probability densities φX : R −→ R+ and φY : R −→ R+ of X : Ω −→ R
and Y : Ω −→ R are called the marginal densities of (X, Y ), and are given
by w∞
φX (x) = φ(X,Y ) (x, y )dy, x ∈ R, (12.28)
−∞
and w∞
φY ( y ) = φ(X,Y ) (x, y )dx, y ∈ R.
−∞
The conditional probability density φX|Y =y : R −→ R+ of X given Y = y is
defined by
φ(X,Y ) (x, y )
φX|Y =y (x) := , x, y ∈ R, (12.29)
φY ( y )

" 259

This version: June 9, 2023


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

provided that φY (y ) > 0. In particular, X and Y are independent if and only


if

φX|Y =y (x) = φX (x), i.e., φ(X,Y ) (x, y ) = φX (x)φY (y ), x, y ∈ R.

Example
If X1 , . . . , Xn are independent exponentially distributed random variables
with parameters λ1 , . . . , λn we have

P(min(X1 , . . . , Xn ) > t) = P(X1 > t, . . . , Xn > t)


= P(X1 > t) · · · P(Xn > t)
= e−(λ1 +···+λn )t , t ⩾ 0, (12.30)

hence min(X1 , . . . , Xn ) is an exponentially distributed random variable with


parameter λ1 + · · · + λn .
From the joint probability density function of (X1 , X2 ) given by

φ(X1 ,X2 ) (x, y ) = φX1 (x)φX2 (y ) = λ1 λ2 e−λ1 x−λ2 y , x, y ⩾ 0,

we can write

P(X1 < X2 ) = P(X1 ⩽ X2 )


w∞ wy
= φ(X1 ,X2 ) (x, y )dxdy
−∞ −∞
w∞wy
= λ1 λ2 e−λ1 x−λ2 y dxdy
0 0
λ1
= , (12.31)
λ1 + λ2
and we note that
w
P(X1 = X2 ) = λ1 λ2 e−λ1 x−λ2 y dxdy = 0.
{(x,y )∈R2+ : x=y}

Discrete distributions

We only consider integer-valued random variables, i.e. the distribution of X


is given by the values of P(X = k ), k ⩾ 0.
Examples

i) The Bernoulli distribution.


We have

P(X = 1) = p and P(X = 0) = 1 − p, (12.32)

260 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

where p ∈ [0, 1] is a parameter.


Note that any Bernoulli random variable X : Ω −→ {0, 1} can be written
as the indicator function
X = 1A
on Ω with A = {X = 1} = {ω ∈ Ω : X (ω ) = 1}.
ii) The binomial distribution.
We have
 
n k
P(X = k ) = p (1 − p)n−k , k = 0, 1, . . . , n,
k

where n ⩾ 1 and p ∈ [0, 1] are parameters and (nk) = n!/(k!(n − k )!),


0 ⩽ k ⩽ n.
iii) The geometric distribution.
In this case, we have

P(X = k ) = (1 − p)pk , k ⩾ 0, (12.33)

where p ∈ (0, 1) is a parameter. For example, if (Xk )k∈N is a sequence of


independent Bernoulli random variables with distribution (12.32), then
the random variable,∗

T0 := inf{k ⩾ 0 : Xk = 0}

can denote the duration of a game until the time that the wealth Xk of a
player reaches 0. The random variable T0 has the geometric distribution
(12.33) with parameter p ∈ (0, 1).
iv) The negative binomial (or Pascal) distribution.
We have
k+r−1
 
P(X = k ) = (1 − p)r pk , k ⩾ 0, (12.34)
r−1

where p ∈ (0, 1) and r ⩾ 1 are parameters. Note that the sum of r ⩾ 1


independent geometric random variables with parameter p has a negative
binomial distribution with parameter (r, p). In particular, the negative
binomial distribution recovers the geometric distribution when r = 1.
v) The Poisson distribution.
We have

The notation “inf” stands for “infimum”, meaning the smallest n ⩾ 0 such that
Xn = 0, if such an n exists.

" 261

This version: June 9, 2023


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

λk −λ
P(X = k ) = e , k ⩾ 0,
k!
where λ > 0 is a parameter.

The probability that a discrete nonnegative random variable X : Ω −→


N ∪ {+∞} is finite is given by
X
P(X < ∞) = P(X = k ), (12.35)
k⩾0

and we have
X
1 = P(X = ∞) + P(X < ∞) = P(X = ∞) + P(X = k ).
k ⩾0

Remark 12.14. The distribution of a discrete random variable cannot admit


a probability density. If this were the case, by Remark 12.13 we would have
P(X = k ) = 0 for all k ⩾ 0 and
X
1 = P(X ∈ R) = P(X ∈ N) = P(X = k ) = 0,
k⩾0

which is a contradiction.
Given two discrete random variables X and Y , the conditional distribution
of X given Y = k is given by

P(X = n and Y = k )
P(X = n | Y = k ) = , n ⩾ 0,
P(Y = k )

provided that P(Y = k ) > 0, k ⩾ 0.

12.6 Expectation of Random Variables


The expectation, or expected value, of a random variable X is the mean, or
average value, of X. In practice, expectations can be even more useful than
probabilities. For example, knowing that a given equipment (such as a bridge)
has a failure probability of 1.78493 out of a billion can be of less practical use
than knowing the expected lifetime (e.g. 200000 years) of that equipment.
For example, the time T (ω ) to travel from home to work/school can be a
random variable with a new outcome and value every day, however we usually
refer to its expectation E[T ] rather than to its sample values that may change
from day to day.

262 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

Expected value of a Bernoulli random variable

Any Bernoulli random variable X : Ω −→ {0, 1} can be written as the


indicator function X := 1A where A is the event A = {X = 1}, and the
parameter p ∈ [0, 1] of X is given by

p = P ( X = 1 ) = P ( A ) = E [ 1A ] = E [ X ] .

The expectation of a Bernoulli random variable with parameter p is defined


as

E [ 1 A ] : = 1 × P ( A ) + 0 × P ( Ac ) = P ( A ) . (12.36)

Expected value of a discrete random variable

Next, let X : Ω −→ N be a discrete random variable. The expectation E[X ]


of X is defined as the sum
X
E[X ] = kP(X = k ), (12.37)
k⩾0

in which the possible values k ⩾ 0 of X are weighted by their probabilities.


More generally we have
X
E[ϕ(X )] = ϕ(k )P(X = k ),
k⩾0

for all sufficiently summable functions ϕ : N −→ R.


The expectation of the indicator function X = 1A = 1{X =1} can be recovered
from (12.37) as

E [ X ] = E [ 1A ] = 0 × P ( Ω \ A ) + 1 × P ( A ) = 0 + P ( A ) = P ( A ) .

Note that the expectation is a linear operation, i.e. we have

E[aX + bY ] = aE[X ] + bE[Y ], a, b ∈ R, (12.38)

provided that
E[|X|] + E[|Y |] < ∞.
Examples
i) Expected value of a Poisson random variable with parameter λ > 0:

" 263

This version: June 9, 2023


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

X X λk X λk
E[X ] = kP(X = k ) = e−λ k = λe−λ = λ. (12.39)
k! k!
k⩾0 k⩾1 k⩾0

ii) Estimating the expected value of a Poisson random variable using R:


Taking λ := 2, we can use the following code:
poisson_samples <- rpois(100000, lambda = 2)
poisson_samples
mean(poisson_samples)

Given X : Ω −→ N ∪ {+∞} a discrete nonnegative random variable X, we


have X
P(X < ∞) = P(X = k ),
k⩾0

and
X
1 = P(X = ∞) + P(X < ∞) = P(X = ∞) + P(X = k ),
k ⩾0

and in general
X
E[X ] = +∞ × P(X = ∞) + kP(X = k ).
k ⩾0

In particular, P(X = ∞) > 0 implies E[X ] = ∞, and the finiteness condition


E[X ] < ∞ implies P(X < ∞) = 1, however the converse is not true. For
example, assume that X has the geometric distribution
1
P(X = k ) : = , k ⩾ 0, (12.40)
2k+1
with parameter p = 1/2, and
X k 1X k 1 1
E[X ] = = = = 1 < ∞.
2k + 1 4 2k−1 4 (1 − 1/2)2
k⩾0 k⩾1

Letting ϕ(X ) := 2X , we have


X 1
P(ϕ(X ) < ∞) = P(X < ∞) = = 1,
2k+1
k ⩾0

and
X X 2k X1
E[ϕ(X )] = ϕ(k )P(X = k ) = = = +∞,
2k + 1 2
k ⩾0 k⩾0 k ⩾0

264 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

hence the expectation E[ϕ(X )] is infinite although ϕ(X ) is finite with prob-
ability one.∗

Conditional expectation
The notion of expectation takes its full meaning under conditioning. For ex-
ample, the expected return of a random asset usually depends on information
such as economic data, location, etc. In this case, replacing the expectation
by a conditional expectation will provide a better estimate of the expected
value.
For instance, life expectancy is a natural example of a conditional expec-
tation since it typically depends on location, gender, and other parameters.
The conditional expectation of a finite discrete random variable X : Ω −→
N given an event A is defined by
X X P(X = k and A)
E[X | A] = kP(X = k | A) = k .
P(A)
k⩾0 k ⩾1

Lemma 12.15. Given an event A such that P(A) > 0, we have


1
E[X | A] = E X 1A . (12.41)
 
P(A)
Proof. The proof is done only for X : Ω −→ N a discrete random vari-
able, however (12.41) is valid for general real-valued random variables. By
Relation (12.21) we have
X
E[X | A] = kP(X = k | A)
k⩾0
1 X 1 X 
kE 1{X =k}∩A

= kP({X = k} ∩ A) =
P(A) P(A)
k⩾0 k ⩾0
 
1 1
kE 1{X =k} 1A = E 1A k 1{X =k} 
X   X
=
P(A) P(A)
k⩾0 k⩾0
1
E 1A X ,
 
=
P(A)

where we used the relation

k 1{X =k}
X
X=
k ⩾0

which holds since X takes only integer values. □



This is the St. Petersburg paradox.

" 265

This version: June 9, 2023


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

Example
i) For example, consider Ω = {1, 3, −1, −2, 5, 7} with the non-uniform
probability measure given by
1 2 1
P({−1}) = P({−2}) = P({1}) = P({3}) = , P({5}) = , P({7}) = ,
7 7 7
and the random variable
X : Ω −→ Z
given by
X (k ) = k, k = 1, 3, −1, −2, 5, 7.
Here, E[X | X > 1] denotes the expected value of X given

A = {X > 1} = {3, 5, 7} ⊂ Ω,

i.e. the mean value of X given that X is strictly positive. This conditional
expectation can be computed as

E[X | X > 1]
= 3 × P(X = 3 | X > 1) + 5 × P(X = 5 | X > 1) + 7 × P(X = 7 | X > 1)
3+2×5+7
=
4
3+5+5+7
=
7 × 4/7
1
E X 1{X>1} ,
 
=
P(X > 1)

where P(X > 1) = 4/7 and the truncated expectation E X 1{X>1} is


 

given by E X 1{X>1} = (3 + 2 × 5 + 7)/7.


 

ii) Estimating a conditional expectation using R:


geo_samples <- rgeom(100000, prob = 1/4)
mean(geo_samples)
mean(geo_samples[geo_samples<10])

Taking p := 3/4, we have


X p
E[X ] = (1 − p) kpk = = 3,
1−p
k⩾1

and
1
E[X | X < 10] = E X 1{X<10}
 
P(X < 10)
9
1 X
= kP(X = k )
P(X < 10)
k =0

266 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

9
1 X
= 9
kpk
k =1
X
pk
k =0
9
p(1 − p) ∂ X k
= p
1 − p ∂p
10
k =0
p(1 − p) ∂ 1 − p10
 
=
1 − p10 ∂p 1−p
p(1 − p10 − 10(1 − p)p9 )
=
(1 − p)(1 − p10 )
≃ 2.4032603455.

If the random variable X : Ω −→ N is independent∗ of the event A, we have

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

and we naturally find


E[X | A] = E[X ]. (12.42)
Taking X = 1A with

1A : Ω −→ {0, 1} 
1 if ω ∈ A,
ω 7−→ 1A :=
0 if ω ∈
/ A,

shows that, in particular,

E [ 1A | A ] = 0 × P ( X = 0 | A ) + 1 × P ( X = 1 | A )
= P(X = 1 | A)
= P(A | A)
= 1.

One can also define the conditional expectation of X given A = {Y = k}, as


X
E[X | Y = k ] = nP(X = n | Y = k ),
n⩾0

where Y : Ω −→ N is a discrete random variable.


Proposition 12.16. Given X a discrete random variable such that E[|X|] <
∞, we have the relation

E[X ] = E[E[X | Y ]], (12.43)



i.e., P({X = k} ∩ A) = P({X = k})P(A) for all k ⩾ 0.

" 267

This version: June 9, 2023


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

which is sometimes referred to as the tower property.


Proof. We have

X
E[E[X | Y ]] = E[X | Y = k ]P(Y = k )
k⩾0
XX
= nP(X = n | Y = k )P(Y = k )
k⩾0 n⩾0
X X
= n P(X = n and Y = k )
n⩾0 k ⩾0
X
= nP(X = n) = E[X ],
n⩾0

where we used the marginal distribution


X
P(X = n) = P(X = n and Y = k ), n ⩾ 0,
k⩾0

that follows from the law of total probability (12.19) with Ak = {Y = k},
k ⩾ 0. □
Taking
k 1A k ,
X
Y =
k ⩾0

with Ak := {Y = k}, k ⩾ 0, from (12.43) we also get the law of total


expectation

E[X ] = E[E[X | Y ]] (12.44)


X
= E[X | Y = k ]P(Y = k )
k ⩾0
X
= E [ X | Ak ] P ( Ak ) .
k ⩾0

Example
Life expectancy in Singapore is E[T ] = 80 years overall, where T denotes
the lifetime of a given individual chosen at random. Let G ∈ {m, w} denote
the gender of that individual. The statistics show that

E[T | G = m] = 78 and E[T | G = w ] = 81.9,

and we have

80 = E[T ]
= E[E[T |G]]
268 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

= P(G = w )E[T | G = w ] + P(G = m)E[T | G = m]


= 81.9 × P(G = w ) + 78 × P(G = m)
= 81.9 × (1 − P(G = m)) + 78 × P(G = m),

showing that

80 = 81.9 × (1 − P(G = m)) + 78 × P(G = m),

i.e.
81.9 − 80 1.9
P(G = m) = = = 0.487.
81.9 − 78 3.9

Variance

The variance of a random variable X is defined by

Var[X ] := E X 2 − (E[X ])2 ,


 

provided that E |X|2 < ∞. If (Xk )k=1,...,n is a sequence of independent


 

random variables, we have


" n  !2  #!2
n
# " n
X X X
Var Xk = E  Xk  − E Xk
k =1 k =1 k =1
n n n n
" # " # " #
X X X X
=E Xk Xl − E Xk E Xl
k =1 l =1 k =1 l =1
n X n n X n
" #
X X
=E Xk Xl − E[Xk ]E[Xl ]
k =1 l =1 k =1 l =1
n
X X n
X X
E Xk2 + E[Xk Xl ] − (E[Xk ])2 − E[Xk ]E[Xl ]
 
=
k =1 1⩽k̸=l⩽n k =1 1⩽k̸=l⩽n
X n
E Xk2 − (E[Xk ])2
  
=
k =1
X n
= Var [Xk ]. (12.45)
k =1

Random sums

In what follows, we consider Y : Ω −→ N an a.s. finite, integer-valued ran-


dom variable, i.e. we have P(Y < ∞) = 1 and P(Y = ∞) = 0. Based on the
tower property of conditional expectations (12.43) or ordinary conditioning,

" 269

This version: June 9, 2023


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

Y
X
the expectation of a random sum Xk , where (Xk )k∈N is a sequence of
k =1
random variables, can be computed from the tower property (12.43) or from
the law of total expectation (12.44) as
Y Y
" # " " ##
X X
E Xk = E E Xk Y
k =1 k =1
Y
" #
X X
= E Xk Y = n P(Y = n)
n⩾0 k =1
n
" #
X X
= E Xk Y = n P(Y = n),
n⩾0 k =1

and if the sequence (Xk )k∈N is (mutually) independent of Y , this yields


Y n
" # " #
X X X
E Xk = E Xk P(Y = n)
k =1 n⩾0 k =1
X n
X
= P(Y = n) E[Xk ].
n⩾0 k =1

Random products

Similarly, for a random product we will have, using the independence of Y


with (Xk )k∈N ,
Y n
" # " #
Y X Y
E Xk = E Xk P(Y = n) (12.46)
k =1 n⩾0 k =1
X n
Y
= P(Y = n) E[Xk ],
n⩾0 k =1

where the last equality requires the (mutual) independence of the random
variables in the sequence (Xk )k⩾1 .

Distributions admitting a density

Given a random variable X whose distribution admits a probability density


φX : R −→ R+ we have
w∞
E[X ] = xφX (x)dx,
−∞

270 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

and more generally,


w∞
E[ϕ(X )] = ϕ(x)φX (x)dx, (12.47)
−∞

for all sufficiently integrable function ϕ on R. For example, if X has a standard


normal distribution we have
w∞ 2 dx
E[ϕ(X )] = ϕ(x)e−x /2 √ .
−∞ 2π
Examples
a) In case X has a Gaussian distribution with mean µ ∈ R and variance
σ 2 > 0, we have
1 w∞ 2 / (2σ 2 )
E[ϕ(X )] = √ ϕ(x)e−(x−µ) dx. (12.48)
2πσ 2 −∞

b) The uniform random variable U on [0, 1] satisfies E[U ] = 1/2 < ∞ and

P(1/U < ∞) = P(U > 0) = P(U ∈ (0, 1]) = 1,

however we have w 1 dx
E[1/U ] = = +∞,
0 x

and P(1/U = +∞) = P(U = 0) = 0.


c) If the random variable X has an exponential distribution with parameter
µ > 0 we have
 µ
w∞  µ − λ < ∞ if µ > λ,

E e eλx e−µx dx =
 λX 

0 
+∞, if µ ⩽ λ.

Exercise: In case X ≃ N (µ, σ 2 ) has a Gaussian distribution with mean µ ∈ R


and variance σ 2 > 0, check that

µ = E[X ] and σ 2 = E X 2 − (E[X ])2 .


 

When (X, Y ) : Ω −→ R2 is a R2 -valued couple of random variables whose


distribution admits a probability density φX,Y : R2 −→ R+ we have
w∞ w∞
E[ϕ(X, Y )] = ϕ(x, y )φX,Y (x, y )dxdy,
−∞ −∞

for all sufficiently integrable function ϕ on R2 .

" 271

This version: June 9, 2023


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

The expectation of an absolutely continuous random variable satisfies the


same linearity property (12.38) as in the discrete case.
The conditional expectation of an absolutely continuous random variable can
be defined as w∞
E[X | Y = y ] = xφX|Y =y (x)dx
−∞

where the conditional probability density φX|Y =y (x) is defined in (12.29),


with the relation
E[X ] = E[E[X | Y ]] (12.49)
which is called the tower property and holds as in the discrete case, since
w∞
E[E[X | Y ]] = E[X | Y = y ]φY (y )dy
−∞
w∞ w∞
= xφX|Y =y (x)φY (y )dxdy
−∞ −∞
w∞ w∞
= x φ(X,Y ) (x, y )dydx
−∞ −∞
w∞
= xφX (x)dx = E[X ],
−∞

where we used Relation (12.28) between the probability density of (X, Y )


and its marginal X.
For example, an exponentially distributed random variable X with prob-
ability density function (12.24) has the expected value
w∞ 1
E[X ] = λ xe−λx dx = .
0 λ

Proposition 12.17. (Fatou’s lemma). Let (Fn )n∈N be a sequence of non-


negative random variable. Then we have

E lim inf Fn ⩽ lim inf E[Fn ].


 
n→∞ n→∞

In particular, Fatou’s lemma shows that if in addition the sequence (Fn )n∈N
converges with probability one and the sequence (E[Fn ])n∈N converges in R
then we have
E lim Fn ⩽ lim E[Fn ].
 
n→∞ n→∞

Moment Generating Functions

Characteristic functions

The characteristic function of a random variable X is the function

ΨX : R −→ C
272 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

defined by
ΨX (t) = E eitX , t ∈ R.
 

The characteristic function ΨX of a random variable X with probability


density function f : R −→ R+ satisfies
w∞
ΨX (t) = eixt φ(x)dx, t ∈ R.
−∞

On the other hand, if X : Ω −→ N is a discrete random variable we have


X
ΨX (t) = eitn P(X = n), t ∈ R.
n⩾0

One of the main applications of characteristic functions is to provide a char-


acterization of probability distributions, as in the following theorem.
Theorem 12.18. Two random variables X : Ω −→ R and Y : Ω −→ R
have same distribution if and only if

ΨX (t) = ΨY (t), t ∈ R.

Theorem 12.18 is used to identify or to determine the probability distribution


of a random variable X, by comparison with the characteristic function ΨY
of a random variable Y whose distribution is known.
The characteristic function of a random vector (X, Y ) is the function
ΨX,Y : R2 −→ C defined by

ΨX,Y (s, t) = E eisX +itY , s, t ∈ R.


 

Theorem 12.19. The random variables X : Ω −→ R and Y : Ω −→ R are


independent if and only if

ΨX,Y (s, t) = ΨX (s)ΨY (t), s, t ∈ R.

A random variable X has a Gaussian distribution with mean µ and variance


σ 2 if and only if its characteristic function satisfies
2 2
E eiαX = eiαµ−α σ /2 , α ∈ R. (12.50)
 

From Theorems 12.18 and 12.19 we deduce the following proposition.


Proposition 12.20. Let X ≃ N (µ, σX2 ) and Y ≃ N (ν, σ 2 ) be independent
Y
Gaussian random variables. Then X + Y also has a Gaussian distribution
2
X + Y ≃ N (µ + ν, σX + σY2 ).

" 273

This version: June 9, 2023


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

Proof. Since X and Y are independent, by Theorem 12.19 the characteristic


function ΨX +Y of X + Y is given by

Φ X +Y (t ) = Φ X (t ) Φ Y (t )
2 2 2 2
= eitµ−t σX /2 eitν−t σY /2
2 2 2
= eit(µ+ν )−t (σX +σY )/2 , t ∈ R,

where we used (12.50). Consequently, the characteristic function of X + Y is


that of a Gaussian random variable with mean µ + ν and variance σX 2 + σ2
Y
and we conclude by Theorem 12.18. □

Moment generating functions

The moment generating function of a random variable X is the function


ΦX : R −→ R defined by

ΦX (t) := E etX ,
 

for t in a neighborhood of 0. In particular, we have


∂n
E[X n ] = ΦX (0), n ⩾ 1,
∂tn
provided that E[|X|n ] < ∞, and
 X tn
ΦX (t) = E etX = E[X n ],

n!
n⩾0

provided that E et|X| < ∞, t ∈ R, and for this reason the moment gen-
 

erating function GX characterizes the moments E[X n ] of X : Ω −→ N,


n ⩾ 0.
The moment generating function ΦX of a random variable X with probability
density function f : R −→ R+ satisfies
w∞
ΦX (t) = ext φ(x)dx, t ∈ R.
−∞

For example, the moment generating functions (MGF) of a Gaussian random


variable X with mean µ and variance σ 2 is given by
2 2
E eαX = eαµ+α σ /2 , α ∈ R. (12.51)
 

Note that in probability, the moment generating function is written as a


bilateral transform defined using an integral from −∞ to +∞.

274 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

12.7 Conditional Expectation

The construction of conditional expectations of the form E[X | Y ] given


above for discrete and absolutely continuous random variables can be gener-
alized to σ-algebras.
Definition 12.21. Given F a σ-algebra on Ω, a random variable X : Ω −→
R is said to be F-measurable if

{X ⩽ x} := {ω ∈ Ω : X (ω ) ⩽ x} ∈ F,

for all x ∈ R.
Intuitively, when X is F-measurable, the knowledge of the values of X de-
pends only on the information contained in F. For example, [ when F =
σ (A1 , . . . , An ) where (An )n⩾1 is a partition of Ω with An = Ω, any
n⩾1
F-measurable random variable X can be written as
n
ck 1Ak (ω ),
X
X (ω ) = ω ∈ Ω,
k =1

for some c1 , . . . , cn ∈ R.
Definition 12.22. Given (Ω, F, P) a probability space we let L2 (Ω, F ) de-
note the space of F-measurable and square-integrable random variables, i.e.

L2 (Ω, F ) := X : Ω −→ R : E |X|2 < ∞ .


  

More generally, for p ⩾ 1 one can define the space Lp (Ω, F ) of F-measurable
and p-integrable random variables as

Lp (Ω, F ) := X : Ω −→ R : E[|X|p ] < ∞ .




We define a inner product ⟨·, ·⟩L2 (Ω,F ) between elements of L2 (Ω, F ), as

⟨X, Y ⟩L2 (Ω,F ) := E[XY ], X, Y ∈ L2 (Ω, F ). (12.52)

This inner product is associated to the norm ∥ · ∥L2 (Ω) by the relation
q   q
∥X∥L2 (Ω) = E X 2 = ⟨X, X⟩L2 (Ω,F ) , X ∈ L2 (Ω, F ).

The norm ∥ · ∥L2 (Ω) also defines the mean-square distance


q 
E (X − Y )2

∥X − Y ∥L2 (Ω) =

" 275

This version: June 9, 2023


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

between random variables X, Y ∈ L2 (Ω, F ), and it induces a notion of or-


thogonality, namely X is orthogonal to Y in L2 (Ω, F ) if and only if

⟨X, Y ⟩L2 (Ω,F ) = 0.

Proposition 12.23. The ordinary expectation E[X ] achieves the minimum


distance
2
X − E[X ] L2 (Ω) = min ∥X − c∥2L2 (Ω) . (12.53)
c∈R
Proof. It suffices to differentiate
∂ 
E (X − c)2 = −2E[X − c] = 0,

∂c
showing that the minimum in (12.53) is reached when E[X − c] = 0, i.e.
c = E[X ]. □
Similarly to Proposition 12.23, the conditional expectation will be defined by
a distance minimizing procedure.
Definition 12.24. Given G ⊂ F a sub σ-algebra of F and X ∈ L2 (Ω, F ),
the conditional expectation of X given G, and denoted

E[X | G ],

is defined as the orthogonal projection of X onto L2 (Ω, G ).

L2 (Ω, F )

L2 (Ω, G )
0 E[X | G ]

As a consequence of the uniqueness of the orthogonal projection onto the


subspace L2 (Ω, G ) of L2 (Ω, F ), the conditional expectation E[X | G ] is char-
acterized by the relation

⟨Y , X − E[X | G ]⟩L2 (Ω,F ) = 0,

which rewrites as
E[Y (X − E[X | G ])] = 0,
i.e.
E[Y X ] = E[Y E[X | G ]],
for all bounded and H-measurable random variables Y , where ⟨·, ·⟩L2 (Ω,F )
denotes the inner product (12.52) in L2 (Ω, F ). The next proposition extends
276 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

Proposition 12.23 as a consequence of Definition 12.24. See Theorem 5.1.4


page 197 of Stroock (2011) for an extension of the construction of conditional
expectation to the space L1 (Ω, F ) of integrable random variable.
Proposition 12.25. The conditional expectation E[X | G ] realizes the min-
imum in mean-square distance between X ∈ L2 (Ω, F ) and L2 (Ω, G ), i.e. we
have
∥X − E[X | G ]∥L2 (Ω) = min ∥X − Y ∥L2 (Ω) . (12.54)
Y ∈L2 (Ω,G )

Proof. This is a consequence of the Pythagorean theorem written as

∥X − Y ∥L2 (Ω) = ∥X − E[X | G ]∥L2 (Ω) + ∥E[X | G ] − Y ∥L2 (Ω) ,

for any Y ∈ L2 (Ω, G ). □


The following proposition will often be used as a characterization of E[X | G ].
Proposition 12.26. Given X ∈ L2 (Ω, F ), Z := E[X | G ] is the unique
random variable Z in L2 (Ω, G ) that satisfies the relation

E[Y X ] = E[Y Z ] (12.55)

for all bounded and G-measurable random variables Y .


We note that taking Y = 1 in (12.55) yields

E[E[X | G ]] = E[X ]. (12.56)

In particular, when G = {∅, Ω} we have E[X | G ] = E[X | {∅, Ω}] and

E[X | {∅, Ω}] = E[E[X | {∅, Ω}]] = E[X ]

because E[X | {∅, Ω}] is in L2 (Ω, {∅, Ω}) and is a.s. constant. In addition,
the conditional expectation operator has the following properties.

i) E[XY | G ] = Y E[X | G ] if Y depends only on the information contained


in G.
Proof. By the characterization (12.55) it suffices to show that

E[H (XY )] = E[H (Y E[X|G ])], (12.57)

for all bounded and G-measurable random variables H, which implies


E[XY | G ] = Y E[X | G ].
Relation (12.57) holds from (12.55) because the product HY is G-
measurable hence Y in (12.55) can be replaced with HY .
ii) E[Y |G ] = Y when Y depends only on the information contained in G.
Proof. This is a consequence of point (i) above by taking X := 1.

" 277

This version: June 9, 2023


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

iii) E[E[X|G ] | H] = E[X|H] if H ⊂ G, called the tower property.


Proof. First, we note that by (12.56), (iii) holds when H = {∅, Ω}. Next,
by the characterization (12.55) it suffices to show that

E[HE[X|G ]] = E[HE[X|H]], (12.58)

for all bounded and H-measurable random variables H, which will imply
(iii) from (12.55).
In order to prove (12.58) we check that by point (i) above and (12.56)
we have

E[HE[X|G ]] = E[E[HX|G ]] = E[HX ]


= E[E[HX|H]] = E[HE[X|H]],

and we conclude by the characterization (12.55).


iv) E[X|G ] = E[X ] when X “does not depend” on the information con-
tained in G or, more precisely stated, when the random variable X is
independent of the σ-algebra G.
Proof. It suffices to note that for all bounded G-measurable Y we have

E[XY ] = E[X ]E[Y ] = E[Y E[X ]],

and we conclude again by (12.55).


v) If Y depends only on G and X is independent of G, then

E[h(X, Y )|G ] = E[h(X, x)]x=Y . (12.59)

Proof. This relation can be proved using the tower property, by noting
that for any bounded K ∈ L2 (Ω, G ) we have

E[KE[h(x, X )]x=Y ] = E[KE[h(x, X ) | G ]x=Y ]


= E[KE[h(Y , X ) | G ]]
= E[E[Kh(Y , X ) | G ]]
= E[Kh(Y , X )],

which yields (12.59) by the characterization (12.55).


The notion of conditional expectation can be extended from square-integrable
random variables in L2 (Ω, F ) to integrable random variables in L1 (Ω, F ),
cf. e.g. Theorem 5.1 in Kallenberg (2002).
Proposition 12.27. When the σ-algebra G := σ (A1 , A2 , . . . , An ) is gener-
ated by n disjoint events A1 , A2 , . . . , An ∈ F, we have

278 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

E [ X 1A k ]
n n
1 A k E [ X | Ak ] = 1A k
X X
E[X | G ] = .
P ( Ak )
k =1 k =1
Proof. It suffices to note that the G-measurable random variables can be
generated by indicators of the form 1Al , and that

E [ X 1A k ] E [ X 1A l ]
n
" #  
E 1Al 1Ak = E 1A l
X
P ( Ak ) P ( Al )
k =1
E [ X 1A l ] 
E 1Al

=
P ( Al )
= E X 1A l , l = 1, 2, . . . , n,
 

showing (12.55). The relation

E[X 1Ak ]
E [ X | Ak ] = , k = 1, 2, . . . , n,
P ( Ak )

follows from Lemma 12.15. □


For example, in case Ω = {a, b, c, d} and G = ∅, Ω, {a, b}, {c}, {d} , we have


E[X | G ] = 1{a,b} E[X | {a, b}] + 1{c} E[X | {c}] + 1{d} E[X | {d}]
E X 1{a,b} E X 1{c} E X 1{d}
     
= 1{a,b} + 1{c} + 1{d} .
P({a, b}) P({c}) P({d})

Regarding conditional probabilities we have similarly, for A ⊂ Ω = {a, b, c, d},

P A ∩ {a, b} P A ∩ {c} P A ∩ {d}


  
P(A | G ) = 1{a,b} + 1{c} + 1{d}
P({a, b}) P({c}) P({d})
= 1{a,b} P(A | {a, b}) + 1{c} P(A | {c}) + 1{d} P(A | {d}).

In particular, if A = {a} ⊂ Ω = {a, b, c, d} we find

P({a} | G ) = 1{a,b} P({a} | {a, b})


P {a} ∩ {a, b}

= 1{a,b}
P({a, b})
P({a})
= 1{a,b} .
P({a, b})

In other words, the probability of getting the outcome a is P({a})/P({a, b})


knowing that the outcome is either a or b, otherwise it is zero.

" 279

This version: June 9, 2023


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

Exercises

Exercise A.1 Let X denote a Poisson random variable with parameter


λ > 0.
a) Compute the expected value E[X ] of X.
b) Compute the second moment E[X 2 ] and variance Var[X ] of X.

Exercise A.2 Let X denote a centered Gaussian random variable with


variance η 2 , η > 0. Show that the probability P (eX > c) is given by

P eX > c = Φ(−(log c)/η ),




where log = ln denotes the natural logarithm and


1 w x −y2 /2
Φ (x) = √ e dy, x ∈ R,
2π −∞
denotes the Gaussian cumulative distribution function.

Exercise A.3 Let X ≃ N (µ, σ 2 ) be a Gaussian random variable with pa-


rameters µ ∈ R and σ > 0, and probability density function
1 2 / (2σ 2 )
φ(x) : = √ e−(x−µ) , x ∈ R.
2πσ 2
a) Confirm that φ ⩾ 0 is indeed a probability density function, i.e., show
that w∞
1 2 2
√ e−(x−µ) /(2σ ) dx = 1.
2πσ 2 −∞
b) Write down E[X ] as an integral, and show that

µ = E[X ].

c) Write down E[X 2 ] as an integral, and show that

σ 2 = E[(X − E[X ])2 ].

d) Write down E[eX ] as an integral and prove (12.51), i.e. show that
2 /2
E[eX ] = eµ+σ .

Exercise A.4 Let X ≃ N (0, σ 2 ) be a centered Gaussian random variable


with variance σ 2 > 0 and probability density function

280 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

1 2 / (2σ 2 )
φ(x) : = √ e−(x−µ) , x ∈ R.
2πσ 2
a) Consider the function x 7→ x+ from R to R+ , defined as

 x if x ⩾ 0,

x+ =
0 if x ⩽ 0.

Compute E[X + ] as an integral.


b) Consider the function x 7→ (x − K )+ from R to R+ , defined as

 x − K if x ⩾ K,

+
(x − K ) =
0 if x ⩽ K,

where K ∈ R. Compute E[(X − K )+ ] as an integral using the cumulative


distribution function of the standard normal distribution
wx 2 dy
Φ (x) : = e−y /2 √ , x ∈ R.
−∞ 2π

c) Consider the function x 7→ (K − x)+ from R to R+ , defined as

 K − x if x ⩽ K,

+
(K − x) =
0 if x ⩾ K,

where K ∈ R. Compute E[(K − X )+ ] using the cumulative distribution


function Φ.

Exercise A.5 Let X ≃ N (0, v 2 ) be a centered Gaussian random variable


with variance v 2 > 0.
a) Compute
1 w∞
E eσX 1[K,∞) (xeσX ) = √
2 2
eσy−y /(2v ) dy.
 
2πv 2 σ−1 log(K/x)
Hint. Use the completion of square identity

y2 v 2 σ 2  y vσ 2
σy − = − − .
v2 4 v 2
b) Compute
1 w∞ 2 / (2v 2 )
E[(em+X − K )+ ] = √ (em+x − K )+ e−x dx.
2πv 2 −∞

" 281

This version: June 9, 2023


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

Chapter 1

Exercise 1.1 According to Definition 1.1, we need to check the following five
properties of Brownian motion:
(i) starts at 0 at time 0,
(ii) independence of increments,
(iii) almost sure continuity of trajectories,
(iv ) stationarity of the increments,
(v ) Gaussianity of increments.
Checking conditions (i) to (iv ) does not pose any particular problem since
the time changes t 7→ c + t and t 7→ t/c2 are deterministic and continuous.
Concerning (v ), Bc+t − Bc clearly has a centered Gaussian distribution with
variance t, and the same property holds for cBt/c2 , since

Var [cBt/c2 ] = c2 Var [Bt/c2 ] = c2 t/c2 = t, t ⩾ 0.

Exercise 1.2 The solution to (1.12) is given by


2 /2)t
St = S0 eσBt +(µ−σ , t ⩾ 0.

The next code can be used to generate Figure 1.22.

N=1000; t <- 0:N; dt <- 1.0/N; nsim <- 10; sigma=0.6; mu=0.001
Z <- c(rnorm(n = N, sd = sqrt(dt)));
plot(t*dt, exp(mu*t), xlab = "time", ylab = "Geometric Brownian motion", type = "l", ylim =
c(0, 4), col = 1,lwd=3)
lines(t*dt, exp(sigma*c(0,cumsum(Z))+mu*t-sigma*sigma*t*dt/2),xlab = "time",type =
"l",ylim = c(0, 4), col = 4)

" 283

This version: June 9, 2023


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

Chapter 2
Exercise 2.1
a) i) By simulation. With an MA(1) time series constructed by hand:

library(zoo)
N=10000;Zn<-zoo(rnorm(N,0,1))
Xn<-Zn+2*lag(Zn,-1, na.pad = TRUE);Xn<-Xn[-1]
k=0;cov(Xn[1:(length(Xn)-k)],lag(Xn,k))

With an MA(1) time series constructed using arima.sim:

n=2000;a=2;
Xn<-arima.sim(model=list(ma=c(a)),n.start=100,n)
x=seq(100,100+n-1)
plot(x,Xn,pch=19, ylab="X", xlab="n", main = 'MA(1) Samples',col='blue')
lines(x,Xn,col='blue')
Xn<-zoo(Xn)
k=1;cov(Xn[1:(length(Xn)-k)],lag(Xn,k))

Using the command ccf to compute the autocovariance empirically,


we find:
ccf(Xn,Xn,lag = 5, type="covariance", plot=T, lwd=2, col='blue', axes=FALSE,
ylim=c(-1-a**2,1+a**2), main="")
axis(side = 1, at = seq(-5,5,1))
axis(side = 2, at = c(-1-a**2,-a,0,a,1+a**2),
labels=c(expression(paste("-1-|a|"^"2")), "a",0,"a",
expression(paste("1+|a|"^"2"))))

ii) By calculation (expected answer). We have

ρ(0) = Cov(Xn , Xn )
= Var[Xn ]
= E[Xn2 ]
= E[(Zn − aZn−1 )2 ]
= E[Zn2 − 2aZn−1 Zn + a2 Zn−1
2
]
= E[Zn2 ] − 2aE[Zn−1 Zn ] + a2 E[Zn−1
2
]
= 1 − 2aE[Zn−1 ]E[Zn ] + a2
= 1 + a2 ,

284 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

and

ρ(1) = Cov(Xn , Xn+1 )


= Cov(Zn + aZn−1 , Zn+1 + aZn )
= Cov(Zn , Zn+1 ) + a Cov(Zn−1 , Zn+1 ) + a Cov(Zn−1 , Zn ) + a2 Cov(Zn−1 , Zn )
= Cov(Zn , Zn+1 ) + a Cov(Zn−1 , Zn+1 ) + a Cov(Zn , Zn ) + a2 Cov(Zn−1 , Zn )
= a Var[Zn ]
= a,

and for k ⩾ 2,

ρ(k ) = Cov(Xn , Xn+k )


= Cov(Zn + aZn−1 , Zn+k + aZn+k−1 )
= Cov(Zn , Zn+k ) + a Cov(Zn−1 , Zn+k )
+a Cov(Zn , Zn+k−1 ) + a2 Cov(Zn−1 , Zn+k−1 )
= 0,

since n < n + k − 1. By symmetry, we have ρ(k ) = ρ(−k ) for k ⩽ 0.


b) As the autocovariance Cov(Xn , Xn+k ) depends only of |k| and not on n
and E[Xn ] = 0, n ⩾ 1, the time series (Xn )n⩾1 is weakly stationary, see
Definition 2.11.

Exercise 2.2
a) We rewrite the equation defining (Xn )n⩾1 as

Xn = Zn + LXn = Zn + ϕ(L)Xn , n ⩾ 1.

where L is the lag operator LXn = Xn−1 and ϕ(L) = L. Taking ϕ(z ) := z,
by Theorem 2.12 we need to check whether the solutions of the equation
ϕ(z ) = 1 lie on the complet unit circle. As ϕ(z ) = 1 admits the unique
solution z = 1 which lies on the complet unit circle, we conclude that the
AR(1) time series (Xn )n⩾1 is not weakly stationary.
b) As in part (a), we rewrite the AR(2) equation for (Yn )n⩾1 as

Yn = Zn + 0.75 × LYn − 0.125 × L2 Yn = Zn + ϕ(L)Yn , n ⩾ 2.

with ϕ(L) = 0.75 × L − 0.125 × L2 . The equation ϕ(z ) = 1 with ϕ(z ) =


0.75z − 0.125z 2 reads z 2 − 6z + 8 = (z − 2)(z − 4) = 0. This equation has
two solutions z = 2, 4 which lie outside the complex unit circle, hence by
Theorem 2.12 the AR(2) time series (Yn )n⩾2 is weakly stationary.

Exercise 2.3

" 285

This version: June 9, 2023


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

a) We have

E[Xn+1 ] = E Zn+1 + αXn


 

= E[Zn+1 ] + αE Xn
 

= αE Xn , n ⩾ 0,
 

hence we have E[Xn ] = 0 for all n ⩾ 0.


b) We have

Cov(Xn+k+1 , Xn ) = E[Xn+k+1 Xn ] − E[Xn+k+1 ]E[Xn ]


= E[Xn+k+1 Xn ]
= E[(Zn+k+1 + αXn+k )Xn ]
= E[Zn+k+1 Xn + αXn+k Xn ]
= E[Zn+k+1 Xn ] + E[αXn+k Xn ]
= E[Zn+k+1 ]E[Xn ] + αE[Xn+k Xn ]
= αE[Xn+k Xn ]
= α(E[Xn+k Xn ] − E[Xn+k ]E[Xn ])
= α Cov(Xn+k , Xn ), n ⩾ 0,

hence we find

Cov(Xn+k , Xn ) = αk Cov(Xn , Xn ) = αk Var[Xn ], k, n ⩾ 0.

c) We have

Var[Xn+1 ] = E[Xn2+1 ]
= E[(Zn+1 + αXn )2 ]
= E[Zn2+1 + 2αZn+1 Xn + α2 Xn2 ]
= E[Zn2+1 ] + 2αE[Zn+1 Xn ] + α2 E[Xn2 ]
= 1 + 2αE[Zn+1 ]E[Xn ] + α2 E[Xn2 ]
= 1 + α2 E[Xn2 ],

hence

E[Xn2 ] = 1 + α2 + · · · + α2n
Xn
= α2k
k =0
2n+2
 1−α

, α ̸= ±1,

1 − α2

=

 n + 1,

α = ±1, n ⩾ 0.

286 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

d) We check that the solution of ϕ(z ) := αz is z = 1/α, hence by Theo-


rem 2.12 there exists an AR(1) solution of (2.25) which is weakly station-
ary when α ̸= ±1. However, the present time series (Xn )n⩾0 started at
X0 = 0 is not weakly stationary because Cov(Xn , Xn ) = E[Xn2 ] is not
constant in n ⩾ 0.

Exercise 2.4
a) We have

Var[Xn ] = Var[Zn−1 − Zn−2 + αZn−3 ]


= Var[Zn−1 ] + Var[−Zn−2 ] + Var[αZn−3 ]
= Var[Zn−1 ] + Var[Zn−2 ] + α2 Var[Zn−3 ]
= 2 + α2 .

Next, since using the linearity relation

Cov(X + Y , Z ) = Cov(X, Z ) + Cov(Y , Z )

and the fact that Cov(X, Z ) = 0 when X and Z are independent random
variables, we have

Cov(Xn+1 , Xn ) = Cov(Zn − Zn−1 + αZn−2 , Zn−1 − Zn−2 + αZn−3 )


= Cov(Zn − Zn−1 + αZn−2 , Zn−1 )
+ Cov(Zn − Zn−1 + αZn−2 , −Zn−2 )
+ Cov(Zn − Zn−1 + αZn−2 , αZn−3 )
= Cov(−Zn−1 , Zn−1 ) + Cov(αZn−2 , −Zn−2 )
= − Cov(Zn−1 , Zn−1 ) − α Cov(Zn−2 , Zn−2 )
= −α − 1,

and

Cov(Xn+2 , Xn ) = Cov(Zn+2 − Zn + αZn−1 , Zn−1 − Zn−2 + αZn−3 )


= Cov(Zn+2 − Zn + αZn−1 , Zn−1 )
+ Cov(Zn+2 − Zn + αZn−1 , −Zn−2 )
+ Cov(Zn+2 − Zn + αZn−1 , αZn−3 )
= Cov(αZn−1 , Zn−1 )
= α Cov(Zn−1 , Zn−1 )
= α,

and

Cov(Xn+k , Xn ) = Cov(Zn+k−1 − Zn+k−2 + αZn+k−3 , Zn−1 − Zn−2 + αZn−3 )

" 287

This version: June 9, 2023


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

= Cov(Zn+k−1 − Zn+k−2 + αZn+k−3 , Zn−1 )


+ Cov(Zn+k−1 − Zn+k−2 + αZn+k−3 , −Zn−2 )
+ Cov(Zn+k−1 − Zn+k−2 + αZn+k−3 , αZn−3 )
=0

for k ⩾ 3.
b) Since the white noise sequence (Zn )n∈Z is made of independent identically
distributed random variables, we have the identity in distribution
d
Xn = Zn−1 − Zn−2 + αZn−3 ≃ Zn − Zn−1 + αZn−2 , n ⩾ 2,

which shows that (Xn )n⩾3 has the same distribution as an MA(2) time
series the form
Yn = Zn + β1 Zn−1 + β2 Zn−2 ,
with β1 = −1 and β1 = α.

Exercise 2.5
a) We have

∇Xn = Xn − Xn−1
= Zn + α1 Xn−1 − Zn−1 − α1 Xn−2
= Zn − Zn−1 + α1 ∇Xn−1 , n ⩾ 2,

hence (∇Xn )n⩾2 forms an ARMA(1, 1) time series.


b) We have

∇2 Xn = ∇Xn − ∇Xn−1
= Xn − Xn−1 − (Xn−1 − Xn−2 )
= Xn − 2Xn−1 + Xn−2
= Zn + α1 Xn−1 − 2Zn−1 − 2α1 Xn−2 + Zn−2 + α1 Xn−3
= Zn − 2Zn−1 + Zn−2 + α1 ∇2 Xn−1 , n ⩾ 3,

which forms an ARMA(1, 2) time series.

Exercise 2.6
a) We have
n n
!
∂ X (2) ( 1 ) 2
X (2) (1) 
rk − a − brk = −2 − an + rk − brk
∂a
k =1 k =1
n n
(2) (1)
X X
= 2an − 2 rk + 2b rk ,
k =1 k =1

288 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

and
n n
∂ X (2) ( 1 ) 2
X (1) (2) (1) 
rk − a − brk =2 rk − a + rk − brk
∂b
k =1 k =1
n n
!
X (1) (2) (1) 1 X (2) (1) 
=2 rk rk − brk − rl − brl
n
k =1 l =1
n n n n
!
X (1) (2) 2 X (1) (2) X (1) 1 X (1) (1)
=2 rk rk − rk rl − 2b (rk )2 − rk rl .
n n
k =1 k,l=1 k =1 k,l=1

b) In order to minimize the residual (2.26) over a and b we equate the above
derivatives to zero, which yields the equations
n n n
∂ X (2) ( 1 ) 2
X (2)
X (1)
rk − a − brk |a=â, b=b̂
= 2b
an − 2 rk + 2bb rk =0
∂a
k =1 k =1 k =1

and
n
∂ X (2) ( 1 ) 2
rk − a − brk |a=â, b=b̂
∂b
k =1
n n n n
!
X (1) (2) 2 X (1) (2)
X (1) 1 X (1) (1)
=2 rk rk − rk rl − 2bb (rk )2 − rk rl
n n
k =1 k,l=1 k =1 k,l=1
= 0.

This leads to estimators b


a, bb of the parameters a and b respectively as the
(1)
empirical mean and covariance of (rk )k=1,2,...,n , i.e.
 n
1 X (2) b (1) 
= rk − brk ,


ba

 n
k =1






and






n n n n n
1 X (1) (2)
! !
 X (1) (2) X (1) 1 X (1) (2) 1 X (2)

 rk rk − r k r l rk − rl rk − rl
n

 n n
bb = k=1 k,l=0

= k =1 l =0 l =0
.



n n 2
1 X (1) (1) n n
 !

 X (1)
2 X (1) 1 X (1)
( r ) − r r

rk − rk

 k n k l
n


k =1 k,l=0 k =1 k =1

Exercise 2.7 Since the p-value = 0.02377 is lower than the 5% confidence
level, we can reject the nonstationarity (null) hypothesis H0 at that level.

" 289

This version: June 9, 2023


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

Exercise 2.8
a) We consider the equation

φ(z ) = α1 z + α2 z 2 = 1,

i.e.
α2 z 2 + α1 z − 1 = 0,
with solutions
 1

q
−α1 ± α12 + 4α2 −a ± a2 + 8a2 −a ± 3a


2a
z± = = = =
2α2 4a2 4a 2  1
 − ,
a
hence the time series (Xn )n⩾1 is stationary for a ∈
/ {1/2, 1}.
b) We have

E[Xn ] = E[Zn + α1 Xn−1 + α2 Xn−2 ]


= E[Zn ] + α1 E[Xn−1 ] + α2 E[Xn−2 ]
= α1 E[Xn−1 ] + α2 E[Xn−2 ]
= α1 E[Xn ] + α2 E[Xn ],

hence
(1 − α1 − α2 )E[Xn ] = 0,
which implies E[Xn ] = 0, n ∈ Z, since 1 − α1 − α2 ̸= 0.
c) We have

Cov(Xn , Zn ) = Cov(Zn + α1 Xn−1 + α2 Xn−2 , Zn )


= Cov(Zn , Zn ) + α1 Cov(Zn , Xn−1 ) + α2 Cov(Zn , Xn−2 )
= Cov(Zn , Zn )
= σ2 .

d) We have

Cov(Xn+1 , Xn ) = Cov(Zn+1 + α1 Xn + α2 Xn−1 , Xn )


= Cov(Zn+1 , Xn ) + α1 Cov(Xn , Xn ) + α2 Cov(Xn−1 , Xn ),
= 16α1 + α2 Cov(Xn−1 , Xn )
1
= 4 + Cov(Xn−1 , Xn ),
2
hence
Cov(Xn+1 , Xn ) = 8, n ∈ Z.

290 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

Chapter 3
Exercise 3.1
a) Since Z1 + Z2 + · · · + Zn has the centered Gaussian N (0, nσ 2 ) distribution
with variance nσ 2 , we have
N
!
X X
P(Y ⩾ y ) = P Zk ⩾ y N = n P ( N = n )
n⩾1 k =1
n
!!
X X
= 1−P Zk < y N =n P(N = n)
n⩾1 k =1
n
!!
X X
= 1−P Zk ⩽ y N =n P(N = n)
n⩾1 k =1
X 
y

= 1−Φ √ P(N = n)
n⩾1 nσ 2
X λn y
 
= e−λ Φ −√ , y > 0.
n! nσ 2
n⩾1

b) Since E[Zk ] = 0 for all k ⩾ 1, we have


N
" #
X X
E[Y ] = E Zk N = n P(N = n)
n⩾1 k =1
n
" #
X X
= E Zk N = n P(N = n)
n⩾1 k =1
X n
X
= P(N = n) E [ Zk | N = n ]
n⩾1 k =1
X X n
= P(N = n) E [ Zk ]
n⩾1 k =1
= 0,

as in (3.11).

Exercise 3.2 By (3.16), we have

λ λwy
Φ′ (y ) = Φ (y ) − Φ(y − z )dF (z )
c c 0
λ w
λ y
= Φ (y ) − Φ(y − z )e−z/µ dz
c µc 0

" 291

This version: June 9, 2023


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

λ λ wy
= Φ (y ) − Φ(z )e−(y−z )/µ dz,
c µc 0
hence
λ ′ λ λ wy
Φ′′ (y ) = Φ (y ) − Φ (y ) + Φ(z )e−(y−z )/µ dz
c µc µ2 c 0
1 λ
 
λ λ
= Φ′ (y ) − Φ (y ) + Φ (y ) − Φ′ (y )
c µc µ c
λ 1
 
= − Φ′ (y ),
c µ

hence
λµ (λ/c−1/µ)y
e
Φ (y ) = 1 − ,
c
given the boundary conditions Φ(∞) = 1 and Φ(0) = 1 − λµ/c, cf. (3.18).
We conclude that
λµ (λ/c−1/µ)y
Ψ (y ) = e , y ⩾ 0,
c
provided that c < λµ.

Exercise 3.3
a) We have

E[RT ] = E[R0 + µT − CNT ]


= E[R0 ] + E[µT ] − E[CNT ]
= R0 + µT − CE[NT ]
= R0 + µT − CλT
= R0 + (µ − λC )T ,

and similarly

Var[RT ] = Var[µT − CNT ] = Var[−CNT ] = C 2 Var[NT ] = λC 2 T .

b) We find

P(RT < 0) = P(R0 + µT − CNT < 0)


= P(NT > (R0 + µT )/C )
X
= P(NT = k )
k>(R0 +µT )/C
X (λT )k
= e−λT .
k!
k>(R0 +µT )/C

292 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

Exercise 3.4
a) We have E[S (T )] = λT E[Z ] and Var[S (T )] = λT E[Z 2 ].
b) We have

Var[x + f (T ) − S (T )]
P(x + f (T ) − S (T ) < 0) ⩽
(E[x + f (T ) − S (T )])2
Var[S (T )]
=
(x + f (T ) − E[S (T )])2
λT E[Z12 ]
= .
(x + f (T ) − λT E[Z1 ])2

Chapter 4
Exercise 4.1
a) Taking (U , V ) = (U , U ), we have

P(U ⩽ u and V ⩽ v ) = P(U ⩽ u and U ⩽ v )


= P(U ⩽ min(u, v ))
= min(u, v )
= CM (u, v ), u, v ∈ [0, 1].

b) Taking (U , V ) = (U , 1 − U ), we have

P(U ⩽ u and V ⩽ v ) = P(U ⩽ u and 1 − U ⩽ v )


= P(U ⩽ u and U ⩾ 1 − v )
= P(1 − v ⩽ U ⩽ u)
= 1{0⩽1−v⩽u⩽1} P(1 − v ⩽ U ⩽ u)
= 1{0⩽u+v−1⩽1} (u − (1 − v ))
= (u + v − 1) + ,

u, v ∈ [0, 1].
c) We have

C (u, v ) = P(U ⩽ u and V ⩽ v ) ⩽ P(U ⩽ u and V ⩾ 1) ⩽ P(U ⩽ u) = u,

u, v ∈ [0, 1], and similarly we find C (u, v ) ⩽ P(U ⩽ v ) = v for all


u, v ∈ [0, 1], hence we conclude to (4.7).
d) For fixed v ∈ [0, 1] we have

∂C C (u + ε, v ) − C (u, v )
(u, v ) = lim
∂u ε→0 ε

" 293

This version: June 9, 2023


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

P(U ⩽ u + ε and V ⩽ v ) − P(U ⩽ u and V ⩽ v )


= lim
ε→0 ε
P(u ⩽ U ⩽ u + ε and V ⩽ v )
= lim
ε→0 P (u ⩽ U ⩽ u + ε)
= lim P(V ⩽ v | u ⩽ U ⩽ u + ε)
ε→0
= P(V ⩽ v | U = u)
⩽ 1,

u, v ∈ [0, 1], hence

∂C
h′ (u) = (u, v ) − 1 = P(V ⩽ v | U = u) − 1 ⩽ 0,
∂u
u, v ∈ [0, 1], and since h(1) = C (1, v ) − v = P(V ⩽ v ) − v = 0, v ∈ [0, 1]
we conclude that h(u) ⩾ 0, u ∈ [0, 1], which shows (4.8).

Exercise 4.2 When ρ = 1, we have

P(X = 1 and Y = 1) = pX pY + pX pY (1 − pX )(1 − pY ),


 p





 P(X = 0 and Y = 1) = (1 − pX )pY − pX pY (1 − pX )(1 − pY ) ⩾ 0,

 p

P(X = 1 and Y = 0) = pX (1 − pY ) − pX pY (1 − pX )(1 − pY ) ⩾ 0,


 p







P(X = 0 and Y = 0) = (1 − pX )(1 − pY ) + pX pY (1 − pX )(1 − pY ),
 p

hence
 (1 − pX )pY ⩾ pX pY (1 − pX )(1 − pY ),
 p

pX (1 − pY ) ⩾ pX pY (1 − pX )(1 − pY ),
 p

hence

(1 − pX )pY ⩾ pX (1 − pY ) and pX (1 − pY ) ⩾ pY (1 − pX ),

showing that (1 − pX )pY = pX (1 − pY ), which implies pX = pY , and

P(X = 1 and Y = 1) = p2X + pX (1 − pX ) = pX = pY ,








 P(X = 0 and Y = 1) = 0,


P(X = 1 and Y = 0) = 0,







P(X = 0 and Y = 0) = 1 − pX = 1 − pY .

294 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

When ρ = −1, we have

 P(X = 1 and Y = 1) = pX pY − pX pY (1 − pX )(1 − pY ) ⩾ 0,


 p




 P(X = 0 and Y = 1) = (1 − pX )pY + pX pY (1 − pX )(1 − pY ) ⩾ 0,

 p

P(X = 1 and Y = 0) = pX (1 − pY ) + pX pY (1 − pX )(1 − pY ) ⩾ 0,


 p







P(X = 0 and Y = 0) = (1 − pX )(1 − pY ) − pX pY (1 − pX )(1 − pY ) ⩾ 0,
 p

hence
 pX pY ⩾ pX pY (1 − pX )(1 − pY ),
 p

pX pY (1 − pX )(1 − pY ),
p
pX pY ⩾

hence

pX pY ⩾ (1 − pX )(1 − pY ) and pX pY ⩾ (1 − pX )(1 − pY ),

showing that pX pY = (1 − pX )(1 − pY ), which implies pX = 1 − pY , and

 P(X = 1 and Y = 1) = 0,





 P(X = 0 and Y = 1) = 1,


P(X = 1 and Y = 0) = 1,







P(X = 0 and Y = 0) = 0.

Exercise 4.3
a) We have

P(X ⩾ x) = P(X ⩾ x and Y ⩾ 0) = e−(λ+ν )x ,

and
P(Y ⩾ y ) = P(X ⩾ 0 and Y ⩾ y ) := e−(µ+ν )y ,
x, y ⩾ 0, i.e. X and Y are exponentially distributed with respective pa-
rameters λ + ν and µ + ν.
b) We have

P(X ⩽ x and Y ⩽ 0)
= P(X ⩾ x and Y ⩾ 0) − (P(X ⩾ x) − P(X ⩾ x and Y ⩾ 0))
−(P(Y ⩾ x) − P(X ⩾ x and Y ⩾ 0))
= P(X ⩾ x and Y ⩾ 0) − P(X ⩾ x) − P(Y ⩾ x) + P(X ⩾ x and Y ⩾ 0)),

" 295

This version: June 9, 2023


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

x, y ⩾ 0, i.e. X and Y are exponentially distributed with respective pa-


rameters λ + ν and µ + ν.
c) Since e−(λ+ν )X and e−(µ+ν )Y are uniformly distributed on [0, 1], a copula
function C (u, v ) can be defined by

C (u, v ) := P(e−(λ+ν )X ⩽ u and e−(µ+ν )Y ⩽ v )


= P(X ⩽ −(λ + ν )−1 log u and Y ⩽ −(λ + ν )−1 log v )
−1 −1 −1 −1
= eλ(λ+ν ) log u+µ(λ+ν ) log v )y−ν Max(−(λ+ν ) log u,−(λ+ν ) log v ))
−1 −1
= uλ/(λ+ν ) v µ/(λ+ν ) e−ν Max(−(λ+ν ) log u,−(λ+ν ) log v ))
(λ+ν )−1 (λ+ν )−1 ))
= uλ/(λ+ν ) v µ/(λ+ν ) eν min(log u ,log v
λ/(λ+ν ) µ/(λ+ν ) log min(uν/(λ+ν ) ,v ν/(λ+ν ) ))
= u v e
= uλ/(λ+ν ) v µ/(λ+ν ) min(uν/(λ+ν ) , v ν/(λ+ν ) ))
= uλ/(λ+ν ) v µ/(λ+ν ) (min(u, v ))ν/(λ+ν ) , x, y ⩾ 0.

0.8

0.6
1
0.4 0.8
0.2 0.6
0.4 v
0
0 0.2 0.2
0.4 0.6 0.8 0
u 1

Fig. S.1: Exponential copula function u, v 7→ C (u, b) with λ = 1, µ = 2, ν = 4.

Exercise 4.4
a) We have
1
FX (x) = P(X ⩽ x) = P(X ⩽ x and Y ⩽ ∞) =
1 + e−x
and
1
FY (y ) = P(Y ⩽ y ) = P(X ⩽ ∞ and Y ⩽ y ) = , x, y ∈ R.
1 + e−y
The probability densities are given by

′ e−x
fX (x) = fY (x) = FX (x) = FY′ (x) = , x ∈ R.
(1 + e−x )2

b) We have

−1 1−u
FX (u) = FY−1 (u) = − log , u ∈ (0, 1),
u

296 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

and the corresponding copula is given by


−1
C (u, v ) = F(X,Y ) (FX (u), FY−1 (v ))
1−u 1−v
 
= F(X,Y ) − log , − log
u v
1
=
1 + (1 − u)/u + (1 − v )/v
1
=
1 + (1 − u)/u + (1 − v )/v
uv
= , u, v ∈ [0, 1],
u + v − uv
which is a particular case of the Ali-Mikhail-Haq copula.

Exercise 4.5
a) We show that (X, Y ) have Gaussian marginals N (0, σ 2 ) and N (0, η 2 ),
according to the following computation:
w∞ 1 w∞
1 2 2 (x, y )e−x /(2σ )−y /(2η ) dy
2 2 2 2
fΣ (x, y )dy =
−∞ πση −∞ R− ∪R+
1 −x2 /(2σ2 ) w∞
1R + ( x )
2 2
= e e−y /(2η ) dy +
πση 0
1 −x2 /(2σ2 ) w0
1 R− ( x )
2 2
e e−y /(2η ) dy
πση −∞
1 1
= √ e−x /(2σ ) 1R+ (x) + √ e−x /(2σ ) 1R− (x)
2 2 2 2

σ 2π σ 2π
1 2 2
= √ e−x /(2σ ) , x ∈ R.
σ 2π

b) The couple (X, Y ) does not have a joint Gaussian distribution, and its
joint probability density function does not coincide with fΣ (x, y ).
c) When σ = η = 1, the random variable X + Y has the probability density
function
∂ 1 ∂ w a w a−x −x2 /2−y2 /2
P(X + Y ⩽ a) = e dydx
∂a π ∂a 0 0
1 ∂ w a −(a−z )2 /2 w z −y2 /2
= e e dydz
π ∂a 0 0
1 w a −y2 /2 1 w a −(a−z )2 /2 w z −y2 /2
= e dy + ze e dydz
π 0 π 0 0
1 w a −y2 /2 1 w a −(a−z )2 /2 w a −y2 /2
= e dy + ze dz e dy
π 0 π 0 0
1 w a −y2 /2 w y −(a−z )2 /2
+ e ze dzdy
π 0 0

" 297

This version: June 9, 2023


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

1 w a −y2 /2 1 2
wa 2
= e dy + (1 − e−a /2 ) e−y /2 dy
π 0 π 0
1 w a −y2 /2 −(a−y )2 /2 2
+ e (e − e−a /2 )dy
π 0
2 2
w a −y 2 /2 1 2
wa 2 2
= (1 − e−a /2 ) e dy + e−a /2 e−y /2−(a−y ) /2 dy
π 0 π 0
1 2
wa 2 e−a /2 w a −((√2y−a/√2)2 −a2 /2)/2
2

= (1 − e−a /2 ) e−y /2 dy + e dy
π −a π 0
w 2 /4 w √
1 2 a −y 2 /2 e−a √
a 2 −((y−a/ 2)2 )/2
= (1 − e−a /2 ) e dy + √ e dy
π −a π 2 0
wa √ √
e−a /4 w a( 2−1/ 2) −y2 /2
2
1 2 2
= (1 − e−a /2 ) e−y /2 dy + √ √ e dy
π −a π 2 −a 2
wa √
e−a /4 w a/ 2 −y2 /2
2
1 2 2
= (1 − e−a /2 ) e−y /2 dy + √ √ √ e dy
π −a π 2π −a 2
1 2 2 1 √
= √ (1 − e−a /2 )(2Φ(a) − 1) + e−a /4 √ (2Φ(a 2) − 1), a ⩾ 0,
π π

which vanishes at a = 0.
d) The random variables X and Y are positively correlated, as
w∞ 1 w∞
1 2 2 (x, y )ye−x /(2σ )−y /(2η ) dy
2 2 2 2
yfΣ (x, y )dy =
−∞ πση −∞ R− ∪R+
1 −x2 /(2σ2 ) w∞
1R + ( x )
2 2
= e ye−y /(2η ) dy
πση 0
1 −x2 /(2σ2 ) w0
1 R− ( x )
2 2
+ e ye−y /(2η ) dy
πση −∞
η −x2 /(2σ2 ) η
1R+ (x) − e−x /(2σ ) 1R− (x),
2 2
= e
πσ πσ
hence
w∞ w∞
E[XY ] = xyfΣ (x, y )dydx
−∞ −∞
η w ∞ −x2 /(2σ2 ) η w0 2 2
= xe dx − xe−x /(2σ ) dx
πσ 0 πσ −∞
2ση
= ,
π
and
E[XY ] 2
ρ= = .
ση π
Under a rotation
cos θ − sin θ
 
R= ,
sin θ cos θ

298 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

of angle θ ∈ [0, 2π ] we would find

E[(X cos θ − Y sin θ )(X sin θ + Y cos θ )]


= sin θ cos θE X 2 + (cos2 θ − sin2 θ )E[XY ] − sin θ cos θE Y 2
   

2ση
= σ 2 sin θ cos θ + (cos2 θ − sin2 θ ) − η 2 sin θ cos θ
π
σ2 2ση η 2
= sin(2θ ) + cos(2θ ) − sin(2θ ),
2 π 2
and
σ 2 η
ρ= sin(2θ ) + cos(2θ ) − sin(2θ ),
2η π 2σ
i.e. θ = π/4 and σ = η would lead to uncorrelated random variables.

Exercise 4.6
a) We have

P(τi ∧ τ ⩾ s) = P(τi ⩾ s and τ ⩾ s)


= P ( τi ⩾ s ) P ( τ ⩾ s )
= e−λi s e−λs
= e−(λi +λ)s , s ⩾ 0,

hence τi ∧ τ is an exponentially distributed random variable with param-


eter λi + λ, i = 1, 2.
b) Next, we have

P(τ1 ∧ τ > s and τ2 ∧ τ > t) = P(τ1 > s and τ > s and τ2 > t and τ > t)
= P(τ1 > s and τ2 > t and τ > Max(s, t))
= P(τ1 > s)P(τ2 > t)P(τ > Max(s, t))
= e−λ1 s e−λ2 t e−λ Max(s,t)
= e−λ1 s−λ2 t−λ Max(s,t)
= e−(λ1 +λ)s−(λ2 +λ)t+λ min(s,t)
= (1 − FX (s))(1 − FY (t)) min(eλs , eλt ),

s, t ⩾ 0.
c) We have

FX,Y (s, t) = P(τ1 ∧ τ ⩽ s and τ2 ∧ τ ⩽ t)


= P(τ1 ∧ τ ⩽ s) − P(τ1 ∧ τ ⩽ s and τ2 ∧ τ > t)
= P(τ1 ∧ τ ⩽ s) − P(τ2 ∧ τ > t) − P(τ1 ∧ τ > s and τ2 ∧ τ > t)


= P(τ1 ∧ τ ⩽ s) + P(τ2 ∧ τ ⩽ t) + P(τ1 ∧ τ > s and τ2 ∧ τ > t) − 1

" 299

This version: June 9, 2023


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

= FX (s) + FY (t) + (1 − FX (s))(1 − FY (t)) min(eλs , eλt ) − 1.

d) We find
−1
C (u, v ) = FX,Y (FX (u), FY−1 (v ))
−1 −1
= FX (FX (u)) + FY (FX (v ))
−1 −1
−1 −1 (u) (v ) 
+(1 − FX (FX (u)))(1 − FY (FX (v ))) min eλFX , eλFX −1
−1
(u) λFY−1 (v )
= u + v − 1 + (1 − u)(1 − v ) min e λFX
,e


= u + v − 1 + (1 − u)(1 − v ) min e−λ log(1−u)/(λ1 +λ) , e−λ log(1−v )/(λ2 +λ)




= u + v − 1 + min (1 − v )(1 − u)1−λ/(λ1 +λ) , (1 − u)(1 − v )1−λ/(λ2 +λ)




= u + v − 1 + min (1 − v )(1 − u)1−θ1 , (1 − u)(1 − v )1−θ2 , u, v ∈ [0, 1],




with
λ λ
θ1 = and θ2 = .
λ1 + λ λ2 + λ

1
0.9
0.8
0.7
0.6
0.5
0.4
0.3 1
0.2 0.8
0.1 0.6
0.4 u
0 0 0.2
0.2 0.4 0.6 0.8 0
v 1

Fig. S.2: Survival copula graph with θ1 = 0.3 and θ2 = 0.7.

e) We have

C (u, v ) = u + v − 1 + (1 − u)(1 − v )1−θ2 1{(1−u)θ1 <(1−v )θ2 }


+(1 − v )(1 − u)1−θ1 1{(1−u)θ1 >(1−v )θ2 } , u, v ∈ [0, 1],

hence
∂C
(u, v ) = −(1 − v )1−θ2 1{(1−u)θ1 <(1−v )θ2 }
∂u
−(1 − θ1 )(1 − v )(1 − u)−θ1 1{(1−u)θ1 >(1−v )θ2 }

and the survival copula density is given by

300 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

∂2C
(u, v ) = (1 − θ2 )(1 − v )−θ2 1{(1−u)θ1 <(1−v )θ2 }
∂u∂v
+(1 − θ1 )(1 − u)−θ1 1{(1−u)θ1 >(1−v )θ2 } , u, v ∈ [0, 1],

3.5
3
2.5
2
1.5 1
1 0.8
0.6
0.5 0.4 u
0.2
0 0 0.2 0.4 0
0.6 0.8 1
v

Fig. S.3: Survival copula density graph with θ1 = 0.3 and θ2 = 0.7.

Remark: When λ = 0 we have θ1 = θ2 = 0 and τ = +∞ a.s., therefore


we have
min(τ1 , τ ) = τ1 and min(τ2 , τ ) = τ2 ,
hence the copula C (u, v ) is given by

C (u, v ) = u + v − 1 + (1 − v )(1 − u) = uv, u, v ∈ [0, 1],

which coincides with the copula of independence.

Chapter 5

Exercise 5.1 The payoff C is that of a put option with strike price K = $3.

Exercise 5.2 Each of the two possible scenarios yields one equation:

 5ξ + η = 0
 
 ξ = −2
with solution
2ξ + η = 6, η = +10.
 

The hedging strategy at t = 0 is to shortsell −ξ = +2 units of the asset


S priced S0 = 4, and to put η = $10 on the savings account. The price
V0 = ξS0 + η of the initial portfolio at time t = 0 is

V0 = ξS0 + η = −2 × 4 + 10 = $2,

" 301

This version: June 9, 2023


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

which yields the price of the claim at time t = 0. In order to hedge then
option, one should:
i) At time t = 0,
a. Charge the $2 option price.
b. Shortsell −ξ = +2 units of the stock priced S0 = 4, which yields $8.
c. Put η = $8 + $2 = $10 on the savings account.
ii) At time t = 1,
a. If S1 = $5, spend $10 from savings to buy back −ξ = +2 stocks.
b. If S1 = $2, spend $4 from savings to buy back −ξ = +2 stocks, and
deliver a $10 - $4 = $6 payoff.
Pricing the option by the expected value E∗ [C ] yields the equality

$2 = E∗ [C ]
= 0 × P∗ (C = 0) + 6 × P∗ (C = 6)
= 0 × P∗ (S1 = 2) + 6 × P∗ (S1 = 5)
= 6 × q∗ ,

hence the risk-neutral probability measure P∗ is given by


2 1
p∗ = P∗ (S1 = 5) = and q ∗ = P∗ (S1 = 2) = .
3 3

Exercise 5.3
a) Each of the stated conditions yields one equation, i.e.

 4ξ + η = 1 ξ = 2
 

with solution
5ξ + η = 3, η = −7.
 

Therefore, the portfolio allocation at t = 0 consists to purchase ξ = 2 unit


of the asset S priced S0 = 4, and to borrow −η = $7 in cash.

We can check that the price V0 = ξS0 + η of the initial portfolio at time
t = 0 is
V0 = ξS0 + η = 2 × 4 − 7 = $1.
b) This loss is expressed as

ξ × $2 + η = 2 × 2 − 7 = −$3.

Note that the $1 received when selling the option is not counted here be-
cause it has already been fully invested into the portfolio.

302 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

Exercise 5.4
a) i) Does this model allow for arbitrage? Yes | ✓ No |

ii) If this model allows for arbitrage opportunities, how can they be real-
ized? By shortselling | By borrowing on savings | ✓ N.A. |

b) i) Does this model allow for arbitrage? Yes | No | ✓

ii) If this model allows for arbitrage opportunities, how can they be real-
ized? By shortselling | By borrowing on savings | N.A. | ✓

c) i) Does this model allow for arbitrage? Yes | ✓ No |

ii) If this model allows for arbitrage opportunities, how can they be real-
ized? By shortselling | ✓ By borrowing on savings | N.A. |

Exercise 5.5
a) We need to search for possible risk-neutral probability measure(s) P∗ such
 (1)  (1)
that E∗ S1 = (1 + r )S0 . Letting

(1) (1)
 !
(1) (1) S1 − S0
p∗ = P∗ S1 = S0 (1 + a) = P∗ =a ,

 

 (1)
S0







(1) (1)

 !

(1) (1) S1 − S0
θ∗ = P∗ S1 = S0 (1 + b) = P∗ =b ,

(1)


 S0




(1) (1)
 !
S1 − S0

 q ∗ = P∗ S (1) = (1 + c)S (1)  = P∗

=c ,

1 0

 (1)
S0

We have

 (1 + a)p∗ S0(1) + (1 + b)θ∗ S0(1) + (1 + c)q ∗ S0(1) = (1 + r )S0(1)


p∗ + θ∗ + q ∗ = 1,

from which we obtain


(1 − θ )c + θ ∗ b − r


 ∗
 p a + θ∗ b + q ∗ c = r, p =

 ∈ (0, 1),
c−a

=⇒
 q ∗ = r − (1 − θ )a − θ b ∈ (0, 1),

p∗ + θ∗ + q ∗ = 1.
 


c−a

" 303

This version: June 9, 2023


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

for any θ∗ ∈ (0, 1) such that

(1 − θ∗ )a + θ∗ b < r < (1 − θ∗ )c + θ∗ b,

i.e.
r−c r−a
< θ∗ < ,
b−c b−a
or
(1 − θ ∗ )a < r < (1 − θ ∗ )c
i.e. < 1 − r/c, in case a < b = 0 < c. Therefore there exists an infinity
θ∗
of risk-neutral probability measures depending on the value of θ∗ ∈ (0, 1),
and the market is without arbitrage but not complete.
b) Hedging a claim with possible payoff values Ca , Cb , Cc would require to
solve
(1) (0)




(1 + a)ξS0 + (1 + r )ηS0 = Ca



(1) (0)

(1 + b)ξS0 + (1 + r )ηS0 = Cb



(1) (0)

(1 + c)ξS0 + (1 + r )ηS0 = Cc ,

for ξ and η, which is not possible in general due to the existence of three
conditions with only two unknowns.

Exercise 5.6
a) Each of two possible scenarios yields one equation:

S1 − K

 
 α=
 αS 1 + β = S 1 − K S1 − S1



with solution
αS 1 + β = 0, S −K
 
 β = −S 1 1

.


S1 − S1

b) We have
S1 − K
0⩽α= ⩽1
S1 − S1
since K ∈ [S 1 , S 1 ].
c) We find

SRMC = αS0 + β
= α(S0 − S 1 )
S1 − K
= (S0 − S 1 ) .
S1 − S1

304 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

We note that when S0 < S 1 the value of SRMC is negative because in


this case, investing in the zero-cost portfolio (α, −αS0 ) that would yield a
payoff at least equal to α(S 1 − S0 ) = −α(S 0 − S1 ) > 0, which represents
an arbitrage opportunity.

Exercise 5.7
a) The payoff of the long box spread option is given in terms of K1 and K2
as

(x − K1 )+ − (K1 − x)+ − (x − K2 )+ + (K2 − x)+ = x − K1 − (x − K2 ) = K2 − K1 .

b) From Table 5.1 we check that the strike prices suitable for a long box
spread option on the Hang Seng Index (HSI) are K1 = 25, 000 and K2 =
25, 200.
c) Based on the data provided, we note that the long box spread can be
realized in two ways.
i) Using the put option issued by BI (BOCI Asia Ltd.) at 0.044.
In this case, the box spread option represents a short position priced

| {z } ×7, 500 −0.064


0.540 ×8, 000 −0.370 ×11, 000 +0.044 ×10, 000 = −92
| {z } | {z } | {z }
Long call Short put Short call Long put

index points, or −92 × $50 = −$4, 600.


Note that option prices are quoted in index points (to be multiplied
by the relevant option/warrant entitlement ratio), and every index
point is worth $50.
ii) Using the put option issued by HT (Haitong Securities) at 0.061.
In this case, the box spread option represents a long position priced

0.540
| {z } ×7, 500 −0.044 ×8, 000 −0.370 ×11, 000 +0.061 ×10, 000 = +78
| {z } | {z } | {z }
Long call Short put Short call Long put

index points, or 78 × $50 = $3, 900.


d) As the option built in ci) represents a short position paying $4, 600 today
with an additional $50 × (K2 − K1 ) = 200 = $10, 000 payoff at maturity
on March 28, I would definitely enter this position.
As for the option built in cii) it is less profitable because it costs $3, 900,
however it is still profitable taking into account the $10, 000 payoff at
maturity on March 28.

" 305

This version: June 9, 2023


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

Chapter 6
Exercise 6.1
a) We have

FX (x) = P(X ⩽ x)
wx
= fX (y )dy
0
wx 1
= γθγ dy
0 (θ + y )γ +1
  γ x
θ
= −
θ+y
 γ 0
θ
= 1− , x ∈ R+ .
θ+x

b) Since the distribution of X admits a probability density function, the


cumulative distribution function x 7−→ FX (x) is continuous in x and we
have P(X = x) = 0 for all x > 0. Hence the Value at Risk VXp at the level
p is given by the relation FX (VXp ) = p, i.e.
 γ
θ
= 1 − p,
θ + VXp

which gives
1
 
VXp = θ − 1 .
(1 − p)1/γ
In particular, with p = 99%, θ = 40 and γ = 2, we find

VXp = ((1 − p)−1/γ − 1)θ = 40 100 − 1 = $360.


1 0.05

p=0.9

0.8 0.04

0.6 0.03
FX(x)

fX(x)

0.4 0.02

0.2 0.01

Vxp
0 0
0 100 200 300 400 500 0 Vxp 100 200 300 400 500
x x

Fig. S.4: Pareto CDF x 7→ FX (x) and PDF x 7→ fX (x) with 99%
VX = $86.49.

306 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

Exercise 6.2
a) We have P(X = 100) = 0.02.
b) We have VXq = 100 for all q ∈ [0.97, 0.99].
c) The value at risk VXq at the level q ∈ [0.99, 1] satisfies

FX (VXq ) = P(X ⩽ VXq ) = 0.99 + 0.01 × (VXq − 100)/50 = q,

hence

VXq = 100 + 50(100q − 99) = 5000q − 4850, q ∈ [0.99, 1].

Exercise 6.3 We find VX99% = 100 according to the following cumulative


distribution function:

FX (x)
1.00
0.99
0.98
0.97
0.96
0.95
0.94
0.93
0.92
0.91
0.90
0.89
0.88
0.87

0 x
−20 −10 0 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160

Fig. S.5: Cumulative distribution function of X and Y .

Exercise 6.4
a) We have
1 1
VXp := inf x ∈ R : P(X ⩽ x) ⩾ p = − log(1 − p) = E[X ] log .

λ 1−p

When p = 95% this yields

VXp ≃ 2.996E[X ].

b) We find that the required capital CX satisfies


1
CX = VXp − E[X ] = E[X ] log − E[X ],
1−p
i.e.
CX = VX95% − E[X ] ≃ 1.996E[X ],
which means doubling the estimated amount of liabilities.

Exercise 6.5 We have

" 307

This version: June 9, 2023


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

1
E[X | X ⩾ a] = E X 1{X ⩾a}
 
P(X ⩾ a)
1 X
= kP(X = k )
P(X ⩾ a)
k ⩾a
1 X
= X k (1 − p)k
(1 − p)k k ⩾a
k⩾a
(1 − p)a X
= X (k + a)(1 − p)k
(1 − p) a
(1 − p) k⩾0
k

k ⩾0
1 X
= a+ X k (1 − p)k
(1 − p) k
k⩾0
k⩾0
X
= a+p k (1 − p)k
k ⩾0
1
= a+
p
= a + E[X ]

numerically, for example with a = 11 using the following code:

geo_samples <- rgeom(100000, prob = 1/4)


mean(geo_samples)
mean(geo_samples[geo_samples>=10])

Exercise 6.6
a) By the Chebyshev inequality, for every x > 0 and r > 0 we have

xr P(X ⩾ x) = xr E 1{X ⩾x}


 

⩽ E X 1{X ⩾x}
 r 

⩽ E [|X|r ] ,

hence
1
P(X ⩽ x) ⩾ 1 − E[|X|r ], x > 0,
xr
and

VXp = inf x ∈ R : P(X ⩽ x) ⩾ p




1
⩽ inf x ∈ R : 1 − r E[|X|r ] ⩾ p

x
1
 
= inf x ∈ R : xr ⩾ E[|X|r ]
1−p
308 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

E[|X|r ] 1/r
 
=
1−p
∥X∥Lr (Ω)
= .
(1 − p)1/r

b) Taking p = 95% and r = 1 we get


1
VX95% ⩽ E[|X|] = 20E[|X|].
1−p
To summarize, a smaller Lr -norm of X tends to make the value at risk
VX smaller.

Exercise 6.7

See the attached code∗ for a solution using R.


a) i) VaR95
Ac-H = 5.
ii) VaR80
Ac-H = 4.
iii) VaR95
Pr-H = −3.
iv) VaR80
Pr-H = −2.
b) By Proposition 6.13, we have:
i) VaR95
Ac-G = 1.15+3.048× qnorm(0.95)=6.164,
ii) VaR80
Ac-G = 1.15+3.048× qnorm(0.80)=3.71551,
iii) VaR95
Pr-G = 1.15-3.048× qnorm(0.95)=-3.864.
iv) VaR80
Pr-G = 1.15-3.048× qnorm(0.80)=-1.41551,

Remark. The “Practitioner” Values at Risk can be better visualized after ap-
plying top-down and left-right symmetries (or a 180o rotation) to the original
CDF, as in the next figure.


Right-click to save as attachment (may not work on .

" 309

This version: June 9, 2023


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

Chapter 7

Exercise 7.1
p
a) Noting that p = 1 − e−λVaRX and using integration by parts on VaRpX , ∞
 

with u(x) = x and v ′ (x) = e−λx , we have


1 w∞
E[X | X > VaRpX ] = xfX (x)dx
P(X > VaRpX ) VaRpX
λ w ∞
= xe−λx dx
1 − p VaRpX
λ w∞
= u(x)v ′ (x)dx
1 − p VaRpX
λ

∞ w∞ 


= u(x)v (x) VaRp − p u (x)v (x)dx
1−p X VaRX
1 w∞
h 
λ x −λx i∞ −λx
= − e + p e dx
1−p λ VaRXp
λ VaRX
VaRpX −λVaRp 1 −λVaRp
 
λ
= e X + e X
1−p λ λ2
VaRpX 1−p
 
λ
= (1 − p) + 2
1−p λ λ
p 1
= VaRX +
λ
1 log(1 − p)
= − .
λ λ
b) We have

310 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

1 w1 q
TVpX = V dq
1−p p X
1 w1
= − log(1 − q )dq
λ(1 − p) p
1 w 1−p
= − (log q )dq
λ(1 − p) 0
1
1 − p + (1 − p) log
1−p
=
λ(1 − p)
1 1 1
= + log
λ λ 1−p
1
 
= E[X ] 1 + log
1−p
= E[X ] + VXp .

Exercise 7.2
a) If P(X > z ) > 0 we have E (X − z )1{X>z} > 0, hence
 

E X 1{X>z} > E z 1{X>z} = zP(X > z ),


   

and
E X 1{X>z}
 
E[X | X > z ] = > z.
P(X > z )
Recall that E[X | X > z ] is not defined if P(X > z ) = 0.
b) We have

E[X ] = E X 1{X ⩽z} + E X 1{X>z}


   

⩽ zE 1{X ⩽z} + E X 1{X>z}


   

= zP(X ⩽ z ) + E X 1{X>z}
 

⩽ E[X | X > z ]P(X ⩽ z ) + E[X | X > z ]P(X > z )


= E[X | X > z ].

Note that E[X ] = E[X | X > z ] when P(X ⩽ z ) = 0, i.e. P(X > z ) = 1.
c) When P(X ⩽ z ) > 0, we find

E[X ] ⩽ zP(X ⩽ z ) + E X 1{X>z}


 

< E[X | X > z ]P(X ⩽ z ) + E[X | X > z ]P(X > z )


= E[X | X > z ].

" 311

This version: June 9, 2023


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

d) By (6.5) we have P X ⩽ VXp ⩾ p > 0, hence by (c) above we find



p p
CTEX = E X | X > VX > E[X ].


Exercise 7.3
a) We have VaR0.9
X = 4 and CTEX = 6.
0.9

b) We have VaR0.8
X = 2 and

3+2×4+6 17
CTE0.8
X = = = 4.25.
4 4

Equivalently, we have
0.05 × 3 + 0.1 × 4 + 0.05 × 6
CTE0.8
X =
0.05 + 0.1 + 0.05
0.05 × 3 + 0.1 × 4 + 0.05 × 6
=
0.2
0.85
= = 4.25.
0.2

Exercise 7.4
a) VaR90%
X = 4.
312 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

5+6 11
b) E X 1{X>V 90% } = = .
 
X 23 23
2
c) P X > VX90% = .

23
E X 1{X>V 90% }
 
5+6 11
d) CTEX = E X | X > VX
90% 90%
= 5.50.
  X
=  = =
P X > VX90% 2 2
4+5+6 15
e) E X 1{X ⩾V 90% } = = .
 
X 23 23
3
f) P X ⩾ VX 90%
= .

23
1
g) ES90% E X 1{X ⩾V 90% } + VX90% 1 − p − P X ⩾ VX90% = 10 ×
  
=
X 1−p X
4+5+6 3 150 2.3 − 3 150 − 40 × 0.7
 
+ 10 × 4 0.1 − = + 40 × = =
23 23 23 23 23
122
= 5.304.
23
1 w1 q
w w 22/23 w1
1

21/23 q
h) TV90% = VX dq = VX dq + VXq dq + VXq dq
w1 − p p 1−p
X p 21/23 22/23
1 21/23 w 22/23 w1 
= 4dq + 5dq + 6dq
1 − p  p  21/23  22/23
1 21 5 6 84 − 92p + 5 + 6 122
= 4 −p + + = = = 5.304.
1−p 23 23 23 23(1 − p) 23
We note that ES90%
X = TV90%
X according to Proposition 7.10. The attached
code computes the above risk measures, as illustrated in the next Fig-
ure S.6.

> source("var-cte_quiz.R")
VaR90= 4, Threshold= 0.9130435
CTE90= 5.5
ES90= 5.304348

Fig. S.6: Value at Risk and Expected Shortfall for small data.

" 313

This version: June 9, 2023


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

Exercise 7.5
a) The value at risk is VX98% = 100.

FX (x)

1.00
0.99
p= 0.98

0.97
0.96

x
−20 −10 0 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160

Fig. S.7: Cumulative distribution function of X.

b) Taking p = 0.98, we have


1 w1 q
TV98% = V dq
X 1−p p X
1
= ((0.99 − 0.98) × 100 + (1 − 0.99) × 150) = 125.
0.02
c) We have
1 h i
CTE98% = E X 1{X>V p }
X
P(X > VXp ) X

1
= × 150 × 0.01 = 150.
0.01
d) We have

1 h i Vp
ES98% = E X 1{X ⩾V p } + X (1 − p − P(X ⩾ VX ))
X 1−p X 1−p
1 100
= (100 × 0.03 + 150 × 0.01) + (0.02 − (0.03 + 0.01))
0.02 0.02
4.5 100
= + (0.02 − (0.03 + 0.01)) = 125.
0.02 0.02
Note that we also have
1 h i Vp
ES98% = E X 1{X>V p } + X (1 − p − P(X > VX ))
X 1−p X 1−p
1 100
= (150 × 0.01) + (0.02 − 0.01)
0.02 0.02
= 125,

hence the Expected Shortfall ES98%


X does coincide with the tail value at
risk T VX98% .

314 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

Exercise 7.6
a) The cumulative distribution function of X is given by the following graph:

FX (x)
1.02
1.00
0.98
0.96
0.94
0.92
0.90
0.88
0 x
−20 −10 0 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 190 200 210

Fig. S.8: Cumulative distribution function of X.

b) The distribution of X + Y is given by

P(X + Y = 0) = 81%, P(X + Y = 100) = 18%, P(X + Y = 200) = 1%.

The cumulative distribution function of X + Y is given by the following


graph:

FX+Y (x)
1.00
0.98
0.96
0.94
0.92
0.90
0.88
0.86
0.84
0.82
0.80
0 x
−20 −10 0 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 190 200 210

Fig. S.9: Cumulative distribution function of X + Y .

c) We have VX99%
+Y = VX +Y = VX +Y = 100.
95% 90%

Note that we have VX99%


+Y = 100 because

VX99% = inf{x ∈ R : P(X ⩽ x) ⩾ 0.99} = 100.

d) We have
1 w1 1 − 0.9
TV90% = V q dq = 100 × = 100.
X 1 − 0.9 0.9 X 1 − 0.9
e) We have
1 w1
TV99%
X +Y = V q dq
1 − 0.9 0.9 X +Y
w w1
1

0.99
= 100dq + 200dq
0.1 0.9 0.99

" 315

This version: June 9, 2023


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

1
= (100 × 0.09 + 200 × 0.01)
0.1
= 110,

and
1 w1
TV80%
X +Y = V q dq
1 − 0.8 0.9 X +Y
w w 0.99 w1
1

0.81
= 0dq + 100dq + 200dq
0.2 0.8 0.81 0.99
1
= (100 × 0.18 + 200 × 0.01) = 100.
0.2

Exercise 7.7 (Exercise 6.2 continued).


a) For all p ∈ [0.99, 1] we have
1 w1 q
TVpX = V dq
1−p p X
1 w1
= (5000q − 4850)dq
1−p p
1 ( 1 − p2 )
 
= 5000 − (1 − p)4850
1−p 2
= 2500p − 2350.

In particular,

TV99%
X = 2500 × 0.99 − 2350 = 125 ⩾ VX99% = 100.

b) We have VX98% = 100 and

CTE98% = E X | X > VX98%


 
X
1 h i
=  E X 1{X>V 98% }
P X > VX98% X

1 w∞
= xfX (x)dx
0.01 100
1 w ∞ dFX (x)
= x dx
0.01 100 dx
w
1 0.01 150
= xdx
0.01 50 100
150 − 100
2 2
=
2 × 50
= 125.

Note that
316 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

0.01 1 (1 − 0.992 )
 
TV98% = × 100 + 5000 − 0.01 × 4850
X 0.02 0.02 2
= 112.50
⩾ VX98% = 100,

which differs from CTE98%


X = 125 since

P X = VX98% = P(X = 100) = 0.02 > 0.




Exercise 7.8
a) We have
p
VXp := inf x ∈ R : P(X ⩽ x) ⩾ p = log .

1−p

b) We have
1 w∞
E[X | X > VaRpX ] = xfX (x)dx
P(X > VaRpX ) VaRpX
1 w ∞
= xe−λx dx
1 − p VaRpX
1 w∞ xe−x
= dx
1 − p VaRpX (1 + e−x )2
p
1 p VaRpX eVaRX
= log(1 + eVaRX ) − p
1−p 1 + eVaRX
1 1 1
 
p p p
= log 1 + − p log
1−p 1−p 1 − p 1 − p 1 + 1−p 1−p
1 1 p p
= log − log
1−p 1−p 1−p 1−p
p
=− log p − log(1 − p).
1−p

c) We have
1 w1 q
TVpX = V dq
1−p p X
1 w 1 q
= log dq
1−p p 1−q
1 w 1 1 w1
= log qdq − log(1 − q )dq
1−p p 1−p p
1 w 1 1 w 1−p
= log qdq − log qdq
1−p p 1−p 0

" 317

This version: June 9, 2023


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

1 w1
w w1
1

1
= log qdq − log qdq − log qdq
1−p p 1−p 0 1−p
p − 1 − p log p −1 + p + (1 − p) log(1 − p)
= −
1−p 1−p
p
=− log p − log(1 − p).
1−p

Chapter 8

Exercise 8.1
a) We have
1 1
E[X | G] = and E[X | B ] = .
λG λB
b) We find

fX (x | B )P(B )
P(B | X = x) =
fX ( | G ) P ( G ) + fX ( x | B ) P ( B )
λB e−λB x P(B )
=
λG e G P(G) + λB e−λB x P(B )
−λ x

1
=
λG P(G) (λB −λG )x
1+ e
λB P(B )
1
= ,
P(G)
1 + λ(x)
P(B )

where λ(x) is the likelihood ratio

fX (x | G) λ
λ(x) = = G e(λB −λG )x , x > 0.
fX ( x | B ) λB

c) The condition
DP(B | X = x) ⩽ LP(G | X = x)
rewrites as
DP(B | X = x) ⩽ L(1 − P(B | X = x)),
i.e.
(L + D )P(B | X = x) ⩽ L
or
L+D
⩽ L,
P(G)
1 + λ(x)
P(B )

318 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

or
λG (λB −λG )x D P(B )
λ(x) = e ⩾ .
λB L P(G)
This condition holds if and only if

1 D λB P(B )
 
x⩾ log ,
λB − λG L λG P(G)

provided that λB > λG . Therefore we have

D P(B )
 
A = x ∈ R : λ(x) ⩾
L P(G)
1 D λB P ( B )
   
= log ,∞ ,
λB − λG L λG P(G)

under the condition


1 1
E[X | B ] = < = E[X | G].
λB λG

d) We have
−1
F G F B (x) = F G − (log x)/λB )


= eλG (log x)/λB


= xλG /λB , x ∈ [0, 1].

We check that
d −1  d λG /λB
F G F B (x) = x
dx dx
d λG (log x)/λB
= e
dx
λG λG (log x)/λB
= e
xλB
λG (λG −λB )(log x)/λB
= e
λB
λ −1
= G e(λB −λG )F B (x)
λB
−1
= λ F B (x) , x ∈ [0, 1].


Exercise 8.2
a) We find

fX ( x | B ) P ( B )
P(B | X = x) =
fX (x | G)P(G) + fX (x | B )P(B )
" 319

This version: June 9, 2023


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

P(B )/λB
= 1[0,λB ] (x)
P(G)/λG + P(B )/λB
1
= 1[0,λB ] (x) .
λB P ( G )
1+
λG P(B )

b) The condition
DP(B | X = x) ⩽ LP(G | X = x)
rewrites as
DP(B | X = x) ⩽ L(1 − P(B | X = x)),
i.e.
(L + D )P(B | X = x) ⩽ L
or
λB P ( G )
D1[0,λB ] (x) ⩽ L1(λB ,∞) (x) + L .
λG P(B )
This condition holds if and only if

λB D P(B )
⩾ .
λG L P(G)

when x ∈ [0, λB ], and is always satisfied when x ∈ (λB , ∞). Therefore,


we have A = R if
λB D P(B )
⩾ ,
λG L P(G)
and A = (λB , ∞) if
λB D P(B )
< ,
λG L P(G)
under the condition

E[X | B ] = λB < λG = E[X | G].

Exercise 8.3
a) We have

P ( B ) fX ( x | B )
P(B | X = x) =
P(G)fX (x | G) + P(B )fX (x | B )
2 2
P(B )e−(x−µB ) /(2σ )
=
P(G)e−(x−µG ) /(2σ ) + P(B )e−(x−µB ) /(2σ )
2 2 2 2

1
= , x ∈ R,
1 + eα+βx
with

320 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

µG − µB
β := >0
σ2
and
µG + µB P(G)
 
α := −β + log .
2 P(B )
b) We have

fX ( x | G )
λ(x) =
fX (x | B )
2 2 2 2
= e−(x−µG ) /(2σ )+(x−µB ) /(2σ )
2 2 2
= e−(µG −µB −2x(µG −µB ))/(2σ )
βx−(µ2G −µ2B )/(2σ 2 )
=e , x ∈ R.

c) The condition

2 2 2) D (x) P(B )
λ(x) = eβx−(µG −µB )/(2σ ⩾
L(x) P(G)

is equivalent to

µ2G − µ2B D (x) P(B )


 
βx ⩾ + log
2σ 2 L(x) P(G)
µ2G − µ2B P(B ) D (x)
⩾ + log + log
2σ 2 P(G) L(x)
µ2G − µ2B P(B )
⩾ + log + x(a + b),
2σ 2 P(G)

hence
µ2G − µ2B 1 P(B )
x⩾ + log ,
2σ (β − a − b)
2 β−a−b P(G)

provided that
µG − µB
β := > a + b.
σ2
In this case, we have

µ2G − µ2B 1 P(B )


 
A ∗ = [ x∗ , ∞ ) = + log , ∞ ,
2σ 2 (β − a − b) β − a − b P(G)

where
µ2G − µ2B 1 P(B )
x∗ : = + log .
2σ 2 (β − a − b) β − a − b P(G)

" 321

This version: June 9, 2023


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

Chapter 9
Exercise 9.1 By differentiation of (9.1), i.e.

P(τ < T | Ft ) := P(ST < K | Ft )


(µ − σ 2 /2)(T − t) + log(St /K ))
 
= Φ − √ , T ⩾ t,
σ T −t
with respect to T , we find

σ2 log(St /K )
 
dT
dP(τ ⩽ T | Ft ) = −µ+
2σ 2π (T − t) 2
p
T −t
2 !
(µ − σ 2 /2))(T − t) + log(St /K ))
× exp − ,
2(T − t)σ 2

provided that µ < σ 2 /2.

Exercise 9.2 Consider the first hitting time

τK := inf{u ⩾ t : Su ⩽ K}

of the level K > 0 starting from St > K. By Lemma 15.1 in Privault (2022),
we have  2r/σ2
K
E∗ e−(τK −t)r Ft = ,
 
St
provided that St ⩾ K.

Exercise 9.3
a) We have
 q q 
E[Xk Xl ] = E (ak M + 1 − a2k Zk )(al M + 1 − a2l Zl )
 q q q q 
= E ak al M 2 + ak M 1 − a2l Zl + al M 1 − a2k Zk + 1 − a2k 1 − a2l Zk Zl
q q
= ak al E M 2 + ak 1 − a2l E[Zl M ] + al 1 − a2k E[Zk M ]
 
q q
+ 1 − a2k 1 − a2l E[Zk Zl ]
q q
= ak al E M 2 + ak 1 − a2l E[Zl ]E[M ] + al 1 − a2k E[Zk ]E[M ]
 
q q
+ 1 − a2k 1 − a2l 1{k=l}

322 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

= ak al + (1 − a2k )1{k=l}
= 1{k=l} + ak al 1{k̸=l} , k, l = 1, 2, . . . , n,

b) We check that the vector (X1 , . . . , Xn ), with covariance matrix (9.9) has
the probability density function

φ(x1 , . . . , xn )
2
n w ∞ − (x1 −a1 m ) (x −a m)2 −m2 /2
1 Y 2 − n n2 e
= (1 − a2k )−1/2 e 2(1−a1 ) · · · e 2(1−an ) √ dm
(2π ) n/2
k =1
−∞ 2π

which is jointly Gaussian, with marginals given by


w∞ w∞
xk 7−→ ··· φ(x1 , . . . , xn )dx1 · · · dxk−1 dxk+1 · · · dxn
−∞ −∞
(xk −ak m)2
1 w∞ − 2
e−m /2
2(1−a2 )
= q e k √ dm
2π (1 − a2k ) −∞ 2π
(xk −ak m)2
1 w∞ − −m2 /2
2(1−a2 )
= q e k dm
−∞
2π 1 − a2k
x2 −2ak xk m+m2
1 w∞ − k
2(1−a2 )
= q e k dm
−∞
2π 1 − a2k
(m−ak xk ) 2
e−xk /2 w ∞ − 2(1−a2 )
2

= q e k dm
2π 1 − a2k −∞
1 2
= √ e−xk /2 , xk ∈ R.

c) We have
n 2
w ∞ − (x1 −a1 m ) (x −an m)2 −m2 /2
1 Y
2(1−a2 )
− n e
φ(x1 , . . . , xn ) = n/2
(1 − a2k )−1/2 e 1 ···e 2(1−a2
n) √ dm
(2π ) −∞ 2π
k =1
 
n x2 +a2 m2 −2x1 a1 m x2 +a2 m2 −2xn an m
1 w∞ −1 1 1 +···+ n n + m2 dm
1−a2 1−a2
Y 2
= (1 − a2k )−1/2 e 1 n √
(2π )n/2 −∞ 2π
k =1
 
x2 x2 n
1 −1 1 +···+ n
1−a2 1−a2
2
Y
= √ e 1 n (1 − a2k )−1/2
(2π )n/2 2π
k =1
   
2 a2 a2 x1 a1
w∞ − m2 1+ 1 +···+ n +2m +···+ xn an2
1−a2 1−a2 2(1−a2 ) 2(1−an )
e 1 n 1 dm
−∞

" 323

This version: June 9, 2023


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

 
x2 x2
2 
 
1
−2 1 +···+ n 1 x1 a1 xn an
1−a2 1−a2
1−a2
+···+ 1−a2
e 1 n
2 1 n
= p exp 

a2 a2
(2π )n (1 − a21 ) · · · (1 − a2n )

1+ 1
1−a2
+···+ n
1−a2
1 n
 −1/2
a21 a2n
× 1+ +···+
1 − a21 1 − a2n
 
x2 x2
−1 1 +···+ n 2 !
2 1−a2 1−a2

e 1 n 1 x1 a1 xn an
= p exp +···+
(2π )n α2 (1 − a21 ) · · · (1 − a2n ) 2α2 1 − a21 1 − a2n
 
x2 x2
−1 1 +···+ n 2 !
2 1−a2 1−a2

e 1 n 1 x1 a1 xn an
= p exp +···+
(2π )n α2 (1 − a21 ) · · · (1 − a2n ) 2α2 1 − a21 1 − a2n
    
x2 a2 x2 a2
−1 1 1− 1 +···+ n 1− n !
2 1−a2 α2 (1−a2 ) 1−a2 α2 (1−a2
n)
e 1 1 n 1 X xp xl ap al
= exp
2α2 (1 − a2p )(1 − a2l )
p
(2π )n α2 (1 − a21 ) · · · (1 − a2n ) 1⩽p̸=l⩽n
1 1 −1
= p e− 2 ⟨x,Σ x⟩
,
(2π )n det Σ

where
a21 a2n
α2 : = 1 + +···+ ,
1 − a21 1 − a2n
and
α2 (1−a21 )−a21
 
−a1 a2 −a1 an
(1−a21 )2 (1−a21 )(1−a22 )
··· (1−a21 )(1−a2n )

..


α2 (1−a22 )−a22 .. 
 −a2 a1 . .

 (1−a22 )(1−a21 ) (1−a22 )2 
1  .. .. .. ..
 
Σ−1 . . .

= 2 . .
α  ..

 .. α2 (1−a2n−1 )−a2n−1 −an−1 an

 . . 
 (1−a4n−1 ) (1−a2n−1 )(1−a2n ) 
..
 
−an an−1 2 2
α (1−a )−a 2
−an a1 .
 
n n
(1−a2n )(1−a21 ) (1−a2n )(1−a2n−1 ) (1−a2n )2

Exercise 9.4 We have


1 a1 a2
 
Σ= ,
a2 a1 1
and letting

a21 a22
α2 : = 1 + +
1 − a21 1 − a22

324 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

(1 − a21 )(1 − a22 ) + a21 (1 − a22 ) + a22 (1 − a21 )


=
(1 − a21 )(1 − a22 )
1 − a2 a1
2 2
= ,
(1 − a21 )(1 − a22 )

we find
 α2 (1−a2 )−a2 
1 
1
(1−a21 )2
1
− (1−aa21)(a1−a2
2)
Σ−1 = 2 1
α2 (1−a22 )−a22
2 
α − (1−aa22)(a1−a
1
2) ( 1−a 2 )2
2 1 2
(1−a22 )a21
 2   
α
1  1−a1 2 1 − 2
1−a2 a12 − (1−aa21)(a1−a
2
2)
= 2  1 2
(1−a21 )a22

α α2
− (1−aa22)(a1−a
1
2) 1−a2 2 1 − 2
1−a2 a1 2
2 1
α2
 
a1 a2
1 2
1−a2 a1 2 − 2
(1−a1 )(1−a2 )  2
= 2 α2
α − (1−aa22)(a1−a
1
2) 1−a22 a21
2 1
α2
 
(1 − a21 )(1 − a22 )  1−a22 a21
− (1−aa21)(a1−a
2
2)
= 1
α2
2 
1 − a22 a21 − (1−aa22)(a1−a
1
2) 2 a2
2 1 1−a 2 1
α2
 
1  1−a22 a21
− (1−aa21)(a1−a2
2)
= 2 1
α2
2 
α − (1−aa22)(a1−a
1
2) 1−a 2 a2
 2 1
 2 1
1 1 −a1 a2
= .
1 − a22 a21 −a1 a2 1

In particular, the case n = 2 is able to recover all two-dimensional copulas


by setting the correlation coefficient ρ = a1 a2 . In the general case, Σ is
parametrized by n numbers, which offers less degrees of freedom compared
with the joint Gaussian copula correlation method which relies on n(n − 1)/2
coefficients, see also Exercise 9.3.

Chapter 10

Exercise 10.1 By absence of arbitrage we have (1 − α)erd T = erT , hence


α = 1 − e(r−rd )T .

Exercise 10.2
a) The bond payoff 1{τ >T −t} is discounted according to the risk-free rate,
before taking
 expectation.
b) We have E 1{τ >T −t} = e−λ(T −t) , hence Pd (t, T ) = e−(λ+r )(T −t) .


c) We have PM (t, T ) = e−(λ+r )(T −t) , hence λ = −r − T 1−t log PM (t, T ).

" 325

This version: June 9, 2023


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

Exercise 10.3
a) Use the fact that (rt , λt )t∈[0,T ] is a Markov process.
b) Use the tower property of the conditional expectation given Ft .
c) Writing F (t, rt , λt ) = P (t, T ), we have
 rt 
d e− 0 (rs +λs )ds P (t, T )
rt rt
(rs +λs )ds (rs +λs )ds
= −(rt + λt )e− 0 P (t, T )dt + e− 0 dP (t, T )
rt rt
− (r +λs )ds − (r +λs )ds
= −(rt + λt )e 0 s P (t, T )dt + e 0 s dF (t, rt , λt )
rt rt
− (r +λs )ds − (r +λs )ds ∂F
= −(rt + λt )e 0 s P (t, T )dt + e 0 s (t, rt , λt )drt
∂x
rt 1 rt ∂2F
(rs +λs )ds ∂F
+ e− 0 (t, rt , λt )dλt + e− 0 (rs +λs )ds 2 (t, rt , λt )σ12 (t, rt )dt
∂y 2 ∂x
1 − r t (rs +λs )ds ∂ 2 F
+ e 0 (t, rt , λt )σ22 (t, λt )dt
2 ∂y 2
rt ∂2F rt ∂F
+ e− 0 (rs +λs )ds ρ (t, rt , λt )σ1 (t, rt )σ2 (t, λt )dt + e− 0 (rs +λs )ds (t, rt , λt )dt
∂x∂y ∂t
rt ∂F r t ∂F
(1) (2)
= e− 0 (rs +λs )ds (t, rt , λt )σ1 (t, rt )dBt + e− 0 (rs +λs )ds (t, rt , λt )σ2 (t, λt )dBt
∂x ∂y
rt 
∂F
+ e− 0 (rs +λs )ds −(rt + λt )P (t, T ) + (t, rt , λt )µ1 (t, rt )
∂x
∂F 1 ∂2F 1 ∂2F
+ (t, rt , λt )µ2 (t, λt ) + (t, rt , λt )σ12 (t, rt ) + (t, rt , λt )σ22 (t, λt )
∂y 2 ∂x2 2 ∂y 2
∂2F

∂F
+ρ (t, rt , λt )σ1 (t, rt )σ2 (t, λt ) + (t, rt , λt ) dt,
∂x∂y ∂t

hence the bond pricing PDE is


∂F
− (x + y )F (t, x, y ) + µ1 (t, x) (t, x, y )
∂x
∂F 1 ∂2F
+ µ2 (t, y ) (t, x, y ) + σ12 (t, x) 2 (t, x, y )
∂y 2 ∂x
1 2 ∂2F ∂2F ∂F
+ σ2 (t, y ) 2 (t, x, y ) + ρσ1 (t, x)σ2 (t, y ) (t, x, y ) + (t, rt , λt ) = 0.
2 ∂y ∂x∂y ∂t

d) We have
wt
(1)
rt = −a rs ds + σBt , t ⩾ 0,
0
hence
wt 1 (1) 
rs ds = σBt − rt
0 a

326 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

σ
 wt 
(1) (1)
= Bt − e−(t−s)a dBs
a 0
σ wt −(t−s)a (1)
= (1 − e )dBs ,
a 0
and
wT wT wt
rs ds = rs ds − rs ds
t 0 0
σ wT −(T −s)a (1) σ wt (1)
= (1 − e )dBs − (1 − e−(t−s)a )dBs
a 0 a 0
σ w t −(T −s)a wT 
(1) (1)
= − (e − e−(t−s)a )dBs + (e−(T −s)a − 1)dBs
a 0 t
σ −(T −t)a wt σ w T −(T −s)a
−(t−s)a (1) (1)
= − (e − 1) e dBs − (e − 1)dBs
a 0 a t
1 w
σ T −(T −s)a (1)
= − (e−(T −t)a − 1)rt − (e − 1)dBs .
a a t
The answer for λt is similar.
e) As a consequence of the previous question we have
w wT 
T
E rs ds + λs ds Ft = C (a, t, T )rt + C (b, t, T )λt ,
t t

and
w wT 
T
Var rs ds +λs ds Ft =
t t
w  w 
T T
= Var rs ds Ft + Var λs ds Ft
t t
w wT 
T
+2 Cov Xs ds, Ys ds Ft
t t

σ 2 w T −(T −s)a
= 2 (e − 1)2 ds
a t
w
ση T −(T −s)a
+2ρ (e − 1)(e−(T −s)b − 1)ds
ab t
η 2 w T −(T −s)b
+ 2 (e − 1)2 ds
b t
wT wT
= σ2 C 2 (a, s, T )ds + 2ρση C (a, s, T )C (b, s, T )ds
t t
wT
+η 2 C 2 (b, sT )ds,
t

from the Itô isometry.


f) We have

" 327

This version: June 9, 2023


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

  w wT  
T
P (t, T ) = 1{τ >t} E exp − rs ds − λs ds Ft
t t
 w  w 
T T
= 1{τ >t} exp −E rs ds Ft − E λs ds Ft
t t
w wT
1
 
T
× exp Var rs ds + λs ds Ft
2 t t
= 1{τ >t} exp (−C (a, t, T )rt − C (b, t, T )λt )
 2w
η2 w T 2

σ T 2
× exp C (a, s, T )ds + C (b, s, T )e−(T −s)b ds
2 t 2 t
 wT 
× exp ρση C (a, s, T )C (b, s, T )ds .
t

g) This is a direct consequence of the answers to Questions (c) and f.


h) The above analysis shows that
  w  
T
P(τ > T | Gt ) = 1{τ >t} E exp − λs ds Ft
t

η2 w T 2
 
= 1{τ >t} exp −C (b, t, T )λt + C (b, s, T )ds ,
2 t

for a = 0 and
 w
σ2 w T 2
    
T
E exp − rs ds Ft = exp −C (a, t, T )rt + C (a, s, T )ds ,
t 2 t

for b = 0, and this implies


 wT 
Uρ (t, T ) = exp ρση C (a, s, T )C (b, s, T )ds
t
 ση 
= exp ρ (T − t − C (a, t, T ) − C (b, t, T ) + C (a + b, t, T )) .
ab
i) We have


f (t, T ) = −1{τ >t} log P (t, T )
∂T
σ2 η2
 
= 1{τ >t} rt e−(T −t)a − C 2 (a, t, T ) + λt e−(T −t)b − C 2 (b, t, T )
2 2
−1{τ >t} ρσηC (a, t, T )C (b, t, T ).

j) We use the relation


  w  
T
P(τ > T | Gt ) = 1{τ >t} E exp − λs ds Ft
t

328 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

η2 w T 2
 
= 1{τ >t} exp −C (b, t, T )λt + C (b, s, T )ds
2 t
rT
= 1{τ >t} e− t
f2 (t,u)du
,

where f2 (t, T ) is the Vasicek forward rate corresponding to λt , i.e.

η2 2
f2 (t, u) = λt e−(u−t)b − C (b, t, u).
2
k) In this case we have ρ = 0 and
  w  
T
P (t, T ) = P(τ > T | Gt )E exp −
Estimating Default Probabilities with Credit Default Swaps
rs ds Ft ,
t
In order to compute the implied default for the shortest maturity, the 6-month CDS spread for McDonald’s
Corp is extracted from Bloomberg as shown in the first screenshot below. The current market convention is for
the premium to be fixed at 100bps with an upfront cash payment to settle the difference in value between the
since U (t, T ) = 0.
premium leg and the protection leg. However, the Bloomberg CDS valuation page computes the equivalent
premiumρ for the 6m CDS to be valued at zero at trade. The premium is computed to be 10.79bps.
In order to calculate the default rate, the discount rates are needed for each premium payment date.
Fortunately, Bloomberg provides the discount rates as well as show in the second screenshot. The following
Chapter 11
assumptions are also made to simplify the calculation:

1) Fixed recovery rate of 40%


2) Constant default rate for the tenor of the CDS
Exercise
Using11.1
equationFrom
4.3 fromthe terminal
the Correlated data
Default notes, of
the Figure
default rate S.10 onwithMcDonald’s
is solved Corp,
a solver (see attached

we infer
which T
0.10790%,
= close
S isi very 1
t = Apr 12, 2015, Ti =model
to that determined by the Bloomberg valuation
Marat 20, 2015, ρ = 40%.
Excel file). The value λ is found to be 0.001798747. This gave an implied default probability of 0.001246026
0.0013 as shown in the first
screen shot.

Fig. S.10: Cashflow data.

Next, from the discount factors of Figure S.11 we solve the Equation (11.4)
numerically in Table 13.1 below to find the default rate λ1 = 0.0017987468
and default probability 0.0012460256, which is consistent with the value of
0.0013 in Figure S.10, see also Castellacci (2008).

" 329

This version: June 9, 2023


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

Date Delta Discount Factor Premium Leg Protection Leg


Jun 22, 2015 0.2611111 0.99952277 0.0002814722 0.0002814708
Sep 21, 2015 0.2527778 0.99827639 0.0002721533 0.000272154
Dec 21, 2015 0.2527778 0.99607821 0.0002715541 0.0002715548
Sum 0.0008251796 0.0008251796

Table 13.1: CDS Market data.

Fig. S.11: CDS Price data.

Exercise 11.2
a) By equating the protection and premium legs, we find
j−1 j−1
P (t, Tk+1 ) (Q(t, Tk ) − Q(t, Tk+1 )) = Sti,j
X X
(1 − ξ ) δk P (t, Tk+1 )Q(t, Tk+1 ).
k =i k =i

For j = i + 1 this yields

(1 − ξ )P (t, Ti+1 ) (Q(t, Ti ) − Q(t, Ti+1 )) = Sti,i+1 δi P (t, Ti+1 )Q(t, Ti+1 ),

hence
1−ξ
Q(t, Ti+1 ) = ,
Sti,i+1 δi + 1 − ξ
with Q(t, Ti ) = 1, and the recurrence relation

330 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

j−1
X
(1 − ξ )P (t, Tj +1 ) (Q(t, Tj ) − Q(t, Tj +1 )) + (1 − ξ ) P (t, Tk+1 ) (Q(t, Tk ) − Q(t, Tk+1 ))
k =i
j−1
= Sti,j δj P (t, Tj +1 )Q(t, Tj +1 ) + Sti,j
X
δk P (t, Tk+1 )Q(t, Tk+1 ),
k =i

i.e.
(1 − ξ )Q(t, Tj )
Q(t, Tj +1 ) =
1 − ξ + Sti,j δj
j−1
P (t, Tk+1 ) (1 − ξ )Q(t, Tk ) − Q(t, Tk+1 ) (1 − ξ ) + δk Sti,j

X
+ .
k =i P (t, Tj +1 )(1 − ξ + Sti,j δj )

b) From the terminal data of Figure S.12 on the Coca-Cola Company

Fig. S.12: CDS Market data.

we find the following spread data and survival probabilities:

Background on Probability Theory


Exercise A.1
a) We have

" 331

This version: June 9, 2023


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

k Maturity Tk St1,k (bp) Q(t, Tk )


1 6M 0.5 10.97 0.999087
2 1Y 1 12.25 0.997961
3 2Y 2 14.32 0.995235
4 3Y 3 19.91 0.990037
5 4Y 4 26.48 0.982293
6 5Y 5 33.29 0.972122
7 7Y 7 52.91 0.937632
8 10Y 10 71.91 0.880602

Table 13.2: Spread and survival probabilities.

X X λk
E[X ] = kP(X = k ) = e−λ k
k!
k ⩾0 k ⩾0

−λ
X λk X λk
=e = λe−λ = λ.
(k − 1) ! k!
k⩾1 k ⩾0

b) We have
X
E[X 2 ] = k 2 P(X = k )
k ⩾0
X λk
= e−λ k2
k!
k⩾1
X λk
= e−λ k
(k − 1) !
k⩾1

−λ
X λk X λk
=e + e−λ
(k − 2) ! (k − 1) !
k⩾2 k ⩾1
X λk X λk
= λ2 e−λ + λe−λ
k! k!
k⩾0 k⩾0
2
= λ + λ,

and
Var[X ] = E[X 2 ] − (E[X ])2 = λ = E[X ].

Exercise A.2 We have


w∞ 2 / (2η 2 ) dy
P(eX > c) = P(X > log c) = e−y
2πη 2
p
log c

332 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

w∞ 2 /2 dy
= e−y √ = 1 − Φ((log c)/η ) = Φ(−(log c)/η ).
(log c)/η 2π

Exercise A.3
a) Using the change of variable z = (x − µ)/σ, we have
w∞ 1 w∞ 2 / (2σ 2 )
φ(x)dx = √ e−(x−µ) dx
−∞ 2πσ 2 −∞
1 w∞
−y 2 /(2σ 2 )
= √ e dy
2πσ 2 −∞
1 w ∞ 2
= √ e−z /2 dz.
2π −∞
Next, using the polar change of coordinates dxdy = rdrdθ, we find∗

1 w ∞ −z 2 /2 1 w ∞ −y2 /2 w ∞ −z 2 /2
 2
√ e dz = e dy e dz
2π −∞ 2π −∞ −∞
w w
1 ∞ ∞ −(y2 +z 2 )/2
= e dydz
2π −∞ −∞
1 w 2π w ∞ −r2 /2
= re drdθ
w2π 0 0 ∞ 2
= re−r /2 dr
0
wR 2
= lim re−r /2 dy
R→+∞ 0
h 2 /2
iR
= − lim e−r
R→+∞ 0
2 /2
= lim (1 − e−R )
R→+∞
= 1,

or w∞ √
2 /2
e−z dz = 2π.
−∞

b) We have
w∞
E[X ] = xφ(x)dx
−∞
1 w∞ 2 2
= √ xe−(x−µ) /(2σ ) dx
2πσ −∞
2


“In a discussion with Grothendieck, Messing mentioned the formula expressing the
2
integral of e−x in terms of π, which is proved in every calculus course. Not only did
Grothendieck not know the formula, but he thought that he had never seen it in his
life”. Milne (2005).

" 333

This version: June 9, 2023


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

1 w∞ 2 / (2σ 2 )
= √ (µ + y )e−y dx
2πσ 2 −∞
µ w ∞ −y2 /2 σ w ∞ 2
= √ e dy + √ ye−y /2 dy
2π −∞ 2π −∞
µ w ∞ −y 2 /2 σ wA 2
= √ e dy + √ lim ye−y /2 dy
2π −∞ 2π A→ + ∞ −A
µ w ∞ −y2 /2
= √ e dy
2π −∞
w∞
= µ φ(y )dy
−∞
= µP(X ∈ R)
= µ,
2
by symmetry of the function y 7−→ ye−y /2 on R.
c) Similarly, by integration by parts twice on R, we find
w∞
E[(X − E[X ])2 ] = (x − µ)2 φ(x)dx
−∞
1 w∞ 2 2
= √ y 2 e−(y−µ) /(2σ ) dy
2πσ 2 −∞
σ2 w ∞ 2
= √ y × ye−y /2 dy
2π −∞
σ 2 w ∞ −y2 /2
= √ e dy
2π −∞
=σ .
2

d) By a completion of squares argument, we have


w∞
E[eX ] = ex φ(x)dx
−∞
1 w∞ 2 2
= √ ex−(x−µ) /(2σ ) dx
2πσ 2 −∞
eµ w ∞ y−y2 /(2σ2 )
= √ e dy
2πσ 2 −∞
eµ w ∞ σ 2 /2+(y−σ 2 )2 /(2σ 2 )
= √ e dy
2πσ 2 −∞
eµ + σ 2 /2 w ∞ x2 /(2σ2 )
= √ e dy
2πσ 2 −∞

σ 2
= eµ + .
2

Exercise A.4
a) We have
334 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

1 w∞ 2 / (2/σ 2 )
E[X + ] = √ x+ e−x dx
2πσ 2 −∞
σ w ∞ −x2 /2
= √ xe dx
2π 0
σ h 2
i x = ∞
= √ −e−x /2
2π x=0
σ
= √ .

b) We have
1 w∞ 2 / (2σ 2 )
E[(X − K )+ ] = √ (x − K )+ e−x dx
2πσ 2 −∞
1 w∞ 2 / (2σ 2 )
= √ (x − K )e−x dx
2πσ 2 K
1 w∞ 2 / (2σ 2 ) K w∞ 2 2
= √ xe−x e−x /(2σ ) dx
dx − √
2πσ 2 K 2πσ 2 K
σ h −x2 /(2σ2 ) i∞ K w −K/σ −x2 /2
= √ −e −√ e dx
2π x=K 2π −∞
 
σ 2 2 K
= √ e−K /(2σ ) − KΦ − .
2π σ

c) Similarly, we have
1 w∞ 2 / (2σ 2 )
E[(K − X )+ ] = √ (K − x)+ e−x dx
2πσ 2 −∞
1 wK
−x2 /(2σ 2 )
= √ (K − x)e dx
2πσ 2 −∞
K wK 2 / (2σ 2 ) 1 wK 2 / (2σ 2 )
= √ e−x dx − √ xe−x dx
2πσ 2 −∞ 2πσ 2 −∞
K w K/σ −x2 /2 σ h −x2 /(2σ2 ) ix=K
= √ e dx − √ −e
2π −∞ 2π −∞
 
σ −K 2 /(2σ )2 K
= √ e + KΦ .
2π σ

" 335

This version: June 9, 2023


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

336 "

This version: June 9, 2023


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

σ-algebra, 246 put options, 131


σ-field, 246 bond
p-quantile, 147 defaultable, 219
code, 8, 10, 12–15, 17, 45, 60, 68, pricing PDE, 326
72, 73, 75, 79, 101–104, 117, 128, Borel-Cantelli Lemma, 250
129, 131, 132, 170, 186, 188–190, Brent, 117
192–194, 264, 266, 283, 308, 309, 313 Brownian
motion, 6
adapted process, 216 series construction, 7
adjusted close price, 9, 14 business risk, v
aggregate claim amount, 80, 88 buy back guarantee, 114
Ali-Mikhail-Haq copula, 297
annuity call
numéraire, 228 option, 114
arbitrage cash settlement, 115, 117
opportunity, 305 catastrophe risk, v
price, 121 Cauchy
AUC - Area Under the Curve, 191 distribution, 257
autocovariance, 42 causal, 32
causation, 91
backtesting, 58 CDF, 142
Bank for International Settlements, 115, CDO, 231
227 CDS, 227
Basel II, 237 characteristic
Bayes formula, 180 function, 272
Bernoulli Chebyshev inequality, 89
random walk, 3 coherent risk measure, 140
Bernoulli distribution, 260 cointegration, 57
binomial collar option, 117
distribution, 261 costless, 120
binomial logistic regression, 187 collateralized debt obligation, 231
BIS, 115, 227 complement rule, 249
bivariate exponential, 106 complex unit circle, 43, 285
bivariate Gaussian, 93 compound Poisson
Black-Cox model, 203, 208 process, 73
Black-Scholes conditional
formula, 127 expectation, 138, 160, 265, 274

337
N. Privault

probability, 250, 251 binomial, 261


survival probability, 213 bivariate exponential, 106
tail expectation, 161 Cauchy, 257
Value at Risk, 161 discrete, 260
conditional tail expectation exponential, 257
Gaussian, 163 gamma, 257
conditional Value at Risk, 160 Gaussian, 256
conditioning, 250 geometric, 261
Consumer Price Index, 9 Gumbel bivariate, 106
contract lognormal, 16, 258
credit default, 211 marginal, 268
copula, 105 negative binomial, 261
Ali-Mikhail-Haq, 297 Pareto, 155, 306
exponential, 106 Pascal, 261
survival, 107 Poisson, 261
correlation, 91 stable, 24
costless collar option, 120 uniform, 256
counterparty risk, v diversification, 141
counting process, 65, 67 domino effect, 206
covariance, 42
Cox process, 69 enlargement of filtration, 219
Cox-Ross-Rubinstein model, 128 entitlement ratio, 116
Cramér-Lundberg model, 81 equity holder, 200
credit default ES
reduced-form approach, 213 Gaussian, 165
structural approach, 199 event, 246
credit default contract, 211 event risk, v
credit default swap, 227, 229 excess kurtosis, 21
credit valuation, 227 exercise price, 113
adjustment, 239 expectation, 262
cross-covariance, 42 conditional, 138, 160, 265, 274
CRR model, 128 Expected Shortfall, 164
CTE Gaussian, 165
Gaussian, 163 expected value premium principle, 138
cumulative distribution function, 142, 256 exponential
joint, 259 distribution, 71, 215, 257
CVA, 239
CVaR, 161 failure rate, 214
False Positive Rate, 190
default rate, 215 Fatou’s lemma, 272
defaultable bonds, 223 filtration
Delta, 129, 130, 132 enlargement of, 219
density financial risk, v
function, 255 formula
marginal, 259 Bayes, 180
derivatives four-way collar option, 117
market, 115 FPR, 190
Dickey-Fuller test, 46
discrete distribution, 260 gamma
dispersion index, 68 distribution, 257
distorted risk measure, 160, 165 function, 257
distortion function, 141, 161, 165 Gaussian
distribution bivariate, 93
Bernoulli, 260 conditional tail expectation, 163

338 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

distribution, 16, 256 liability, 120, 138


Expected Shortfall, 165 likelihood ratio, 182
random variable, 273 log
Value at Risk, 152 variance, 16
generalized inverse, 95, 149 log variance, 16
generating function, 273 log-returns, 9, 12
geometric logistic regression, 187
Brownian motion, 8 logit, 188
distribution, 261 lognormal
Greeks distribution, 16, 258
Delta, 129, 130, 132 long box spread option, 136, 305
gross market value, 115, 227
gross world product, 112, 115 macro-economic shock, 107
guarantee marginal
buy back, 114 density, 259
price lock, 116 distribution, 268
guaranteed maturity benefits, 87 market
Gumbel bivariate logistic distribution, log-returns, 9, 12
106 returns, 9, 12
GWP, 112, 115 Marshall-Olkin bivariate exponential, 106
maturity, 113
hedge ratio, 56 mean-square distance, 277
heteroskedasticity, 38 measure
historical measure, 199 historical, 199
HJM physical, 199
model, 218 model
Cramér-Lundberg, 81
implied moment
probability, 123 generating function, 273
independence, 139, 250, 252, 255, 260, moving average, 32
261, 266, 273, 278
indicator function, 138, 253 natural logarithm, 16
infimum, 261 negative
insolvency, 147 binomial distribution, 261
Internal Ratings-Based formula, 237 net present value, 238
investment risk, v neural network, 193
IPython notebook, 121, 128, 194 non-causal, 32
IRB formula, 237 normal
conditional tail expectation, 163
Japan/U.S. Foreign Exchange Rate, 9 Expected Shortfall, 165
joint Value at Risk, 152
cumulative distribution function, 259 notional, 229
probability density function, 258 notional amount, 115, 227
NPV, 238
key lemma, 218
KPSS test, 48 OLS, 55
kurtosis, 21, 23 operational risk, v
option
lag operator, 30, 31, 34 issuer, 121
law long box spread, 136, 305
of total expectation, 268 writer, 121
of total probability, 249, 252, 268 zero-collar, 120
least square regression, 55
leptokurtic distribution, 22 pair trading, 54

" 339

This version: June 9, 2023


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

Pareto distribution, 155, 306 reduced-form approach, 213


partition, 252, 275 regression
Pascal distribution, 261 logistic, 187
payoff function, 114, 116 renewal processes, 73
physical delivery, 115, 117 reserve process, 80
physical measure, 199 risk measure, 137
Poisson coherent, 140
compound martingale, 73 expected value, 138
distribution, 261 pure premium, 138, 141
process, 65, 215 quantile, 142
portfolio standard deviation, 138
value, 127 superhedging, 135
premium, 56 risk-neutral
pure, 141 measure, 123
price probabilities, 123
graph, 114, 116, 118 riskless asset, 12, 126
price lock guarantee, 116 ROC, 190
probability
acceptance curve, 180 Sim.DiffProc, 15
conditional, 250, 251 skewness, 21, 23
default curve, 180, 194 Sklar’s theorem, 97
density function, 255 solvency, 147
joint, 258 spread, 56
distribution, 254 SRM, 135
measure, 249 St. Petersburg paradox, 265
sample space, 245 stable
space, 250 distribution, 24
probability default curve, 196 standard deviation premium principle,
process 138
counting, 65 stationary
Cox, 69 strictly, 41
pure premium, 138 weakly, 43
put stochastic
option, 112 default, 215
Python code, 121, 128, 194 stopping time, 216
strictly stationary, 41
quantile risk measure, 142 strike price, 113
quantmod, 9, 14, 48 strong Markov property, 71
structural approach, 199
R package superhedging risk measure, 135
quantmod, 9, 14, 48 surplus process, 80
Sim.DiffProc, 15 survival copula, 107
tseries, 47 survival probability, 213
random
product, 270 Tail Value at Risk, 160, 176
sum, 269 telescoping sum, 35
variable, 253 tenor structure, 221, 227
random forest, 194 test
rate Dickey-Fuller, 46
default, 215 KPSS, 48
Receiver Operating Characteristics theorem
(ROC), 190 Sklar, 97
recovery rate, 219, 220 tower property, 268, 272, 278, 326
recovery value, 203 TPR, 190

340 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

True Positive Rate (TPR), 190 variance, 269


tseries, 47
warrant, 116
uniform distribution, 256 weakly stationary, 43
unit West Texas Intermediate (WTI), 112, 117
circle, 43 white noise, 29
root test, 43 Wiener space, 5
unit circle, 285

Value at Risk, 147 XGBoost, 194


Gaussian, 152 XVA, 238
tail, 160, 176
Value at Risk conditional, 160 zero-
VaR, 147 collar option, 120

" 341

This version: June 9, 2023


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

342 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

Author index

Aas, K. 237 Hamilton, J.D. 47


Aristotle 111 Hardy, M.R. 138
Hofert, M. 95, 149
Bachelier, L. 5 Huang, J.Z. 220
Bhatia, M. 207 Hull, J. 208
Black, F. 203 Hurd, T.-R. 199, 203
Bosq, D. 67
Boulding, K.E. 12 Ignatova, G. 85
Brigo, D. 240 Ishikawa, K. 61
Brockwell, P.J. 43
Brown, R. 5 Jacod, J. 219, 245
Jarrow, R. 216
Castellacci, G. 231, 241, 329 Jasiak, J. v
Charlier, C.V.L. 25 Jeanblanc, M. 217, 219
Chen, R.R. 220 Jeulin, Th. 219
Cheng, X. 220 Jones, S. 208
Chourdakis, K. 240
Çınlar, E. 255 Kaishev, V. 85
Cox, J.C. 203 Kallenberg, O. 278
Cramér, H. 25 Krachunov, R. 85
Krehbiel, T. 208
Davis, R.A. 43
Lando, D. 216
De Vylder, F. 85
Lee, S. 208
Dellacherie, C. 217
Lefèvre, C. 85
Devore, J.L. 245
León, J.A. 86
Dickey, D. 47, 57
Li, D.X. 206, 209
Dozzi, M. 86
Li, W.P. 208
Liu, B. 220
Einhorn, D. 159 Loève, M. 97
Elliott, R.J. 217, 219 Loisel, S. 85
Embrechts, P. 95, 149
Enders, W. 57 Maisonneuve, B. 217
Engle, R.F. 57 Masetti, M. 240
Menn, C. 216
Fabozzi, F. 220 Merton, R.C. 199, 208, 237
Finger, C.C. 207 Meyer, P.A. 217
Folland, G.B. 6 Milne, J.S. 333
Fuller, W. 47, 57 Mina, J. 153

Gibson, M. 208 Nguyen, H.T. 67


Gourieroux, C. v Norris, J.R. 71
Gram, J.P. 25
Granger, C.W.J. 57 Picard, D. 85
Grasselli, M.R. 199, 203 Pitman, J. 245
Guo, X. 216 Poisson, S.D. 65
Gupton, G.M. 207 Pourahmadi, M. 43

" 343

This version: June 9, 2023


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

Protter, P. 217, 245 UCLES, MOE & 43, 180, 253

Revuz, D. 6 Vallois, P. 86
Rullière, D. 85 Vašiček, O. 208, 237
Villa, J. 86
Salmon, F. 208
Shreve, S. 204 Watanabe, T. 25
Slark, M. 97 Wei, X. 85
Stroock, D.W. 277 White, A. 208

Takayanagi, S. 61 Xiao, J.Y. 153


Tanaka, K. 25
Thales 112 Yamada, T. 25
Thiele, T.N. 24 Yor, M. 6, 217, 219

344 "

This version: June 9, 2023


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

[1] K. Aas. The basel II IRB approach for credit portfolios: A survey.
Note No SAMBA/33/05, Norwegian Computing Center, 2005. (Cited
on page 237).
[2] C. Acerbi and D. Tasche. On the coherence of expected shortfall.
Preprint arXiv:cond-mat/0104295, 2001. (Cited on page 166).
[3] Aristotle. Politics, Book one, Part XI. The Internet Classics Archive, 350
BCE. http://classics.mit.edu/Aristotle/politics.1.one.html. (Cited on
page 111).
[4] L. Bachelier. Théorie de la spéculation. Annales Scientifiques de l’Ecole
Normale Supérieure, Série 3, 17:21–86, 1900. (Cited on pages 5 and 11).
[5] F. Black and J.C. Cox. Valuing corporate securities. Journal of Finance,
31:351–357, 1976. (Cited on page 203).
[6] F. Black and M. Scholes. The pricing of options and corporate liabilities.
J. of Political Economy, 81, 1973. (Cited on page 111).
[7] D. Bosq and H.T. Nguyen. A Course in Stochastic Processes: Stochastic
Models and Statistical Inference. Mathematical and Statistical Methods.
Kluwer, 1996. (Cited on page 67).
[8] K.E. Boulding. In “Energy Reorganization Act of 1973. Hearings,
Ninety-third Congress, first session, on H.R. 11510”. U.S. Government
Printing Office, Washington, 1973. (Cited on page 12).
[9] D. Brigo and K. Chourdakis. Counterparty risk for credit default swaps:
impact of spread volatility and default correlation. Int. J. Theor. Appl.
Finance, 12(7):1007–1026, 2009. (Cited on page 240).
[10] D. Brigo and M. Masetti. Risk neutral pricing of counterparty risk. In
M. Pykhtin, editor, In Counter-party Credit Risk Modeling: Risk Man-
agement, Pricing and Regulation, London, 2006. Risk Books. (Cited on
page 240).
[11] R. Brown. A brief account of microscopical observations made in the
months of June, July and August, 1827, on the particles contained in
the pollen of plants; and on the general existence of active molecules in

345
N. Privault

organic and inorganic bodies. Philosophical Magazine, 4:161–173, 1828.


(Cited on page 5).
[12] G. Castellacci. Bootstrapping credit curves from CDS spread curves.
Available at https://dx.doi.org/10.2139/ssrn.2042177, 2008. (Cited on
pages 231, 241, and 329).
[13] C.V.L. Charlier. Frequency curves of type A in heterograde statistics.
Ark. Mat. Astr. Fysik, 9(25):1–17, 1914. (Cited on page 25).
[14] R.-R. Chen and J.-Z. Huang. Credit spread bounds and their implica-
tions for credit risk modeling. Working paper, Rutgers University and
Penn State University, 2001. (Cited on page 220).
[15] R.-R. Chen, X. Cheng, F.J. Fabozzi, and B. Liu. An explicit, multi-
factor credit default swap pricing model with correlated factors. Journal
of Financial and Quantitative Analysis, 43(1):123–160, 2008. (Cited on
page 220).
[16] E. Çınlar. Probability and stochastics, volume 261 of Graduate Texts in
Mathematics. Springer, New York, 2011. (Cited on page 255).
[17] M. Clark. Trillion Dollar Bet. PBS Nova Documentaries, 2000. (Cited
on page 11).
[18] H. Cramér. Mathematical methods of statistics. Princeton University
Press, Princeton, NJ, 1946. (Cited on page 25).
[19] P.J. Brockwell R.A. Davis. Time series: theory and methods. Springer
Series in Statistics. Springer-Verlag, New York, second edition, 1991.
(Cited on page 43).
[20] F. De Vylder. Numerical finite-time ruin probabilities by the Picard-
Lefèvre formula. Scand. Act. J., 2:97–105, 1999. (Cited on page 85).
[21] C. Dellacherie, B. Maisonneuve, and P.A. Meyer. Probabilités et Poten-
tiel, volume 5. Hermann, 1992. (Cited on page 217).
[22] J. L. Devore. Probability and Statistics for Engineering and the Sciences.
Duxbury Press, sixth edition edition, 2003. (Cited on page 245).
[23] M. Dozzi and P. Vallois. Level crossing times for certain processes with-
out positive jumps. Bull. Sci. Math., 121(5):355–376, 1997. (Cited on
page 86).
[24] D. Duffie and K.J. Singleton. Credit risk. Princeton Series in Finance.
Princeton University Press, Princeton, NJ, 2003. (Cited on page 219).
[25] A. Einstein. Über die von der molekularkinetischen Theorie der Wärme
geforderte Bewegung von in ruhenden Flüssigkeiten suspendierten
Teilchen. Annalen der Physik, 17:549–560, 1905. (Cited on page 5).
[26] R.J. Elliott and M. Jeanblanc. Incomplete markets with jumps and
informed agents. Math. Methods Oper. Res., 50(3):475–492, 1999. (Cited
on page 219).
[27] R.J. Elliott, M. Jeanblanc, and M. Yor. On models of default risk. Math.
Finance, 10(2):179–195, 2000. (Cited on page 217).
[28] P. Embrechts and M. Hofert. A note on generalized inverses. Math.
Methods Oper. Res., 77(3):423–432, 2013. (Cited on pages 95 and 149).

346 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

[29] W. Enders. Applied Econometric Time Series. Wiley, 2009. (Cited on


page 57).
[30] R.F. Engle and C.W.J. Granger. Co-integration and error correction:
Representation, estimation, and testing. Econometrica, 55(2):251–276,
1987. (Cited on page 57).
[31] G. B. Folland. Real analysis. Pure and Applied Mathematics (New
York). John Wiley & Sons Inc., New York, second edition, 1999. (Cited
on page 6).
[32] M. Gibson. Understanding the risk of synthetic CDOs. Federal Reserve
Board Working paper, 2004. (Cited on page 208).
[33] C. Gourieroux and J. Jasiak. Financial Econometrics: Problems, Models,
and Methods. Princeton Series in Finance. Princeton University Press,
USA, 2001. (Cited on page v).
[34] J.P. Gram. Über die Entwicklung reeller Funktionen in Reihen mittelst
der Methode der kleinsten Quadraten. J. Reine Angew. Math, 94:41–73,
1883. (Cited on page 25).
[35] M.R. Grasselli and T.-R. Hurd. Credit risk modeling. Lecture notes,
McMaster University, 2010. (Cited on pages 199 and 203).
[36] X. Guo, R. Jarrow, and C. Menn. A note on Lando’s formula and
conditional independence. Preprint, 2007. (Cited on pages 216 and 219).
[37] G.M. Gupton, C.C. Finger, and M. Bhatia. Creditmetrics: technical
document. JP Morgan & Co., 1997. (Cited on page 207).
[38] J.D. Hamilton. A new approach to the economic analysis of non-
stationary time series. Econometrica, 57:357–384, 1989. (Cited on
page 46).
[39] J.D. Hamilton. Time Series Analysis. Princeton University Press, 1994.
(Cited on page 47).
[40] M.R. Hardy. An introduction to risk measures for actuarial applications.
Study Notes, 2006. (Cited on page 138).
[41] J. Hull and A. White. Valuation of a CDO and an n-th to default CDS
without Monte Carlo simulation. Journal of Derivatives, 12:8–23, 2004.
(Cited on page 208).
[42] G. Ignatova, V. Kaishev, and R. Krachunov. An improved finite-time
ruin probabilities formula and its Mathematica implementation. Insur-
ance Math. Econom., 29:375–386, 2001. (Cited on page 85).
[43] K. Itô. On stochastic differential equations. Mem. Amer. Math. Soc.,
No. 4:51, 1951. (Cited on page 6).
[44] J. Jacod. Grossissement initial, hypothèse (H’) et théorème de Girsanov.
In Th. Jeulin and M. Yor, editors, Grossissements de filtrations: exemples
et applications, volume 1118 of Lecture Notes in Mathematics, pages 6–
14. Springer-Verlag, Berlin, 1985. (Cited on page 219).
[45] J. Jacod and P. Protter. Probability essentials. Springer-Verlag, Berlin,
2000. (Cited on page 245).

" 347

This version: June 9, 2023


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

[46] Th. Jeulin. Semi-martingales et grossissement d’une filtration, volume


833 of Lecture Notes in Mathematics. Springer Verlag, 1980. (Cited on
page 219).
[47] S. Jones. The formula that felled Wall Street. Financial Times Magazine,
April 24, 2009. (Cited on page 208).
[48] R. Kaas, M. Goovaerts, J. Dhaene, and M. Denuit. Modern Actuarial
Risk Theory: Using R. Springer, 2009. (Cited on page 83).
[49] O. Kallenberg. Foundations of Modern Probability. Probability and its
Applications. Springer-Verlag, New York, second edition, 2002. (Cited
on page 278).
[50] D. Lando. On Cox processes and credit risky securities. Review of
Derivative Research, 2:99–120, 1998. (Cited on pages 216 and 219).
[51] S. Lee. Formula from hell. Forbes.com, August 8, 2009. (Cited on
page 208).
[52] J.A. León and J. Villa. On the distributions of the sup and inf of the
classical risk process with exponential claim. Commun. Stoch. Anal., 3
(1):69–84, 2009. (Cited on page 86).
[53] D.X. Li. On default correlation - a copula function approach. The
Journal of Fixed Income, 9(4):43–54, 2000. (Cited on pages 206, 207,
and 209).
[54] W. Li and T. Krehbiel. An improved approach to evaluate default prob-
abilities and default correlations with consistency. Int. J. Theor. Appl.
Finance, 19(5), 2016. (Cited on page 208).
[55] S. Loisel and N. Privault. Sensitivity analysis and density estimation for
finite-time ruin probabilities. J. Comput. Appl. Math., 230(1):107–120,
2009. (Cited on page 85).
[56] R. C. Merton. On the pricing of corporate debt: The risk structure of in-
terest rates. Journal of Finance, 29:449–470, 1974. (Cited on pages 199,
208, and 237).
[57] J.S. Milne. Mathematical apocrypha. https://www.jmilne.org/math/
apocrypha.html, 2005. Accessed: 2020-06-12. (Cited on page 333).
[58] J. Mina and J.Y. Xiao. Return to RiskMetrics: The Evolution of a
Standard. RiskMetrics, 2001. Introduction by Christopher C. Finger.
(Cited on pages 153 and 169).
[59] MOE and UCLES. Mathematics (Syllabus 4048), Singapore-Cambridge
General Certificate of Education Ordinary Level (2018). https://www.
seab.gov.sg/content/syllabus/olevel/2018Syllabus/4048_2018.pdf,
2016. Accessed: 2022-12-28. (Cited on pages 43, 180, and 253).
[60] MOE and UCLES. Mathematics (Syllabus 9758), Singapore-Cambridge
General Certificate of Education Advanced Level Higher 2 (2022). https:
//www.seab.gov.sg/docs/default-source/national-examinations/
syllabus/alevel/2022syllabus/9758_y22_sy.pdf, 2020. Accessed:
2022-12-28. (Cited on pages 43, 180, and 253).

348 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

[61] J.R. Norris. Markov Chains, volume 2 of Cambridge Series in Statistical


and Probabilistic Mathematics. Cambridge University Press, Cambridge,
1998. Reprint of 1997 original. (Cited on page 71).
[62] Basel Committee on Banking Supervision. An explanatory note on the
basel II IRB risk weight functions. July, 2005. (Cited on page 237).
[63] P. Picard and C. Lefèvre. The probability of ruin in finite time with
discrete claim size distribution. Scand. Act. J., 1:58–69, 1997. (Cited on
page 85).
[64] J. Pitman. Probability. Springer, 1999. (Cited on page 245).
[65] M. Pourahmadi. Foundations of time series analysis and prediction the-
ory. Wiley Series in Probability and Statistics: Applied Probability and
Statistics. Wiley-Interscience, New York, 2001. (Cited on page 43).
[66] N. Privault. Understanding Markov Chains. Springer Undergraduate
Mathematics Series. Springer, second edition, 2018. (Cited on page 72).
[67] N. Privault. Introduction to Stochastic Finance with Market Examples
(2nd edition). Financial Mathematics Series. Chapman & Hall/CRC,
2022. (Cited on pages 204, 205, 215, 218, 219, 220, 228, and 322).
[68] N. Privault and X. Wei. A Malliavin calculus approach to sensitivity
analysis in insurance. Insurance Math. Econom., 35(3):679–690, 2004.
(Cited on page 85).
[69] N. Privault and X. Wei. Integration by parts for point processes and
Monte Carlo estimation. J. Appl. Probab., 44:806–823, 2007. (Cited on
page 85).
[70] P. Protter. Stochastic integration and differential equations, volume 21
of Stochastic Modelling and Applied Probability. Springer-Verlag, Berlin,
second edition, 2004. (Cited on page 217).
[71] D. Revuz and M. Yor. Continuous Martingales and Brownian Motion.
Springer-Verlag, 1994. (Cited on page 6).
[72] D. Rullière and S. Loisel. Another look at the Picard-Lefèvre formula for
finite-time ruin probabilities. Insurance Math. Econom., 35(2):187–203,
2004. (Cited on page 85).
[73] F. Salmon. Recipe for disaster: the formula that killed Wall Street.
Wired Magazine, 23 February, 2009. (Cited on page 208).
[74] P.A. Samuelson. Rational theory of warrant pricing. Industrial Manage-
ment Review, 6(2):13–39, 1965. (Cited on page 11).
[75] S.E. Shreve. Stochastic calculus for finance. II. Springer Finance.
Springer-Verlag, New York, 2004. Continuous-time models. (Cited on
page 204).
[76] A. Sklar. Fonctions de répartition a n dimensions et leurs marges [re-
publication of MR0125600]. Ann. I.S.U.P., 54(1-2):3–6, 2010. With an
introduction by Denis Bosq. (Cited on page 97).
[77] M. Sklar. Fonctions de répartition à n dimensions et leurs marges. Publ.
Inst. Statist. Univ. Paris, 8:229–231, 1959. (Cited on page 97).
[78] D.W. Stroock. Probability theory, an analytic view. Cambridge Univer-
sity Press, Cambridge, second edition, 2011. (Cited on page 277).

" 349

This version: June 9, 2023


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

[79] S. Takayanagi and K. Ishikawa. PairTrading: classical pair trading based


on cointegration in finance, 2017. R package version 1.1. (Cited on
page 61).
[80] K. Tanaka, T. Yamada, and T. Watanabe. Applications of Gram-
Charlier expansion and bond moments for pricing of interest rates and
credit risk. Quant. Finance, 10(6):645–662, 2010. (Cited on page 25).
[81] T.N. Thiele. On semi invariants in the theory of observations (Om
Iagttagelseslærens Halvinvarianter). Kjöbenhavn Overs., pages 135–141,
1899. (Cited on page 20).
[82] O. Vašiček. Probability of loss on loan portfolio. KMV Corporation
Technical Report, 1987. (Cited on page 208).
[83] O. Vašiček. Loan portfolio value. Risk Magazine, pages 160–162, 2002.
(Cited on page 237).
[84] N. Wiener. Differential space. Journal of Mathematics and Physics of
the Massachusetts Institute of Technology, 2:131–174, 1923. (Cited on
page 5).
[85] M. Yor. Grossissements de filtration et absolue continuité de noyaux. In
Th. Jeulin and M. Yor, editors, Grossissements de filtrations: exemples et
applications, volume 1118 of Lecture Notes in Mathematics, pages 6–14.
Springer-Verlag, Berlin, 1985. (Cited on page 219).

350 "

This version: June 9, 2023


https://personal.ntu.edu.sg/nprivault/indext.html
Notes on Financial Risk and Analytics

These notes cover some aspects of financial risk and analytics. This in-
cludes classical topics such as Value at Risk (VaR) and Expected Shortfall
(ES), as well as structures of random dependence. Credit default is treated
via defaultable bonds, Credit Default Swaps (CDS) and collateralized debt
obligations (CDOs), based on stochastic calculus. Basic risk theory and credit
scoring are presented with examples in R. The concepts presented are illus-
trated by examples and by 62 exercises with their complete solutions.

" 351

This version: June 9, 2023


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

You might also like