This project explores several approaches to pricing European options, starting from the analytical Black-Scholes model and progressing to Monte Carlo simulation and neural network surrogates.
The aim was to build a compact project that combines quantitative finance, differentiable programming, numerical methods, and modern machine learning tools.
The project is organised as a sequence of notebooks that gradually build in complexity:
- Implement the Black-Scholes model and analytical Greeks
- Reimplement the model in JAX and compute Greeks using automatic differentiation
- Price options using Monte Carlo simulation
- Train a neural network to learn the pricing function
- Recover Greeks directly from the trained neural network using PyTorch Autograd
- Implement European call and put pricing
- Compute analytical Delta, Gamma, and Vega
- Verify put-call parity
- Visualise option prices and Greeks
- Reimplement Black-Scholes in JAX
- Compute Greeks using
jax.grad - Vectorise calculations using
vmap - Accelerate computation using
jit - Compare analytical and autodiff Greeks
- Simulate terminal stock prices under Geometric Brownian Motion
- Estimate option prices using Monte Carlo simulation
- Compare Monte Carlo prices against Black-Scholes
- Study convergence as the number of paths increases
- Benchmark JIT performance
- Generate a synthetic option pricing dataset
- Train a neural network to approximate the Black-Scholes pricing function
- Evaluate predictive performance on unseen data
- Analyse prediction errors and model behaviour
- Compute Delta, Gamma, and Vega using PyTorch Autograd
- Compare neural and analytical Greeks
- Analyse error distributions
- Investigate performance in high-Gamma regions
- JAX autodiff Greeks matched analytical Black-Scholes Greeks to numerical precision
- JIT compilation provided significant performance improvements for large computations
- Monte Carlo estimates converged towards analytical Black-Scholes prices
- The neural network learned the pricing surface with low prediction error
- Neural Delta and Vega closely matched analytical sensitivities
- Gamma proved more challenging, particularly for at-the-money options near expiry
- Python
- NumPy
- SciPy
- Pandas
- Matplotlib
- JAX
- PyTorch
- Scikit-Learn
Possible extensions include:
- Joint training on prices and Greeks
- Physics-Informed Neural Networks (PINNs)
- Heston stochastic volatility models
- Implied volatility calibration
- Volatility surface modelling
- Real option-chain data
Built as a practical exploration of quantitative finance, automatic differentiation, and machine learning for option pricing.