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
2Root-Finding (Newton's Method)
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
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).