Lesson 6.2: The "Computer Way" - Monte Carlo Methods

Welcome to Lesson 6.2. In our last lesson, we learned the 'magic shortcut' of Risk-Neutral Valuation (RNV). It's a fundamental theorem that says the price of any option V is just its *expected* future payoff (in a 'magic' risk-neutral world), discounted back to today.

The Risk-Neutral Valuation Formula (from Lesson 6.1)

V(t)=EQ[er(Tt)Payoff(ST)]V(t) = \mathbb{E}^{\mathbb{Q}} \left[ e^{-r(T-t)} \cdot \text{Payoff}(S_T) \right]

This formula is beautiful. But it has a huge practical problem.

Part 1: The "Nightmare" Problem (Why We Need Computers)

Our new "shortcut" formula, V=EQ[](discount)V = \mathbb{E}^{\mathbb{Q}}[\dots] \cdot (\text{discount}), just replaced one hard problem (solving a PDE) with a *new* hard problem: How do we calculate the "Expected Payoff" EQ[]\mathbb{E}^{\mathbb{Q}}[\dots]?

  • For a Simple Option: (like a standard call, Payoff=max(STK,0)\text{Payoff} = \max(S_T - K, 0)) This is *possible*, but it's a very hard PhD-level statistics problem. We (as Black and Scholes) "solved" it, and the answer is the Black-Scholes formula.
  • For a Complex Option: What about an **"Asian Option"**? This is a very common option whose payoff depends on the *average* stock price over its whole life.
    Payoff=max(Average(St)K,0)\text{Payoff} = \max\left( \text{Average}(S_t) - K, 0 \right)
    How do we calculate the "expected average price" of a random path?

At this point, "pure math" fails.

  1. The PDE Method (Module 4) is broken. The payoff doesn't just depend on StS_t and tt. It depends on the *entire path history*. This "path-dependency" makes the PDE unsolvable.
  2. The RNV Method (Lesson 6.1) is also broken. There is no clean, elegant formula for VV. We can't "solve" for EQ[Average(St)]\mathbb{E}^{\mathbb{Q}}[\text{Average}(S_t)].

We are stuck. We have a beautiful theory, but we can't get a price.

Part 2: The "Aha!" Moment (The Law of Large Numbers)

Let's go back to Module 0. How do you find the "expected value" (the average) of a simple 6-sided die?

  • Method 1 (Pure Math): You know the "formula" for the outcomes.
    E[Die Roll]=(1+2+3+4+5+6)16=3.5\mathbb{E}[\text{Die Roll}] = (1 + 2 + 3 + 4 + 5 + 6) \cdot \frac{1}{6} = 3.5
    This is what we did for the Black-Scholes formula. It's clean, but only works for simple problems.
  • Method 2 (Brute Force): What if you didn't know the "formula"? You could just:
    1. Roll the die 1,000,000 times.
    2. Write down every result: {3,1,6,4,1,5,}\{3, 1, 6, 4, 1, 5, \dots\}
    3. Calculate the simple *average* of that list.
    Because of the Law of Large Numbers, this "brute force" average will get *extremely* close to the true, pure-math answer of 3.5.

This is the "wow" moment. **We can do the exact same thing for our "impossible" Asian Option!**

We don't need to *solve* the "expected value" formula. We can *simulate* it 1,000,000 times and find the average. This "brute force" simulation is the **Monte Carlo Method**.

Part 3: The Monte Carlo Algorithm (Step-by-Step)

This is the "how-to" guide. This is what quants *actually* code.

Our Goal: Price our "Asian Option" V=er(Tt)EQ[max(Avg(S)K,0)]\to V = e^{-r(T-t)} \cdot \mathbb{E}^{\mathbb{Q}}[ \max(\text{Avg}(S) - K, 0) ]

Step 1: Get the "Magic" SDE (The Risk-Neutral SDE)

We *must* run our simulation in the "magic" risk-neutral world (from Lesson 6.1), where the drift μ\mu is replaced by the risk-free rate rr. Our stock model is:

dSt=rStdt+σStdWtQdS_t = \mathbf{r} S_t dt + \sigma S_t dW_t^{\mathbb{Q}}

Step 2: Discretize the Path (The "Random Walk" Formula)

We can't code a *continuous* path. We have to make it a step-by-step "random walk" (like our Drunkard from Lesson 1.3). This is called the **Euler-Maruyama method**.

We know from Lesson 1.3 that the "typical size" of dWtdW_t is dt\sqrt{dt}. So, we can *replace* the abstract dWtdW_t with a concrete, code-able formula:

dWtQZΔtdW_t^{\mathbb{Q}} \approx Z \cdot \sqrt{\Delta t}

where Δt\Delta t is our tiny time-step (e.g., 1 day) and ZZ is a random number from N(0,1)\mathcal{N}(0, 1) (the standard bell curve, which computers are great at generating).

Let's plug this into our SDE:

ΔS(rStΔt)+(σStZΔt)\Delta S \approx (r S_t \Delta t) + (\sigma S_t Z \sqrt{\Delta t})

This is our **coding formula**. It tells us how to get from StS_t to St+ΔtS_{t+\Delta t}.

Step 3: Simulate one *full path* (Path 1)

Let's say S0=100S_0 = 100, K=100K=100, r=5%r=5\%, σ=20%\sigma=20\%, T=1T=1 year, and we use 252 steps (trading days).

  • S0=100S_0 = 100
  • For S1S_1: Generate a random Z1Z_1 (e.g., +0.5). Calculate S1=S0+rS0Δt+σS0Z1ΔtS_1 = S_0 + rS_0\Delta t + \sigma S_0 Z_1 \sqrt{\Delta t}.
  • For S2S_2: Generate a *new* random Z2Z_2 (e.g., -1.2). Calculate S2=S1+rS1Δt+σS1Z2ΔtS_2 = S_1 + rS_1\Delta t + \sigma S_1 Z_2 \sqrt{\Delta t}.
  • ...repeat 252 times...
  • We now have one full, random path: {100,101.2,99.8,103.4,,114.5}\{100, 101.2, 99.8, 103.4, \dots, 114.5\}

Step 4: Calculate the Payoff for Path 1

We have our path. Now we calculate its *average* price.

Avg1=100+101.2+99.8++114.5252108.10 (example)\text{Avg}_1 = \frac{100 + 101.2 + 99.8 + \dots + 114.5}{252} \approx 108.10 \text{ (example)}

Now, we calculate the payoff for this one path:

Payoff1=max(Avg1K,0)=max(108.10100,0)=$8.10\text{Payoff}_1 = \max(\text{Avg}_1 - K, 0) = \max(108.10 - 100, 0) = \$8.10

We store this number.

Step 5: Repeat (The "Monte Carlo" part)

Now, we do Steps 3 and 4 again, 1,000,000 times. We get a giant list of 1,000,000 payoffs:

Payoff List={$8.10,$0,$0,$12.50,$3.14,}\text{Payoff List} = \{ \$8.10, \$0, \$0, \$12.50, \$3.14, \dots \}

Step 6: Find the "Expected Value"

By the Law of Large Numbers, the "expected value" is just the *simple average* of this giant list.

EQ[Payoff]$8.10+$0+$0+$12.50+1,000,000=$4.32 (for example)\mathbb{E}^{\mathbb{Q}}[\text{Payoff}] \approx \frac{\$8.10 + \$0 + \$0 + \$12.50 + \dots}{1,000,000} = \$4.32 \text{ (for example)}

Step 7: Get the Final Price (Discount)

This $4.32 is the average payoff in the *future*. We need its value *today*. We just discount it using our "Finance 101" formula.

V(0)=erT(Average Payoff)=e0.051($4.32)$4.11V(0) = e^{-rT} \cdot (\text{Average Payoff}) = e^{-0.05 \cdot 1} \cdot (\$4.32) \approx \mathbf{\$4.11}

We've done it. We've found the fair price for our "impossible" option.

Part 5: The "So What?" (Why This is So Powerful)

This "brute force" computer method is the *standard* for pricing complex derivatives at every major bank.

  • Pro 1: It can price *anything*.Payoff depends on the average? No problem. Payoff depends on the maximum price? No problem. Payoff depends on 3 different stocks and the weather in London? As long as you can *write the code for the payoff*, you can price it.
  • Pro 2: It works with *complex models*.The PDE method only works for our simple GBM model. What if σ\sigma is *also* random (our next lesson)? For Monte Carlo, this is *easy*! Your code just gets one more line:
    1. Simulate the random σt\sigma_t for this step.
    2. Simulate the random StS_t for this step, *using* the σt\sigma_t you just found.
    This flexibility is why MC is the default tool for modern quants.
  • Con 1: It's slow. It requires massive computing power to run millions of paths.
  • Con 2: It's an *approximation*. The PDE gives an *exact* answer. MC just gives an average that gets *closer* to the true price the more paths you run.
What's Next? (The 'Hook')

    We've seen the "PDE way" (Module 4) and the "Risk-Neutral / Computer Way" (Module 6, Lessons 1-2).

    Both of these methods relied on a *massive* simplifying assumption from Lesson 1.4: that volatility (σ\sigma) is a constant, known number (e.g., 20% forever).

    We all know this is wrong. Volatility is the *most* random, "panicky" thing in finance. A graph of volatility is just as "wiggly" as a stock price.

    What happens to our model if σ\sigma is *also* a random SDE?

    dSt=rStdt+σtStdWt1dS_t = r S_t dt + \mathbf{\sigma_t} S_t dW_t^1
    dσt=dt+dWt2d\sigma_t = \dots dt + \dots dW_t^2

    This is the "Volatility Smile" problem, and it's our next topic: Lesson 6.3: Stochastic Volatility (The Heston Model).

Up Next: Lesson 6.3: Stochastic Volatility (The Heston Model)