copulas made easy _ dahtah
TRANSCRIPT
-
7/30/2019 Copulas Made Easy _ Dahtah
1/2
5.05.13 C opulas made easy | dahtah
ahtah.w ordpress.com/2011/10/28/hello-world/
dahtah
Copulas made easy
Everyday, a poor soul tries to understand copulas by reading the corresponding Wikipedia page,and gives up in despair. The incomprehensible mess that one finds there gives the impression thatcopulas are about as accessible as tensor theory, which is a shame, because they are actually a verynice tool. The only prerequisite is knowing the inverse cumulative function trick.
That trick runs as follows: suppose you want to generate samples from some distribution withprobability density . All you need is a source of *uniform* random variables, because you can
transform these random variables to have the distribution that you want (which is why you cansurvive on a desert island with nothing but the rand function). Heres how: if is a random variablewith uniform distribution over [0,1], and if is the cumulative distribution function
corresponding to the density f(x), then:
has the right probability density. This is easy to prove using the classical transformation formula for
random variables.
The trick also works in the other direction: if you take and run it through than you get back
. So its also a way of making uniform random variables out of non-uniform ones.
Now lets say that what you want to generate two correlated random variables and , representingfor example personal wealth and cigar consumption. One obvious way to generate correlatedrandom variables is to use a multivariate Gaussian, but here you cant assume that your variableshave marginal Gaussian distributions wealth is notably non-Gaussian (I dont know about cigarconsumption). Lets say that you want them to have marginal distributions and , but you
still want to preserve some king of positive correlation.Heres a possible recipe: generate , from a correlated Gaussian distribution. Then transform themusing the cumulative Gaussian distribution into , . Now u and v have marginal
*uniform* distributions, but are still positively correlated.Finally transform again to , you still have positive correlation, but the
marginals you want. Youve just used a Gaussian copula. The technical definition of a copula youllfind on Wikipedia corresponds to the joint probability distribution you have over , i.e. at the
step where you have uniform marginals.
Heres some R code that illustrates this:
123
require(mvtnorm)S
-
7/30/2019 Copulas Made Easy _ Dahtah
2/2
5.05.13 C opulas made easy | dahtah
ahtah.w ordpress.com/2011/10/28/hello-world/
That sort of stuff is tremendously useful when you want to have a statistical model for jointoutcomes (for example when you want to describe how the dependency between wealth and cigar
consumption changes depends on the country being US or Cuba).
Another interesting aspect of copulas, more theoretical, is that this also gives you a way of studyingdependency independently of what the marginals look like
science, Uncategorized
copula, R, statistics
October 28, 2011
Leave a comment
Blog at WordPress.com.
Theme: Neutra by Artmov.
4567
U