Professional Documents
Culture Documents
Eric Marsden
<eric.marsden@risk-engineering.org>
Warmup. Before reading this material, we
suggest you consult the following associated
slides:
▷ Slides on Modelling correlations with
Python
▷ Slides on Estimating Value at Risk
Available from risk-engineering.org &
slideshare.net
Dependencies and risk: stock portfolios
both stocks
asymmetric days: gain strongly
one up, one down both stocks
gain
“ordinary” days
stock B
both stocks
lose asymmetric days:
one up, one down
both stocks
lose strongly
stock A
Dependencies and risk: life insurance
k defaults
j pays,
▷ Correlation of default: what is the likelihood that if one
company defaults, another will default soon after?
• 𝑟 = 0: default events are independent
k pays,
• perfect positive correlation (r=1): if one company defaults, j defaults
the other will automatically do the same
both j & k
• perfect negative correlation: if one company defaults, the borrower k
default
other will certainly not
5% chance. But if the farm does go under, the chances that the (USA, 1998)
dairy will follow will quickly rise above 5% if the farm was its
main milk supplier.
Dependencies and risk: testing in semiconductor manufacturing
passes test
fails test
Source: Copula Methods in Manufacturing Test: A DRAM Case Study, C. Glenn Shirley & W. Robert Daasch
Dependencies and risk: other applications
▷ Say two risks 𝐴 and 𝐵 have joint probability 𝐻(𝑋, 𝑌 ) and marginal
probabilities 𝐹𝑋 and 𝐹𝑌
• 𝐻(𝑋, 𝑌 ) = 𝐶(𝐹𝑋 , 𝐹𝑌 )
• 𝐶 is a copula function
▷ Characteristics of a copula:
• 𝐶(1, 1) = 1
• 𝐶(𝑥, 0) = 0
• 𝐶(0, 𝑦) = 0
• 𝐶(𝑥, 1) = 𝑥
• 𝐶(1, 𝑦) = 𝑦
Gaussian copula, dimension 2, rho=0.8
PDF CDF
1.0
1.0
3
4 0.9
0.8
0.8
0.8
2
0.7
0.6
0.6
0.6
1
0.5
0.4
0.4
0.4
0.3
2
0.2
0.2
0.2
3
0.1
5
4
6
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
PDF CDF
1.0
10
0.8
8
pCopul
0.6
dCopul
6
4 0.4
a
0.2
a
2
0 0.0
1.0 1.0
0.8 0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 0.8
0.6 0.6
1.0 1.0
0.8 0.4 0.8
0.4
y
y
0.6 0.6
0.2 0.4 x 0.2 0.4 x
0.2 0.2
0.0 0.0 0.0 0.0
Copula representing perfect positive dependence
𝐶(𝑢, 𝑣) = min(𝑢, 𝑣)
1.0
0.8
0.6
0.4
0.2
0.0 0.0
0.2 1.0
0.8
0.4
0.6
0.6
0.4
0.8 0.2
Copula representing perfect negative dependence
𝐶(𝑢, 𝑣) = max(𝑢 + 𝑣 − 1, 0)
1.0
0.8
0.6
0.4
0.2
0.0 0.0
0.2 1.0
0.8
0.4
0.6
0.6
0.4
0.8 0.2
Tail dependence
▷ Risk management is concerned with the tail of the distribution of losses
▷ Large losses in a portfolio are often caused by simultaneous large moves in several
components
𝑓 (𝑥, 𝑦) = Pr(𝑋 = 𝑥, 𝑌 = 𝑦)
▷ Note: examples here are bivariate, but principles are valid for
multivariate distributions
Joint distribution — discrete case
𝑏1 𝑏2 𝑏3 … 𝑏𝑘
… … … … … …
… … … … … …
▷ 𝑓𝑋𝑌 ∶ 𝑅𝑛 → 𝑅
▷ 𝑓𝑋𝑌 ≥ 0 ∀𝑣 ∈ 𝑅𝑛
∞ ∞
▷ ∫−∞ ∫−∞ 𝑓𝑋𝑌 (𝑥, 𝑦) = 1 0.5
𝑃(𝑥1 )
𝑃(𝑥2 )
0.4
▷ Pr(𝑣 ∈ 𝐵) = ∬𝑓𝑋𝑌
𝐵 0.3
𝑃
𝑥 0.2
▷ Pr(𝑋 ≤ 𝑥) = 𝐹𝑋 (𝑥) = ∫−∞ 𝐹𝑋 (𝑧)𝑑𝑧
0.1 4
𝑦
▷ Pr(𝑌 ≤ 𝑦) = 𝐹𝑌 (𝑦) = ∫−∞ 𝐹𝑌 (𝑧)𝑑𝑧 0 2
−1
−0.5 0 𝑥2
0.5 1
1.5 2
2.5 0
𝑥1 3
▷ Pr(𝑋 ≤ 𝑥, 𝑌 ≤ 𝑦) = 𝐹𝑋𝑌 (𝑥, 𝑦) = 3.5 4
𝑥 𝑦
∫−∞ ∫−∞ 𝑓𝑋𝑌 (𝑤, 𝑧)𝑑𝑤 𝑑𝑧 Bivariate gaussian distribution
Marginal distributions — discrete case
𝑏1 𝑏2 𝑏3 … 𝑏𝑘
… … … … … …
… … … … … …
𝑏1 𝑏2 𝑏3 … 𝑏𝑘
∞
𝑓𝑋 (𝑥) = ∫ 𝑓 (𝑥, 𝑦)𝑑𝑦
−∞
∞
𝑓𝑌 (𝑦) = ∫ 𝑓 (𝑥, 𝑦)𝑑𝑥
−∞
Sklar’s theorem
For every joint probability distribution 𝐹𝑋𝑌 there is a copula 𝐶 such that:
copula function
▷ “Shape” and degree of joint tail dependence are properties of the copula
• they are independent of the marginal distributions
Understanding the copula function
space of our
“real variables”
𝑋
Understanding the copula function
𝐹𝑋𝑌 (𝑥, 𝑦) = 𝑡 0
𝑥 𝑋
Understanding the copula function
1
𝐹𝑋 (𝑥) (u, v)
0
0 1 We can use the marginal CDFs
to map from (𝑥, 𝑦) to a point (𝑢, 𝑣)
𝑌 on the unit square.
(x, y)
𝐹𝑌 (𝑦)
𝑋
Understanding the copula function
1
𝐹𝑋−1 (·) (u, v)
0
0 1 We can use the marginal inverse
CDFs to map from (𝑢, 𝑣) to
𝑌 (𝐹𝑋−1 (𝑢), 𝐹𝑌−1 (𝑣)).
𝑋
Understanding the copula function
Then map from (𝐹𝑋−1 (𝑢), 𝐹𝑌−1 (𝑣)) to
[0, 1] using the joint distribution
function.
𝐹𝑋𝑌 (·, ·) 0
𝑋
Understanding the copula function
(u, v)
0 𝐶
(𝐹𝑋−1 , 𝐹𝑌−1 ) 0 1
1
𝑌 𝑡 = 𝐶(𝑢, 𝑣)
0
𝐹𝑋𝑌
The copula function lets us map
directly from the unit square to
the joint distribution.
0
0 1
𝑋
Multivariate simulation…
𝐹𝑋−1 (𝑥)
0
0 1
We use the inverse CDFs to
𝑌 generate red points in the space
of our real variables.
𝑋
Simulating dependent random vectors
time
not change with
VaR of a CAC-DAX portfolio
0.0
7 8 9 10 11 12 13 14 15 16
0.1
▷ Monte Carlo simulation of portfolio returns
0.0
2 4 6 8 10 12 14 16 18
▷ Article ‘The Formula That Killed Wall Street’? The Gaussian Copula and the
Material Cultures of Modelling by Donald MacKenzie and Taylor Spears
@LearnRiskEng
fb.me/RiskEngineering
Was some of the content unclear? Which parts were most useful to
you? Your comments to feedback@risk-engineering.org
(email) or @LearnRiskEng (Twitter) will help us to improve these
materials. Thanks!