Posts tagged as:

copula

(Parts I II and a half and III of this series are also available.)

Recently, I addressed a great deal of misinformation regarding the Gaussian copula and it’s role in the 2008 crisis. I would like to try and follow that up with a succinct description of the copula and its use in CDO pricing. (This may seem a defense of the math behind the process, but you know I’m just setting it up for a fall.)

Introduction

David Li’s contribution to quantitative finance was the rapidly-standardized “single factor Gaussian copula” CDO pricing framework. The real crux of the problem was the “single factor” part – not the Gaussian copula itself (though we won’t pull any punches here). In an extraordinarily broad sense, a copula is a mathematical function that describes how two or more random variables interact. “Correlation” is a simple way of describing the copula, which should give the function some intuitive grounding. But let’s back up a second and figure out why we even need a copula in the first place.

Aside: Why Copulas?

If you try to model the behavior of many random variables, you need a multivariate distribution. The most mathematically friendly distributions are from the Gaussian family, including the familiar bell (or normal) curve. This is why such models are prevalent in all manners of statistics. For most purposes, the model is not only easy to work with but asymptotically correct (which is a nice feature, to put it mildly). However, there are some areas where the model choice is more for pragmatic reasons than justified ones – finance being prime among them. Indeed, financial distributions do not behave normally, but only recently have tools been developed that can describe them – and even there large joint distributions are daunting.

So, it is unsurprising that the Gaussian copula arose as a natural choice for modeling the joint distribution inherent to CDOs – which are essentially just collections of many intercorrelated credits.

But I’m getting ahead of myself. (This is much easier to discuss than to write about, I think, because you can guage your audience’s comfort which each boldfaced section before moving on. I hope, brave reader, that you are still there.) Lets talk about CDOs.

CDOs

A CDO is nothing more than a collection of various bonds, all held together in a basket. The principal risk of a CDO is default: the chance that one or more of the bonds will not survive to maturity. To isolate this risk, it is instructive to think of the CDO as a basket of sold CDS contracts, rather than a basket of purchased bonds (and indeed, “synthetic CDOs” are nothing more than CDS portfolios and have rapidly gained market share from bond portfolios). Thus, the buyer of a CDO needs to draw two conclusions regarding the basket:

  1. Will any of the credits default?
  2. When will all of those defaults occur?

The first point is obvious; the second gets at the heart of the problem. Both the timing and the correlation of defaults matter. If the CDO basket is comprised disproportionately of financial companies, then default by one may imply a greater likelihood of default for the others; a more diversified basket may not exhibit such dependencies.

This issue is compounded by the introduction of tranches – a staple of the CDO industry. Again, it is helpful to consider a CDO as a basket of sold CDS. The most junior (or “equity”) tranche has, by definition, sold insurance on the first few issuers to default – say, the first 3. The next tranche does not experience a loss until the 4th issuer defaults. The key here is that when a portfolio is tranched, investors have not sold CDS on specific issuers by name, but rather by time of default. They can not know ahead of time which issuers they are effectively responsible or on the hook for.

Bathtub Correlation

To understand why tranching compounds the correlation problem, think of the CDO as a rectangular bathtub interspaced with mines that represent each issuer’s default. The CDO investors are aboard a boat on one side of the bathtub, and need to cross to the other side. If the boat hits a mine, that issuer defaults, and the explosion of the mine will damage the boat. The equity tranche has an extremely thin hull and will sink quickly; the senior tranche has a thick hull and can withstand many blasts without taking damage. Finally, the boat moves across the bathtub via geometric brownian motion – which is to say, randomly.

In a low-correlation world, the mines are dispersed uniform randomly across the bathtub; hitting one mine does not imply or necessitate hitting any other. With high correlation, the mines cluster somewhere in the water; hitting one mine makes it relatively certain that another will be hit.

As a consequence, equity investors prefer high correlation. They are indifferent to hitting just a few mines or many, as they are wiped out in both situations. Therefore, they prefer the mines to be clustered, as this leaves more clear paths across the bathtub. In contrast, senior investors prefer low correlation – they can withstand glancing off a few mines, but hitting a cluster would wipe them out.

From this intuitive example, it should be clear that not only the timing of the defaults, but also their expected clustering (i.e. correlation) is important when valuing a CDO tranche.

Correlation in the Guassian Copula

Let us first draw the connection I’ve sketched out already: CDOs are composed of many issuers that may interact with each other; and a multivarite normal distribution is a common method of describing such behavior. So far, so good.

Like any Gaussian multivariate model, the Gaussian copula takes as parameters the correlation of every pair of variables under consideration. (In other words, to make the model work, you need to “explain” to it how every issuer interacts with every other issuer – these are the parameters.) Thus, the number of parameters increases with the square of the number of variables being considered – specifically, there are \frac{N(N-1)}{2} parameters. If you had a CDO of 100 names, you would need to compute 4,950 parameters to describe their behavior! It doesn’t take a statistical degree to appreciate the flimsiness of a model which relies on such assumptions – it’s just too many to estimate reliably. Clearly, the traditional model simply won’t do.

Enter David Li, whose principal contribution to this field is to boil 4,950 parameters down to just one.

Shocking! Dastardly! The decision that caused the 2008 crisis! Well, not really. Though I am full of doubts about the validity of the Gaussian copula for this task in the first place, I do not think that the compression of its parameter space is the chief culprit by any means.

What Li was suggesting amounted to this: instead of modeling the intricate inter-corporate correlation structure, in which financials are highly correlated to each other but bear little semblance to utilities, which themselves are very similar, he said why not just model everything at the average correlation of the CDO names? Actually, he just said that one correlation level will be enough to describe the CDO price – he did not say it was the average (I just added that to make the notion more tolerable at first glance). He didn’t care if you chose a higher or lower correlation than any pair in the whole CDO exhibited; his claim was that there was some single number that would get the model to output a price that matched the market.

Before we get up in arms about this let’s remember that most financial instruments are priced this way. One or more variables of the equation are left free to change, such that for some level the model will output the “correct” (or market-observed) price. With options, this is called volatility; with swaps this is the fixed rate; with bonds this is the yield – I particularly like the last example because most people assume this is limited to derivatives. It’s not, “real” securities exhibit this problem too —  for stocks, it’s called a P/E ratio.

So, we’ve boiled correlation down to one parameter which can take any value, but forces all issuers to have the same correlation to each other AND (this is a much more important caveat) exhibit a Gaussian dependance structure.

Now What? This Is Getting Boring.

Ok, let’s price a CDO.

If I have CDS prices for all the issuers in my CDO, I can back out the probability of each issuer defaulting. (That’s a whole other lecture, but please take my word that if we have the price of default insurance, we can calculate the probability of default. Otherwise I’ll go on for another 2000 words…) This answers my first question: will defaults occur? Combine that with a correlation number and I can answer the second question: when will all the defaults occur? So now I can price the CDO, right? Unfortunately, no.

The default probabilities backed out of the CDS data are conditional default probabilities, meaning they have the market’s 4,950 correlation factors baked into them. Company A may be doing fine, but it’s very correlated to company B which is not so healthy. The result is that company A’s CDS will exhibit a relatively high default probability even though that’s more B’s fault than A’s.

In statistics, we like to deal with independent or unconditional probabilities, because the math becomes dramatically easier. So the conditional probabilities extracted from the CDS are not so useful, and must be transformed into independent probabilities. To achieve this goal, we do something that I think is very clever:

We set up a model in which defaults are driven by a shared “market factor” and an idiosyncratic factor, similar to a regression with one dependent variable and an error term, hence the name “single factor model.” Now, I know I just said there are two factors, but one is specific to each individual issuer, so it doesn’t count as one of the model factors — if this troubles you, chalk it up to statistical nuance. Anyway, the two drivers are weighted by a correlation term; as correlation increases the market factor dominates, and as it decreases the idiosyncratic factor dominates.

Now, suppose for a moment we knew the value of the [random] market factor. In this case, default would be driven solely by the idiosyncratic factor (since the market factor is fixed, and we have chosen it such that all names either are – or are not – in default). The idiosyncratic factor is, by definition, independent across all issuers. Therefore, we have artificially created a scenario in which defaults are independent for each issuer by conditioning the market factor on a certain level. More specifically, we have generated a set of conditionally-independent default probabilities. Now, repeat the process for every issuer and every market factor level. The result is a complete picture of how every issuer behaves in every possible situation. From this, the unconditionally independent probabilities can be extracted.

(If that isn’t quite clear, suffice to say there’s a bit of math behind it. Interestingly, the math is surprisingly simple, but with the exception of the number of factors in a Gaussian model I have promised not to write out any equations in this post, so in the absence of symbols I hope you will accept my reasoning.)

So now, we have the probability of every issuer independently defaulting at any given time – with that information, it is relatively straightforward to figure out the expected loss on the portfolio. In fact, it’s mainly arithmetic at this point: the value of the portfolio is just the probability-weighted average payoff of all the issuers.

And that’s really it – that’s how the Gaussian copula is used to price a CDO, or a collection of sold CDS on many issuers. We calculate the default probabilities from the CDS, then we use the Gaussian copula to tell us how they relate to each other. You’ll notice that I never actually mentioned the copula when discussing the probability model – that’s because you don’t really need it. It happens that the copula math simplifies nicely into something that is almost, but not quite, entirely unlike a copula (hey! a Douglas Adams reference!). However, the copula-based approach is more informative, even if copula-specific math per se doesn’t enter the picture.

And why is this so bad?

A few of the modeling decisions I’ve described above are unquestionably poor ones, though it may not be obvious how to improve them. Here is my brief rundown:

  • The Gaussian dependence structure – what’s wrong with it? What alternatives are there? Why are they better?
  • The single factor – is it really sufficient to describe the behavior?
  • The single correlation number – is it sufficient to describe the behavior? Can we reliably estimate more relationships? Is correlation the right metric in the first place?

I’ll attempt to answer all these and more in part III…

{ 9 comments }

Copulas in squash

June 15, 2009 in Math, Sports

Somehow I never noticed this before, but the marks on the walls of the Harvard Club squash courts form excellent copula scatterplots.

Here is a picture of the court, courtesy HCNY’s new website:

And here is a quick simulation I just ran of 10,000 points drawn from a Clayton copula with theta = 1.25:

Clayton copula scatterplot (theta = 1.25)

It’s not perfect, but it’s pretty close. To fully match the pictured relationship, we’d need to assume the correct marginal distributions as well. Of course one could also make the argument that theres a more complex dependence structure at work here, given the strong diagonal band in the wall markings. Dare I plug the Fourier copula as a more  appropriate tool?

{ 0 comments }

(Parts II, II and a half, and III of this series are also available.)

Newsweek has a new article about Paul Wilmott called “Revenge of the Nerd” which I really enjoyed, with two caveats.

In its opening the article compares quants to aeronautical engineers who design faulty planes (CDOs). The author observes:

Yet while aeronautical engineers who willfully designed a faulty plane might be on trial for criminal negligence, Wall Street’s math gurus are, for the most part, still employed. Strangely, the banks need quants more than ever right now.

But where is the logical conclusion of the aeronautical metaphor, that other engineers would be needed to fix the planes? In that framework, there’s no contradiction.

But that point is minor. Here’s what really bothered me (my comments are inserted in bold):

In 2000, the CDO market was jump-started by David X. Li, who, while working at JPMorgan, created the Gaussian copula function (no, he didn’t), a formula for determining the correlation between the default rates of different securities (no, it’s not). In theory, the model tells you the odds that, if one CDO goes bad, others will too (no, it doesn’t). The apparent genius of the Gaussian copula is its abstraction (true, but not in the way the author means). Rather than relying on the immense amount of data used to figure the odds that a CDO might default (there is no such data; issuers default, not CDOs), Li appeared to have discovered a law of correlation (no, he didn’t). That is, you didn’t need the data; the correlation was just there. Armed with it, quants could price CDOs much faster, and traders could buy and sell them at record speeds. Gaussian was rocket fuel for the CDO market (“Gaussian” is an adjective, not a noun). The global volume of CDO deals went from $157 billion in 2004 to $520 billion in 2006. As more banks got in on the game, the once large profit margins started to shrink. In order for banks to make the same kind of returns, they had to pack more and more loans into a CDO, essentially making bigger bombs. Li was on his way to a Nobel Prize when the world blew up (no, he wasn’t).

I have no problem with the simplification of difficult topics (in fact, I encourage it). I also have no problem with bashing Gaussian copulas as applied to CDO’s (the argument was featured in my thesis years ago). But I have severe issues and frustrations with poor reporting of false information. Will 99% of this paragraph’s readers realize it’s incorrect or even care? Of course not! But it doesn’t make it all right.

Deep breath. Ready to go deeper?

This paragraph seems to be lifted largely from a recent Wired article (my response to that article would evolve into my “models are just the tool” tirade). Anyway:

“David X. Li…created the Gaussian copula function.” The Gaussian copula is rooted in research from more than 250 years ago. In fact, Gauss – a prodigal mathematician whose influence extends far beyond the bell curve – died in 1855! It’s unclear when the first bivariate extensions were arrived at, but Wikipedia notes that it must have been developed by 1872. The copula itself would not be described until 1959, but almost immediately mathematicians used it to decompose the multivariate normal distribution into a pairing of Gaussian marginals and something the new vocabulary termed a Gaussian copula. All David Li did was pair the copula and CDO pricing for the first time.

…a formula for determining the correlation between the default rates of different securities.” Copulas describe the dependence structure of random variables. Correlation is a way of condensing the information contained in the copula down to a single number. The sentence as written suggests that the copula is used to measure correlation when in fact it is the other way around. In fact, you can not even create a Gaussian copula until after you decide what correlation to use.

“In theory, the model tells you the odds that, if one CDO goes bad, others will too.” I assume the author meant to write “if one issuer goes bad” rather than “if one CDO goes bad”, because the Gaussian copula as applied to CDO’s describes the issuers within the CDO, not CDOs to each other. In this framework, the sentence is correct: copulas describe the dependence structure, which essentially means “how one issuer relates to other issuers.” In this case, the thing being measured is default probability.

“The apparent genius of the Gaussian copula is its abstraction.” This is a true statement as it stands: the brilliance of the copula function is that it abstracts the dependence structure from the marginal distributions, meaning the dependence of, for example, two dice numbered 1-6 has the same copula as the behavior of two dice numbered 2-7. Before the development of the copula, the 1-6 dice would have a completely different function than the 2-7 dice, because one would have to account for the marginal differences while defining their dependence.

However, the abstraction the author is referring to is that “you don’t need the data, you only need the correlation” (see below). The Gaussian copula as Li implemented it boils all correlation down to a single number, enabling such an abstraction.

“Rather than relying on the immense amount of data used to figure the odds that a CDO might default…” The available data consists of CDS spreads and bond z-spreads, which may be used to imply a default probability for each issuer. However, to figure out if a CDO will default, one must evaluate the probability of multiple firms defaulting within a given time frame. This is the correlation parameter. Thus, the data alone does not tell you about the likelihood of CDO default.

The default probabilities extracted from historical data are not independent, and so can not simply be added (or multiplied, to be more precise) together. Moreover, the correlation which may be measured in CDS is the correlation of changes in default probability, and the jump to correlations of actual bankruptcy events is much more difficult, not in the least because there are relatively few historical defaults, compared to the number of issuers.

This isn’t to say that the data can’t be used – in fact the data must be used – but the key realization is that without a model (I struggle to think of one capable of handling such data that isn’t a copula), the data yields no worthwhile insights. Merely having the data is not enough to price a CDO.

“Li appeared to have discovered a law of correlation.” As I’ve mentioned, Li did not “discover” anything. He merely applied an existing model to a new dataset.

“You didn’t need the data; the correlation was just there.” Of course you need the data – the correlation is meaningless without the default probabilities extracted from the data. What the author presumably means is that your correlation number does not have to represent the “true” level of correlation observed in your data (which, as I’ve stated, is a nearly impossible thing to observe in the first place).

But having said that, this is probably the one thing the author has correct. After some futile efforts, researchers stopped measuring correlation and started holding a finger in the air to determine the “right” level. Similar to implied volatility in option pricing, correlation was unobservable and the “right” correlation was whatever level made the model price come out the same as the market price.  Unfortunately, in a space where traders became so dependent on their models, the chain was circular: markets were informed solely by correlation-based models, which were themselves calibrated to the market.

The critique is not limited to the use of a Gaussian copula, however.

“Gaussian was rocket fuel for the CDO market.” Another true statement, but one which reveals the author’s unfamiliarity: “Gaussian” is an adjective used to describe a type of model. It’s a person’s name. This is like saying “Newtonian revolutionized the world of physics” when you want to talk about a model of gravitational acceleration or “Darwinian turned the study of biology upside down.”

“Li was on his way to a Nobel Prize when the world blew up.” No, he most emphatically was not. This is a repeat of a one of Felix’s statements from the Wired article. Even if the model had been perfectly accurate, do today’s financial journalists think pricing a financial derivative is worthy of a Nobel prize? Black/Scholes/Merton didn’t win a Nobel prize for their option pricing model, they won it for the research they did into the economics of asset pricing. The option model was just a nice benefit on the side.

A fundamental issue with this paragraph, on top of all these highlights, is that not once does it explain the actual problem. If you read the paragraph, and I asked you why did they blow up, could you tell me? I’m sure you’d say something about the correlation not being reflective of the data. And I’d respond, well then why didn’t we just start using the data, or start using the right correlation?

I’ll try to answer these questions soon in part II.

{ 7 comments }

Visualizing randomness

May 19, 2009 in Math

Daniel Becker’s diploma dissertation was on the visualization of randomness – finding concrete ways to map the highly abstract idea of random behaviors and patterns. The resulting portfolio is fascinating, even for someone without a statistical background, in particular for the way in which it lends a semblance of order to these inherently chaotic processes.

The first one that caught my eye was a clean visualization of Benford’s law (I recently rambled on the subject). It isn’t a derivation of the law, but rather an illustration of its presence in a dataset of countries’ areas in square kilometers (a zoomable version is on the diploma website):


However, my favorite visualization is one of a quincunx. A quincunx (also called a Galton box, but that’s not as fun to say) is a device consisting of a vertical space filled by evenly spaced horizontal pins. A ball is dropped from the top of the box and allowed to bounce off the pins on its way down. At each pin, it is impossible to say whether the ball will bounce left or right. However, the box is used to illustrate the normal distribution (strictly speaking, it really illustrates a binomial distribution, which in the limit approaches a normal distribution) because the ball’s ultimate location will take the shape of a familiar bell curve – it is likely to land directly under the point at which it was dropped, and less likely to land far away.

My dad used to have a quincunx in his office when I was little. It took the form of a game (circa 1900) – there were bins along the bottom, and you dropped a penny in the top. If the penny landed in one of the extreme bins, you won — but you lost if it landed in one of the central bins.  In retrospect, the game was obviously mispriced, since many of the bins had equal payouts despite their chances of receiving the penny. But I’m sure the mispricing was in the house’s favor.

Anyway, here is Becker’s visuaization of the process:

Finally, I also liked this visualization of the output of various random number generators. Needless to say, there should be no apparent pattern in uniform numbers generated by an algorithm – the presence of such a pattern indicates faulty number generators. (It is well documented that Excel’s random number generator is particularly disappointing). The box in the lower right represents the “iPhone” of  random number generators – the Mersenne Twister. It is the closest to being pattern-free, though it looks a bit like a Clayton copula to me!

{ 2 comments }

Wilmott on copulas

February 26, 2009 in Finance, Math

Paul Wilmott has responded (“Copulas and Cults”) to the Wired article on copulas I mentioned recently. His tone is grave: “Far more serious, because it extends to all of finance not just to a single model, is the poor education that people get in university financial engineering programs and also the blind-following-the-blind behaviour that is so common throughout the industry” and his punchline comes in the middle:

Question everything. Switch your brains back on.

{ 0 comments }

Signs of the apocalypse

February 24, 2009 in Finance, Math, Risk

Wired has published an article attacking the Gaussian copula: Recipe for Disaster: The Formula That Killed Wall Street.

It’s a very typical “hate the game, not the player” article which finds fault with a tool rather than the people who use it. Not that I completely disagree with the critique – but imagine my surprise when an idea rooted in that obscure statistical field in which I claim expertise showed up on the [digital] glossy front page of a pop sci magazine.

It seems like the Gaussian copula is the new VaR – everyone uses it, everyone claims to know its limitations, but when the world blows up everyone is quick to point fingers at the model. From a mathematical perspective, the two are actually incredibly close, which is perhaps unsurprising given their pitch of “easy risk measurement with minimal parameterization.” VaR has dubious use as a relative indicator through time – if day 2’s VaR is higher than day 1’s VaR, maybe risk increased. But as soon as one applies meaning to the VaR, they have overstepped its utility. The Gaussian copula has similarly limited value – under its assumptions, one can gauge the relative magnitude of risk and price shocks.

In truth, we use oversimplifications like this all the time in finance, in places few pop sci magazines dare tread. Case in point: options pricing. Volatility, like correlation in the Gaussian model, is a plug – it’s the number that gets you to the right place. It has no meaning outside a log-normal no-arbitrage zero-drift tax-free world. And yet we use it just fine.

The Gaussian copula may be a poor fit to reality, but it’s good math. It’s simple and gets a reasonable approximation. In the next month the credit world will officially adopt a newly open-source JP Morgan model for all CDS pricing. Like the Gaussian copula and VaR – two other JP Morgan innovations – this model oversimplifies the world in order to provide an easy view of pricing and risk. Does that make it bad? Certainly not. The fault is with the trader, risk manager, or analyst who blindly adopted the model without thought.

Surely if a man with an exotic flamethrower accidentally burnt his village down, we would blame the man and not the unfamiliar machine for causing the damage.

I’m definitely not a supporter of the financial applicability of the Gaussian copula – I spent a good chunk of my academic career ranting against it – but, just as with VaR, much of the the fault lies with the users and not the mathematics.

{ 2 comments }