F. HEKİMOĞLU
← cd ~/work/quant
// QUANT · OPTIONS PRICING

A neural net that can only recover Black-Scholes

A hand-rolled Black-Scholes pricer, validated to 1e-8 against py_vollib, versus a small ONNX neural net. On Black-Scholes-generated data the net can at best recover the closed form, never beat it.

00Overview

Can a neural net price options better than Black-Scholes? On synthetic data generated by Black-Scholes, the honest answer is that it can only learn the formula it was trained on. This project makes that explicit: a hand-rolled BS pricer as the oracle, a small net as the challenger, and a clean statement of what the comparison can and cannot show.

01Method

  • Hand-rolled Black-Scholes with full Greeks (Delta, Gamma, Vega, Theta, Rho).
  • Put-call parity verified by Hypothesis property tests.
  • A scikit-learn MLP regressor exported to ONNX via skl2onnx, served by onnxruntime.
  • py_vollib as an independent pricing oracle.

02The honest framing

The BS pricer matches py_vollib to 1e-8. On Black-Scholes-generated quotes the net reprices to an RMSE of ~0.053, inside the sanity band: a convergence check, not an improvement. The Diebold-Mariano statistic (-2.46, p=0.016) simply confirms the net is not better than the closed form it learned from. Real smile mispricing only appears on real option chains.

py_vollib parity1e-8
NN reprice RMSE~0.053
Verdictrecovers, not beats

03Stack & links

pythonscikit-learnonnxblack-scholespy_vollib
SEC 00 · INDEXENDARK--:--:--⌘K / ? help