← Back to Learn
IV ExpertWeek 25 • Lesson 71Duration: 40 min

NUM Numerical Methods

When math can't give you an exact answer — compute it

Learning Objectives

  • Understand key numerical methods used in quantitative finance
  • Learn binomial trees, finite differences, and root-finding
  • Know when to use each method

Explain Like I'm 5

Most real-world quant problems don't have clean mathematical solutions. Numerical methods are the tools to compute approximate answers: binomial trees for option pricing, Newton's method for finding implied vol, finite differences for solving PDEs. They're the bridge between theory and practice.

Think of It This Way

Numerical methods are like using a ruler to measure a curved line. You can't measure a curve directly, but you can approximate it with many small straight segments. More segments = better approximation. Same principle — more computation steps = more accuracy.

1Binomial Trees

The CRR (Cox-Ross-Rubinstein) binomial tree: 1. At each time step, price can go UP by factor uu or DOWN by factor dd 2. u=eσΔtu = e^{\sigma\sqrt{\Delta t}}, d=1/ud = 1/u 3. Risk-neutral probability: p=(erΔtd)/(ud)p = (e^{r \cdot \Delta t} - d) / (u - d) 4. Work backwards from expiration to get the option price Pros: - Intuitive and visual - Handles American options (early exercise) - Easy to implement Cons: - Slow for many time steps - Difficult to extend to multiple dimensions For the V7 context: we don't price options with trees, but the concept of branching paths appears in decision trees and XGBoost. The idea of recursive "branching" is fundamental to both option pricing and gradient-boosted models.

2Root-Finding (Newton's Method)

Newton's method finds xx where f(x)=0f(x) = 0:
xn+1=xnf(xn)f(xn)x_{n+1} = x_n - \frac{f(x_n)}{f'(x_n)}
Used constantly in quant finance: - Implied volatility: Find σ\sigma where BS(σ)=market price\text{BS}(\sigma) = \text{market price} - Yield to maturity: Find yy where bond_price(y)=market price\text{bond\_price}(y) = \text{market price} - Calibration: Find parameters where model matches market data Newton's method is fast (quadratic convergence) but can fail: - Bad initial guess leads to divergence - Flat derivative causes huge steps - Multiple roots — might find the wrong one Practical tip: use bisection as backup. Slower but guaranteed to converge. For the V7 system: Newton's method appears in various calibration steps (threshold optimization, parameter tuning). The concept of iterative refinement is central to optimization.

Key Formulas

Newton's Method

Iteratively finds the root of f(x) = 0. Converges quadratically (doubles correct digits each step) near the root. The workhorse of numerical optimization.

CRR Up/Down Factors

Binomial tree parameters ensuring the tree matches the underlying's volatility. As delta-t approaches 0, the tree converges to the continuous Black-Scholes price.

Hands-On Code

Binomial Tree Option Pricing

python
import numpy as np

def binomial_tree(S, K, T, r, sigma, n_steps=200, option_type='call', american=False):
    """Price options using CRR binomial tree."""
    dt = T / n_steps
    u = np.exp(sigma * np.sqrt(dt))
    d = 1 / u
    p = (np.exp(r * dt) - d) / (u - d)
    
    # Build price tree at expiration
    prices = S * u**np.arange(n_steps, -1, -1) * d**np.arange(0, n_steps+1)
    
    # Option values at expiration
    if option_type == 'call':
        values = np.maximum(prices - K, 0)
    else:
        values = np.maximum(K - prices, 0)
    
    # Work backwards
    for t in range(n_steps - 1, -1, -1):
        values = np.exp(-r * dt) * (p * values[:-1] + (1-p) * values[1:])
        
        if american:
            prices = S * u**np.arange(t, -1, -1) * d**np.arange(0, t+1)
            if option_type == 'call':
                intrinsic = np.maximum(prices - K, 0)
            else:
                intrinsic = np.maximum(K - prices, 0)
            values = np.maximum(values, intrinsic)
    
    style = "American" if american else "European"
    print(f"=== BINOMIAL TREE ({style} {option_type.upper()}) ===")
    print(f"  Price: {values[0]:.4f} ({n_steps} steps)")
    
    return values[0]

Prices European and American options using the CRR binomial tree, demonstrating how trees handle early exercise — something Black-Scholes cannot.

Knowledge Check

Q1.Newton's method for implied vol uses vega as the derivative. Why?

Assignment

Implement a binomial tree and compare European option prices to Black-Scholes for 10, 50, 200, and 1000 steps. Then price an American put and verify it's worth MORE than the European put (early exercise premium).