Implements and compares Black-Scholes, Heston, and Merton Jump-Diffusion models on real AAPL equity options data (2016–2020). The pipeline covers data ingestion, date-driven rate calibration, implied vol surface construction, multi-expiry calibration, analytical Greeks, and publication-quality visualisations.
Under the risk-neutral measure, the stock follows:
The call price is:
Implemented without dividends, consistent with the original formulation. A flat vol σ is calibrated per-expiry by minimising vega-weighted relative price error via scipy.optimize.minimize_scalar (bounded Brent). The vol surface is built with QuantLib's BlackVarianceSurface and bicubic interpolation.
Limitation: a single flat σ cannot reproduce the volatility smile. Average absolute error on the 1-year expiry: ~4.0%. Overall vega-weighted error across 17 expiries: 16.5%.
Variance evolves as a mean-reverting CIR process correlated with the spot:
| Parameter | Meaning |
|---|---|
| Initial instantaneous variance | |
| Mean-reversion speed | |
| Long-run variance | |
| Vol-of-vol | |
| Spot-vol correlation (negative = leverage effect) |
The Feller condition
Priced via QuantLib's AnalyticHestonEngine (Fourier inversion), calibrated with LevenbergMarquardt against market call prices. Dividend yield included via the Merton (1973) continuous-dividend extension.
Calibrated parameters (2018-05-15): v₀ = 0.1704, κ = 9.54, θ = 0.0694, σᵥ = 3.36, ρ = −0.463. Average absolute error: 1.52%.
Augments BS diffusion with a compound Poisson jump process:
where
Truncated at 50 terms (early exit when weights drop below 1e-12). Calibrated via multi-start L-BFGS-B (5 random seeds, objective = IV-RMSE).
Calibrated parameters (2018-05-15): σ = 15.9%, λ = 0.57 jumps/yr, μ_J = −18.5%, σ_J = 22.6%. This implies roughly one crash-sized jump per year averaging a −14.7% return - economically consistent with AAPL tail risk pricing over 2018. IV-RMSE = 0.22%.
Greeks are derived analytically by differentiating the infinite series term-by-term, applying the chain rule for the per-term vol:
ATM Greeks at S = K = 186.44, T = 1.101 yr (2018-05-15):
| Greek | Value | Interpretation |
|---|---|---|
| Price | $19.51 | ATM call value |
| Delta Δ | 0.6151 | $0.615 gain per $1 spot move |
| Gamma Γ | 0.00867 | Delta change per $1 spot move |
| Vega σ | 52.88 | $52.88 per unit diffusion vol increase |
| Vega σ_J | 26.90 | $26.90 per unit jump vol increase |
| Theta Θ | −0.02864 | ~$0.029 loss per calendar day |
| Rho ρ | 1.0481 | $1.05 per 1 bp rise in r |
The market vol surface is built from QuantLib BlackVarianceSurface with bicubic interpolation across 17 expiries, showing a pronounced left-wing skew and upward-sloping term structure (~18% short-dated to ~26% at 2 years).
| Metric | Black-Scholes | Heston | Merton JDM |
|---|---|---|---|
| Parameters | 1 per expiry | 5 | 4 |
| Avg price error (1yr) | 3.97% | 1.52% | 0.34% |
| IV-RMSE (1yr) | ~400 bp | ~150 bp | 14 bp |
| Smile shape | Flat | Monotone skew | Flexible skew + curvature |
| Greeks | Analytical | Numerical / QL | Analytical (series) |
Data: AAPL options chain (CBOE-style CSV) from Kaggle by Kyle Graupe, 2016-01-04 to 2020-12-31. Strike filter: ±20% moneyness band around spot.
Risk-free rates from FRED H.15 (1-year Treasury CMT) and AAPL dividend yields are linearly interpolated by fractional year - no fixed arbitrary rate. Black-Scholes is implemented without dividends per its original formulation; Heston and Merton include continuous dividend yield.
Python 3.9+ required. QuantLib can be tricky on Windows - use conda if pip fails.
pip install -r requirements.txt
# or
conda install -c conda-forge quantlib-python numpy pandas scipy matplotlibEach script prompts for a quote date at runtime:
python models/BlackScholesOPM.py # calibration table + 4 graphs
python models/HestonOPM.py # Heston params + Feller check + 3 graphs
python models/MertonJumpDiffusionOPM.py # multi-start calibration + Greeks + 4 graphsInteresting dates: 2020-03-16 (COVID crash), 2019-01-03 (AAPL profit warning), 2016-06-24 (Brexit vol spike).
- Black & Scholes (1973). The Pricing of Options and Corporate Liabilities. Journal of Political Economy.
- Heston (1993). A Closed-Form Solution for Options with Stochastic Volatility. Review of Financial Studies.
- Merton (1976). Option Prices When Underlying Stock Returns Are Discontinuous. Journal of Financial Economics.
- Gatheral (2006). The Volatility Surface: A Practitioner's Guide. Wiley Finance.
- Cont & Tankov (2004). Financial Modelling with Jump Processes. Chapman & Hall.
- QuantLib · FRED H.15
Python 3.12 · QuantLib · NumPy · SciPy · Matplotlib · MIT License


