Quantitative Methodology & Mathematical Specification
All mathematical models, Monte Carlo estimators, Greeks derivations, stochastic-volatility pricing, and defensible design decisions.
1. The Model: Geometric Brownian Motion (GBM)
The underlying stock price evolves under the risk-neutral measure according to:
Exact Closed-Form Solution
Applying Itô’s Lemma to gives the exact terminal price:
2. Black-Scholes-Merton Analytical Benchmark & Greeks
Closed-form formulas with continuous dividend yield (Merton 1973):
Under the risk-neutral measure, the option price is the discounted expected payoff: . Monte Carlo estimates this same expectation numerically.
Analytical Greeks
| Greek | Call | Put | Meaning |
|---|---|---|---|
| Delta (Δ) | Spot sensitivity | ||
| Gamma (Γ) | Identical to Call | Convexity | |
| Vega (ν) | Identical to Call | Vol sensitivity | |
| Theta (Θ) | Identical to Call | Time decay / day | |
| Rho (ρ) | Rate sensitivity |
3. Why Monte Carlo for a Problem Black-Scholes Already Solves?
For European vanillas under GBM, Monte Carlo is strictly worse than Black-Scholes: slower, noisier, estimates what BS computes exactly.
MC generalises where no closed form exists: path-dependent payoffs, baskets, American exercise (LSM), stochastic volatility. BS is the exception, not the rule.
Numerical machinery validated against known truth before applying it where truth is unknown. This is the intellectual foundation of the project.
4. Monte Carlo Estimator & O(N^{-1/2}) Convergence
Convergence rate: — halving error requires 4× paths. Empirically validated by regressing on across a geometric grid and confirming slope ≈ −0.5.
5. Variance Reduction Techniques
5.1 Antithetic Variates
For each draw , also evaluate payoff at . Monotonic payoffs guarantee negatively correlated pairs.
5.2 Control Variates (S_T)
Uses as control with known expectation (Boyle 1977).
5.3 Combined Antithetic + CV
Apply antithetic pairing first, then CV correction to paired averages. The techniques target different variance components and stack without redundancy.
| Method | Paths | Std Error | Rel. Efficiency |
|---|---|---|---|
| Standard MC | N | SE_{std} | |
| Antithetic | 2N | SE_{AV} | |
| Control Variates | N | SE_{CV} | |
| Antithetic + CV | 2N | SE_{AV+CV} | |
| RQMC (Sobol) | N | SE_{RQMC} |
6. Randomized Quasi-Monte Carlo (Sobol)
Replaces pseudo-random draws with low-discrepancy sequences — deterministic point sets covering more uniformly than random sampling — then randomises them via Owen scrambling for error estimation.
is enforced to a power of 2 — the natural regime for Sobol optimal equidistribution. For smooth integrands, RQMC converges at vs standard MC’s : halving error requires only 2× paths, not 4×.
7. Finite-Difference Greeks (Common Random Numbers)
Central differences on Monte Carlo prices, reusing the same seed across base and bumped scenarios:
Analogous central differences for Vega ( bump), Theta ( one-sided), and Rho ( bump). Default bump: 0.5–1% of the parameter value.
8. Implied Volatility Solver
Given a market price, find such that:
No closed-form inverse exists (BS is transcendental in ), so numerical root-finding is required.
Fallback — Brent’s method:Activates when Vega → 0 (deep ITM/OTM, near-expiry). Brent’s method requires no derivative and is guaranteed to converge on a bracketed interval.
9. P&L Attribution (P&L Explain)
Decomposes a scenario price change into component contributions by Greek:
| Term | Greek | Driver | Interpretation |
|---|---|---|---|
| Delta | Spot | Directional exposure | |
| Gamma | Spot² (convexity) | Profit from large moves; always +ve for long options | |
| Vega | Vol | Volatility exposure | |
| Theta | Time | Cost of optionality; −ve for long options | |
| Rho | Rate | Interest rate exposure | |
| Residual | Cross-terms | Vanna, Volga, cross-Gamma, higher-order |
The residual captures everything the second-order expansion misses: Vanna (), Volga (), cross-Gamma interactions, and higher-order Taylor terms. For small scenario moves, first-order terms (especially Delta) dominate.
10. 2D Risk Grid
A surface (625 points) computed across dual parameter axes. Every cell is evaluated in a single broadcast operation — no nested Python loops:
| Axis Pair | What It Reveals |
|---|---|
| Spot × Vol | Gamma as curvature along spot axis; Volga along vol axis |
| Strike × Expiry | Term structure of option value across strikes |
| Spot × Time | Option decay as expiry approaches at different moneyness |
Vectorisation via NumPy broadcasting: shape , shape → broadcast to . The heatmap renders colour intensity proportional to price, with crosshairs at the base-case parameters.
11. Heston Stochastic Volatility Model
The Heston (1993) model lets variance follow its own mean-reverting square-root process, so the volatility smile/skew is modeled rather than assumed constant:
Pricing by Fourier Inversion
The Heston density has no closed form, but the characteristic function of does. Prices come from integrating two risk-neutral probabilities:
Evaluated by Gauss-Legendre quadrature on a fixed node grid (the nodes are parameter-independent and cached). Puts follow from put-call parity, exact under Heston. Two numerical guards matter: the branch of is chosen so , and the term is computed in log space to avoid catastrophic cancellation in the deep-OTM wings.
Greeks & the Volatility Chain Rule
Because the Heston price is deterministic (no Monte Carlo noise), central finite differences are clean. Volga and Vanna are reported w.r.t. the volatility , requiring a chain-rule correction:
12. SVI Volatility Surface
The raw SVI parameterization (Gatheral, 2004) describes the implied-vol smile at a fixed expiry as a function of log-moneyness :
Each expiry’s points are fit by nonlinear least squares on total variance , from three restarts. The fitted is clamped so , keeping the slice arbitrage-free in strike.
A surface is a set of slices with total variance interpolated linearly in at fixed log-moneyness (sticky-strike). A calendar-arbitrage check rejects any surface where total variance decreases with time to maturity at a fixed moneyness — such a surface would admit a riskless calendar-spread arbitrage.
A second guard checks butterfly (strike) arbitrage: call prices must be convex in strike, equivalently the implied risk-neutral density must be non-negative. On a discrete strike grid this is . Each fitted slice reports an flag plus the strike of the worst violation, so the chart can badge exactly where a surface breaks.
The same fit yields the ATM volatility term structure — the at-the-money implied vol at every expiry — and a Greeks surface: any Greek priced across strikes × expiries where each cell uses the SVI implied vol for its own strike, so the surface reflects the smile rather than a flat vol.
13. Heston Calibration
Fits to observed market option prices by minimizing a blended objective via :
A pure relative error over-penalizes deep-OTM options (tiny prices make any small misprice a huge percentage), dragging the fit into the wings. Blending in the mean-normalized absolute error keeps the ATM backbone dominant while relative error still shapes the smile.
Hard-constraining forces infeasible optimizer restarts. A soft penalty lets the fit trade feasibility against quality — and reports whether Feller holds, as practitioners do.
restarts from an ATM-implied-vol seed plus log-uniformly spread seeds () — right for positive scale parameters. Reproducible via .
14. Model Validation
Scores a calibrated Heston model against the same market quotes it was fitted to, answering “how well does the model reproduce observed prices/vols, and are the market quotes internally consistent?”
| Metric | Definition |
|---|---|
| Price Rel RMSE | |
| Price MAPE | |
| IV RMSE | NaN-robust: over contracts with resolvable implied vols only |
| Market parity violation | Largest |put-call parity RHS − market price| across the chain |
15. Assumptions & Limitations
| Assumption | Reality | Treatment |
|---|---|---|
| Constant volatility | Smile/skew varies by strike & expiry | Single σ input for GBM; the quant workspace fits Heston & SVI models to the smile |
| GBM / log-normal returns | Fat tails & negative skew | GBM; Merton jump-diffusion as extension |
| Constant risk-free rate | Term structure, stochastic rates | Flat r; bond curve integration as fix |
| Continuous dividend yield | Discrete cash payments | Continuous q approx; discrete modeling as gap |
| European exercise only | Most US options are American | Explicit scope; Longstaff-Schwartz LSM as fix |
| Frictionless markets | Bid-ask spreads, market impact | Not modeled; pricing vs trading system distinction |
| Risk-neutral measure Q | Physical drift ≠ risk-neutral drift | Priced under Q; appropriate for hedging, not forecasting |
16. Multi-Leg Strategy Engine
A strategy is a portfolio of 1–10 signed legs — a long has positive quantity, a short negative. Each option leg is priced by closed-form Black-Scholes; stock legs are valued at the forward-carried price with .
Portfolio Greeks are quantity-weighted sums of the per-leg Greeks. The net premium is the signed sum of leg values: positive = debit (we pay to enter), negative = credit (we were paid).
The spot levels where net P&L = 0, found by linear interpolation across the net P&L's zero crossings (where payoff = net premium).
Exact: the payoff is piecewise-linear, so extrema live at strike kinks and the tails. Unbounded (∞) is reported when the high-tail slope is nonzero — a finite grid scan would misstate this.
17. Scenario Stress Testing
Reprices an option under named market scenarios — 2008 Crisis (−40% spot, +20 vol pts, +100 bp rates), COVID Crash, Vol Crush, Flash Crash — each defined as coordinate shifts in spot, vol, rate, and elapsed time:
Every scenario reports its repriced option value plus absolute and percentage P&L versus the base price. The engine selects the worst/best scenarios and computes an unrealized-risk metric — the largest single-scenario loss as a fraction of the base price.
18. Put-Call Parity Data-Quality Probes
Put-call parity is the no-arbitrage identity . The probes run it in reverse: given market prices, what rate or dividend is the market implicitly assuming? Consistent quotes land near consensus values; a large divergence flags stale mids, crossed markets, or mis-priced dividends.
19. Delta-Hedging Comparison
Benchmarks two hedging strategies across hundreds of simulated Heston paths: BS hedging (constant implied vol) versus Heston hedging (model-informed deltas that adapt to the current variance state). The hedger is short the option — receives premium at , delta-hedges to expiry, and the hedging error reveals which strategy is more precise.
Hedging Error
BS Delta (Fixed IV)
Solve for from the Heston ATM price at , then use that constant vol for every rebalance:
Heston Delta (Expected Average Variance)
The delta uses the BS formula evaluated at , where is the expected time-averaged variance over the remaining life. For the CIR variance process:
Transaction Costs
Summary Statistics
20. Design Decisions FAQ
| Question | Rationale |
|---|---|
| Why MC for something BS solves? | Validation infrastructure for machinery meant to generalise to unsolvable cases |
| Why S_T as control, not BS price? | BS is the benchmark; using it as control would be circular |
| Why exact GBM sampling? | Closed-form terminal density makes Euler bias unnecessary |
| Why normal CI, not bootstrap? | CLT applies cleanly to i.i.d. draws; bootstrap adds cost with no benefit |
| Why FD Greeks need CRN? | Without CRN, bumps are swamped by MC noise, not sensitivity |
| Why continuous dividend yield? | Free data lacks reliable ex-div schedules; explicitly named gap |
| Why close-to-close vol? | Data quality across US, Indian, FX, and cryptocurrency tickers matters more than marginal efficiency |
| Why default_rng not RandomState? | PCG64 is superior; avoids shared global state in concurrent backend |
| Why Newton-Raphson + Brent? | NR fast near root; Brent handles near-zero-Vega without derivative |
| Why residual in P&L explain? | Taylor expansion exact only for infinitesimal moves; residual = cross-Greeks + higher-order |
| Why vectorise the risk grid? | 625 cell-level loops dominate runtime; broadcast evaluates all at NumPy speed |
| Why RQMC instead of standard MC? | O(N^{-1}) vs O(N^{-1/2}) convergence for smooth integrands; CI is heuristic |
| Why Fourier inversion for Heston? | No closed-form density, but the characteristic function is closed form — fast, deterministic, no MC noise in Greeks |
| Why Volga w.r.t. √v₀, not v₀? | Traders quote volatility; chain rule 4v₀·V″ + 2·V′ converts variance bumps |
| Why blend relative + absolute RMSE in calibration? | Pure relative over-penalizes deep-OTM; the blend keeps ATM dominant while the smile stays shaped |
| Why reject calendar arbitrage at build? | Total variance decreasing in T admits a riskless spread; rejecting keeps surfaces economically sane |
| Why not verify an implied rate by recomputing parity? | It is a tautology — the parameter is defined as the parity-solver; it reproduces the spread by construction and never fails |
| Why analytic max profit/loss for strategies? | Expiration payoff is piecewise-linear; extrema are exact at kinks/tails, and unbounded (∞) is reported correctly |
| Why are parity probes ATM-only? | ATM quotes are the most liquid and least corrupted by deep-OTM noise — the cleanest rate/dividend signal |
| Why hedge with expected avg variance, not spot v_t? | Spot v_t overreacts to vol spikes and ignores mean reversion; E[v_avg] smooths the delta and produces a tighter error distribution |
| Why solve BS IV from the Heston price? | Traders observe market IV and hedge with it — the fixed-IV BS strategy replicates this realistic scenario, not an artificial one |
| Why transaction costs at 5 bps default? | A reasonable equity round-trip cost; zero TC makes both strategies look perfect, masking the practical rebalancing penalty |
| Why even n_paths for antithetic variates? | Antithetic pairs (+Z, −Z) require pairing; odd counts would leave one unpaired path, breaking the variance-reduction guarantee |