← Back to Learn
IV ExpertWeek 25 • Lesson 70Duration: 35 min

CRED Credit Risk Modeling

Modeling the probability of default — when counterparties can't pay

Learning Objectives

  • Understand credit risk and probability of default
  • Know structural vs reduced-form credit models
  • See how credit risk relates to trading

Explain Like I'm 5

Credit risk is the risk that someone who owes you money doesn't pay. In trading, this is counterparty risk — your broker, your clearing house, your prop firm could theoretically go bust. Credit models estimate the PROBABILITY of default and the expected loss. It's insurance math applied to financial institutions.

Think of It This Way

Credit risk modeling is like being a bookie deciding which gamblers to extend credit to. Some gamblers (AAA rated) almost always pay up. Others (junk rated) might disappear. You set different terms (interest rates) based on your estimate of each person's reliability.

1Credit Risk Basics

Three components of credit risk: Probability of Default (PD): How likely the counterparty defaults. - Investment grade (AAA to BBB): PD < 0.5% per year - High yield (BB to CCC): PD 1-15% per year - Distressed (CC to D): PD > 25% per year Loss Given Default (LGD): How much you lose if they default. - Senior secured: LGD ~30-40% - Senior unsecured: LGD ~50-60% - Subordinated: LGD ~70-80% Exposure at Default (EAD): How much they owe when they default. Expected Loss = PD x LGD x EAD For quantitative traders: - Counterparty risk: your broker could fail (2008 Lehman, 2011 MF Global) - FTMO: a prop firm could technically close operations - Clearing house: systemic risk in the financial system Mitigation strategies include: trading with regulated firms, keeping account sizes manageable, and not over-concentrating with one counterparty.

2Structural vs Reduced-Form Models

Structural models (Merton, 1974): - Company defaults when its asset value falls below its debt - Model company assets as geometric Brownian motion - Default = first time assets hit the "default barrier" - Intuitive: default happens when a company runs out of money Reduced-form models (Jarrow-Turnbull, Duffie-Singleton): - Default modeled as a random event with a hazard rate λ\lambda - P(default by time T)=1eλTP(\text{default by time } T) = 1 - e^{-\lambda T} - More flexible: λ\lambda can vary with time and market conditions - Easier to calibrate to market prices (CDS spreads) For practical purposes: - Structural models: better for understanding WHY companies default - Reduced-form: better for PRICING credit derivatives - Most quants use reduced-form for day-to-day work Credit risk seems distant from FOREX trading, but understanding it helps you interpret credit spreads as risk indicators, understand 2008 (credit crisis that caused massive FX moves), and evaluate counterparty risk in your own trading.

Key Formulas

Expected Loss

Expected loss = probability of default x fraction lost if default x exposure amount. This is the basis of all credit risk management.

Survival Probability

Probability of NO default by time T, given constant hazard rate lambda. Higher lambda = more risky = lower survival probability.

Hands-On Code

Credit Risk Calculator

python
import numpy as np

def credit_risk_analysis(pd, lgd, ead, n_years=5, n_sims=10000):
    """Monte Carlo credit risk simulation."""
    uniform = np.random.uniform(0, 1, (n_sims, n_years))
    defaults = uniform < pd  # True = default in that year
    
    losses = []
    for sim in range(n_sims):
        default_years = np.where(defaults[sim])[0]
        if len(default_years) > 0:
            first_default = default_years[0] + 1
            loss = lgd * ead * np.exp(-0.05 * first_default)  # discounted
            losses.append(loss)
        else:
            losses.append(0)
    
    losses = np.array(losses)
    
    print(f"=== CREDIT RISK ANALYSIS ===")
    print(f"PD: {pd:.2%} per year")
    print(f"LGD: {lgd:.0%}")
    print(f"EAD: {ead:,.0f}")
    print(f"Expected loss: {np.mean(losses):,.0f}")
    print(f"P(any default in {n_years}y): {(losses>0).mean():.2%}")
    print(f"VaR 99%: {np.percentile(losses, 99):,.0f}")

# credit_risk_analysis(pd=0.02, lgd=0.45, ead=100000)

Monte Carlo simulation of credit default events, computing expected loss, default probability over multi-year horizons, and credit VaR.

Knowledge Check

Q1.A counterparty has PD=5%, LGD=60%, and your EAD is $100K. What's the expected loss?

Assignment

Simulate credit risk for a portfolio of 10 counterparties with different PDs. Compute portfolio-level expected loss and VaR. How does default correlation affect portfolio risk?