Copulas and Portfolio Risk

Ending early today because the Pacers are playing tonight

Copulas

Why do we need this?

First let’s talk about:

Generally speaking, the Basel 2, Basel 3, and current Basel 3.5, all these rules and regulations require that banks assess two things. Any unit that owns funds that don’t belong to them (banks, basically), they need to assess risk. What exactly does that mean?

The class 535, 635, and 636 are all about this. 636 will be offered this fall.

At the core, regulators don’t understand any of it. What they want to know is, if the economy goes to crap, how much will you lose? So how do you come up with this number?

There’s two basic numbers: VaR, or Value at Risk, and ES, Expected Shortfall

One of my former students is head of globalr isk at Barclays, and every day he has to come up with these numbers. Basically he aggregates the positions of every desk at Barclays. Derivatives, asset management, whatever. Each has a risk associated with it. VaR is supposed to be a quantile. Imagine you have a distribution for the value of your assets tomorrow. It’s actually in 10 days that Basel demands.Obviously, I know the value of assets today, by marking to market. I project in ten days what are the possible things that could happen to all my divisions. My derivatives desk has a distribution, another desk has another one, so I have a whole bunch of random variables. Now I need to combine them. I have tons of distributions, how do I put them together?

For example, 10% of my bank is invested in derivatives. So I should take the risk from that and multiply by 10%, right? Wrong. Because things don’t move independently. We could do such aggregation only then. If the derivatives desk goes down because Trump said something dumb, th equities desk will also go down, and so will bonds. Things are related.

That’s the purpose of copulas. These are very much used in risk management.

VaR can only be calculated for a 1D r.v. You need to have a typical marginal distribution. Let’s say you get this distribution, of values with probabilities. Let’s say I look at the value where the probability is 0.01. If I look at the value I have now, and subtract the value there, that resulting value is the loss. The amount of money I will lose if this thing happens, which is worst case scenario, with a 1% chance of happening. This particular one is 𝑉𝑎𝑅99. You can obviously calculate different percentiles.

Expected Shortfall

If you are in this region, you are going to lose money. If my estimation is correct, then this thing is going to happen. If I look at the next 100 days, and do this distribution every single day, then I expect to see one of these events every 100 days.

But if it does happen, exactly how much money will I use? I don’t know which point I’m in, just the region. So to determine that value, you calculate ES.

ES is nothing more than

𝔼[Loss|𝑋<VaR]

Basically it’s just the expected value of the random variable when it’s less than VaR.

This is important, there’s an entire area of risk management dedicated to this. The trader cannot take risks because the risk manager won’t let them, because of this stuff. You can’t take crazy risks.

Marginal vs Joint Distribution

So what is the problem? This is calculated on a daily thing. A natural thing to do is to look back 100 days, have a historical look at each desk. That gives me distributions that are reasonable for each of those r.v.s. If I have a 1D r.v., with 100 observations, I can make a pretty accurate histogram.

For a 2D rv, I suddenly need a lot more observations. And for more, it’s impossible.

So although you can estimate the distribution of the marginals very easily, you can’t do that for the joint. You would need mountains of data, which is not possible. And the problem is if you go too far in the past, you end up with irrelevant data that is nonstationary.

The question is, can we do that?

You can do this in one case, and only one case. And that’s if 𝑋1,…,𝑋𝑑 are independent. Then the joint distribution is the product of the marginals. This holds for both PDF and CDF.

However, irl, nothing is independent. In the 1940s, there’s an old theorem by Sklar:

Let 𝑋1,…,𝑋𝑑 be random variables with CDFs 𝐹1,…,𝐹𝑑. (These are one dimensional CDFs)

Let

𝐹(𝑥1,…𝑥𝑑)=ℙ(𝑋≤𝑥1,…,𝑥𝑑≤𝑥𝑑)

There exists a function 𝐶 which follows

ℝ𝑑→[0,1]

That this function

𝐶(𝐹1(𝑥1),𝐹2(𝑥2),…𝐹𝑑(𝑥𝑑)=𝐹(𝑥1,…𝑥𝑑)

In the case of independent r.v.s, then it’s just the product. But maybe we have to do something further.

Then if you have the joint pdf 𝑓1(𝑥1,…,𝑥𝑑), then you also have a similar

𝑓(𝑥1,…,𝑥𝑑)=𝑐(𝐹1(𝑥1),…𝐹𝑑(𝑥𝑑))𝑓1(𝑥1)…𝑓𝑑(𝑥𝑑)

And this is just how derivatives work, this is the chain rule, where

𝑐=𝑑𝑑𝑥1𝑑𝑑𝑥2…𝑑𝑑𝑥𝑑𝐶

There’s a second property that 𝐶 is unique on [0,1]𝑑. Basically, the function 𝑐 connects the marginals, which are probabilities [0,1]. So you limit yourself to the space of distributions, which are the

ℝ→[0,1]

, then we are unique.

This is pretty powerful.

Issues with Copulas

There is a non obvious issue: time stationarity.

This is not even mentioned in most texts. When you estimate this, you need to estimate the marginals. You need a mountain of data to have these two things. You calculate the copula which connects them. Let’s say you have 2001-2006 and estimate the copula during that period. In order to make forecasts about the relationship in the future, you’re assuming that the relationship stays the same. This is the reason for the 2008 financial crisis. The CDOs are estimated assuming the functions doesn’t change, which is pretty stupid. Things don’t seem correlated right now, but they were, even though the historical data didn’t show it.

The second big issue: what EXACTLY is this copula?

We know this function exists, but we don’t know how to get to it. It’s like God.

We know God exists, but if we go by Christian religion it’s this god, if it’s Islam it’s that god, etc.

Copula Families

I’ll say that a copula function, sorta, looks like this. The only quantity I know is that it’s defined from [0,1] to [0,1]. So if I have a function that does this, I should be okay.

If you take 1D CDF, then what does it do? This is a function

𝐹:ℝ→[0,1]

. It takes a random variable, and gives it a probability.

What about

𝐹−1

, the quantile function? This is defined

𝐹−1:[0,1]→ℝ

All copulas are based on this. They use the cdf and the inverse. The most popular one, we have already seen. The simplest one is called

Gaussian Copula

The whole thing is that the function needs to associate

ℝ𝑑→[0,1]

. We have the multivariate normal function

ΦΣ

CDF with mean 0 and covariance matrix Σ. The cov matrix is positive, semidefinite, and symmetric.

ΦΣ(𝑢1…𝑢𝑑)=∫−∞𝑥1∫−∞𝑥𝑑1(2𝜋)𝑑detΣ𝑒−12𝑢𝑇Σ−1𝑢𝑑𝑢1,…𝑑𝑢𝑑

𝑢 is a line vector.

This has to be between 0 and 1.

But this is defined for R.

So I’m going to write the gaussian copulas as

𝐶Gaussian(𝑥1…𝑥𝑑)=ΦΣ(Φ−1(𝑥1),…,Φ−1(𝑥𝑑))

This is really complicated. The 𝐹s are the 𝑥s, you plug in the marginals, and that gives you the copula function. The important concepts are the multivariate Gaussian with given 𝜎, the Φ−1 inverse CDF, and you plug in the CDFs of the marginals. You look at your data, obtain the marginals, and obtain the joint. And fit the function to the joint. The only thing to estimate here is Σ.

Student t Copula

There is another thing called the Student t copula. Remember the Cholesky decomposition? It’s basically used for this. You use the data, you use the numbers you get, and calculate the joint distribution. The correlated numbers you plug into the copulas, and you get the thing correlated. Fancy way of doing the homework.

It’s an extension that uses the fact that

𝑡=𝑁𝑜𝑟𝑚𝑎𝑙Χ2

You obtain 𝜒2 by squaring the normal.

This is useful.

Gaussian copula is nice and easy to work with.

Archimedean Copulas

This is an entire class. We have Gaussian, and student t which inherits from Gaussian processes. (By the way, if you want to know more about Gaussian processes, take Florescu’s class).

The whole point is that you’re going with CDFs, and inverse CDFs. Remember a copula goes from [0,1]𝑑 to [0,1]. It is defined like this

𝐶(𝑢1,…𝑢𝑑)=Ψ−1(Ψ(𝑢1)+…+…Ψ(𝑢𝑑))

where

Ψ:[0,1]→[0,∞)

and

Ψ(1)=0

This Ψ function is kinda like inverse CDF.

Importantly, Ψ−1 is monotonic. And it follows that

Ψ−1(0)=1

Ψ goes from [0,1] to ∞, and the inverse goes the other way.

And there’s a property that Ψ−1 starts at 1, and keeps going down over to ∞.

Product Copula

You take the

Ψ(𝑢)=−ln𝑢−ln𝑢=𝑦𝑢=𝑒−𝑦

So that’s the inverse

Ψ−1(𝑦)=𝑒−𝑦

Remember this starts at 1 at 𝑥=0, then decreases towards ∞.

The archimedean copula function is the sum of Ψ. So what is the copula in this case?

𝐶(𝑢1,…𝑢𝑑)=Ψ−1(Ψ(𝑢1)+…+Ψ(𝑢𝑑))=𝑒−(−ln𝑢1−ln𝑢2−…−ln𝑢𝑑)=𝑒ln(𝑢1…𝑢𝑑)

which ends up being

=𝑢1𝑢2…𝑢𝑑

You take each cdf and multiply them, which is numbers between 0 and 1.

It’s kind of useless because it doesn’t have a parameter, so you can’t fit it.

Clayton

These are the most used ones

Ψ(𝑢)=1𝜃(𝑢−𝜃−1)

Basically you construct these, by picking something. Someone came up with a function such that the inverse looks like this, then they pick 𝜃 such that they have a parameter to fit something, where Ψ(1)=0.

They actually are simple, and then they just fit the properties. SOmoene tried it, now everyone uses it.

The inverse is

Ψ−1=(𝜃𝑦+1)−1𝜃𝐶Clayton(𝑢1…𝑢𝑑)=(𝜃(Ψ(𝑢1)+…+Ψ(𝑢𝑑))+1)1𝜃

Then just plug in the Ψ term.

=(𝜃(∑𝑖=1𝑑1𝜃(𝑢𝑖−𝜃−1))+1)1𝜃=(∑𝑖=1𝑑𝑢𝑖−𝜃−𝑑+1)1𝜃

This formula IS NOT ONLINE, only for bivariate copula. All the formulas online are bivariate

I have four more pages of crap for Frank and Gumbel. But…

Frank

This is a generator

Ψ(𝑢)=−log(𝑒−𝜃𝑢−1𝑒−𝜃−1)

Gumbel

Ψ(𝑢)=(−log𝑢)𝜃

And if you understand the principles, you can come upw ith your own. you can notice that you have logs everywhere, because it’s very nice because when you exponentiate it disappears. But it could be something like cosine! The only requirement is that the inverse function is convex.

The 𝜃 is the parameter fit. The way you fit 𝜃, the relationship is

𝐶(𝐹1(𝑥1),…𝐹𝑑(𝑥𝑑))=𝐹(𝑥1…𝑥𝑑)

You’re just inventing something to fit the copula, something close.

It’s a high barrier of entry because the formulas seem complicated.

Why Do We Care

We need to estimate the wealth and know the risks, and come up with a number.

But how do we actually use this stuff?

I used to do a lecture on generating random variables. Now I don’t. If you’re interested in more detail, read the Handbook of Probability. Chapter 6 proves this. If you take a random vairalbe and plug it into a cdf, it generates a uniform random variable.

This tells you how to generate any rv you want.

All you have to do is the inverse cdf method.

If

𝑈∼Uniform(0,1)

,

and you can get the inverse cdf

𝐹−1(𝑈)

has the same distribution as X.

If you can calculate the CDF, and the inverse CDF, you can generate random uniform, plug it into it, and then you get a random.

The problem is the normal CDF, because the normal CDF is not invertible. But a lot of other rvs work.

The problem is that it only works for 1D rvs. That’s why this copula is pretty useful.

Recall that the joint distribution cdf is equivalent to the copula of the marginal cdfs. The methodology will work for the marginal cdfs, so you can apply the copulas to get to the joint cdf.

Algorithm

First you estimate C.

1: First you generate many uniforms iid 𝑢1,…,𝑢𝑑

2: For each such point, you calculate the 𝐶(𝑢1,…,𝑢𝑑) for all generated 𝑢𝑖s.

3: Calculate marginals densities

4: I now have all these probabilities that I generate 𝑥1,…,𝑥𝑑.

My 𝑥𝑖 CDF can be used to generate numbers, I have 𝑑 distributions, I have a number between 0 and 1, and extract the corresponding 𝑥𝑖, which gives me a generated number. That will calculate not only VaR but also ES with respect to these distributions.

There could be an easier version of this, which is what Marina will do. This is just how I would do it.