Max Krehbiel

All projects

Options Density Lab

Option prices hold the market's own odds for where a price will end up. This recovers that probability distribution from a chain of option quotes: it cleans the quotes, fits a smooth volatility smile that rules out arbitrage, and reads the distribution off with the Breeden-Litzenberger identity.

Every quote comes from a model whose true distribution is known, so each step can be graded against the right answer. Across 10 test chains, the recovered distribution's median error is between 0.8% and 1.9%.

Options Density Lab: example output

View the code (opens in a new tab)Read the README (opens in a new tab)

The problem

Recover the probability distribution that option prices imply, and show the method gets it right.

What I built

A pipeline that drops unusable quotes, estimates the forward price from put-call parity, fits an SVI or spline smile with no-arbitrage penalties, and differentiates call prices to get the density.

What it produces

Densities and cumulative distributions by expiry, no-arbitrage checks, error against the known truth and a demo that grades itself.

A public version of one building block of my OpenK research, run on synthetic quotes.

Every quote is generated from a seeded Heston model. No market or vendor data is used.

In pictures

Price distributions recovered from synthetic option quotes at four expiries, with both fitting methods drawn over the known true density.
Quote cleaning at 30 days: two strikes fail the put-call parity check and are dropped before fitting. All quotes are synthetic.
Implied-volatility smiles fitted to synthetic bid and ask quotes, compared with the true smile at each expiry.
Cumulative distributions and their error against the synthetic truth, which stays within about 2 percentage points at every expiry.
No-arbitrage checks on the fitted surface: total variance rises with expiry and the butterfly condition stays above zero, so both pass.
Recovery error across 10 independently generated synthetic chains; the median error stays under 2% for both methods at every expiry.

How it works

  1. Generate. A seeded option chain with realistic spreads, stale quotes and crossed quotes.
  2. Clean. Drops unusable quotes and estimates the forward from put-call parity.
  3. Fit. A smooth volatility smile with no-arbitrage penalties.
  4. Recover. Density and cumulative distribution from second differences of call prices.
  5. Check. Butterfly, calendar, positivity and total-probability checks.
  6. Validate. Error against the known truth and a pass or fail self-check.

Where to look in the code