24  Copulas and Simulation of Dependent Variables

So far, we have constructed dependence using linear transformations of normal variables. This approach is powerful, but it has an important limitation:

It ties dependence to normality.

In many real-world applications (finance, insurance, environmental modelling), dependence can be:

To model such behaviour, we need a more flexible framework.

This leads to the idea of copulas.

24.1 Copula

A copula is a function that allows us to construct a joint distribution by combining:

  • marginal distributions, and
  • a dependence structure.

Key Idea

Any joint distribution can be decomposed as:

\[ F_{X,Y}(x,y) = C\big(F_X(x), F_Y(y)\big), \]

where:

  • \(F_X, F_Y\) are marginal CDFs,
  • \(C(u,v)\) is a copula.

This result is known as Sklar’s Theorem.

Interpretation

  • Marginals describe individual behaviour.
  • The copula describes dependence.

In copula models, dependence is often measured using:

  • Pearson correlation (linear)
  • Spearman’s rho (rank-based)
  • Kendall’s tau

Copulas naturally capture rank dependence, not just linear relationships.

Why Copulas Matter in Simulation

Copulas allow us to:

  • simulate dependence without assuming normality,
  • combine any marginal distributions (e.g., Normal + Exponential),
  • model tail dependence (important in risk modelling),
  • separate modelling into marginals (easy) or dependence (flexible).

Gaussian Copula

The most commonly used copula in simulation is the Gaussian copula.

Construction

  1. Generate correlated normal variables: \[ (Z_1, Z_2) \sim N(0, \Sigma) \]

  2. Transform to uniforms: \[ U_1 = \Phi(Z_1), \quad U_2 = \Phi(Z_2) \]

  3. Apply inverse CDFs: \[ X = F_X^{-1}(U_1), \quad Y = F_Y^{-1}(U_2) \]

    This produces \((X,Y)\) with:

    • chosen marginals \(F_X, F_Y\),
    • dependence induced by \(\Sigma\).

Simulation Algorithm (Gaussian Copula)

  1. Choose:

    • marginal distributions \(F_X, F_Y\),
    • correlation parameter \(\rho\)
  2. Construct covariance matrix: \[ \Sigma = \begin{pmatrix} 1 & \rho \\ \rho & 1 \end{pmatrix} \]

  3. Generate: \[ (Z_1, Z_2) \sim N(0, \Sigma) \]

  4. Transform: \[ U_i = \Phi(Z_i) \]

  5. Apply inverse CDF: \[ X = F_X^{-1}(U_1), \quad Y = F_Y^{-1}(U_2) \]

Example: Normal–Exponential Dependence

Simulate:

  • \(X \sim N(0,1)\)
  • \(Y \sim \text{Exp}(1)\)
  • with dependence \(\rho = 0.7\)
set.seed(1234)

library(MASS)

n <- 5000
rho <- 0.7

# Step 1: correlated normals
Sigma <- matrix(c(1, rho,
                  rho, 1), 2, 2)

Z <- mvrnorm(n, mu = c(0,0), Sigma = Sigma)

# Step 2: convert to uniforms
U <- pnorm(Z)

# Step 3: apply inverse CDFs
X <- qnorm(U[,1])      # Normal
Y <- qexp(U[,2])       # Exponential

plot(X, Y, pch = 16, cex = 0.4, col = "steelblue",
     main = "Gaussian Copula (Normal + Exponential)",
     xlab = "X ~ N(0,1)", ylab = "Y ~ Exp(1)")

Observations:

  • Marginals are preserved exactly,
  • Dependence is induced via the copula,
  • The shape is not elliptical (unlike MVN).

Limitations

A key limitation of the Gaussian copula is that it’s weak in modelling extreme co-movements.

Alternative copulas:

  • t-copula → captures tail dependence
  • Clayton copula → lower tail dependence
  • Gumbel copula → upper tail dependence

24.2 Simulation of Dependent Variables

We now unify everything into a general framework.

Linear Transformation Copula-Based Simulation
Use \(X=LZ+\mu\) \(U_i = \Phi(Z_i), \quad X_i = F_i^{-1}(U_i)\)
Works for Normal only Any marginals
Dependence Linear Flexible
Pros Simple and efficient Very flexible, realistic modelling
Cons Limited flexibility Slightly more complex
Use case Statistics, regression Finance, risk, insurance

General Algorithm

  1. Specify marginals \(F_1, \dots, F_k\)
  2. Choose dependence structure:
    • covariance matrix (MVN), or
    • copula
  3. Generate base variables:
    • \(Z \sim N(0,I)\)
  4. Induce dependence:
    • via \(LZ\) (Cholesky), or copula
  5. Transform to desired marginals

The worked example of this section can be found in 📈 Portfolio Risk Simulation.