This project extends the classic Black-Scholes framework by implementing the Heston stochastic volatility model. Unlike Black-Scholes, where volatility is constant, Heston models volatility as a mean-reverting stochastic process, leading to a more realistic price distribution. The analytical solution requires numerical integration over a complex characteristic function.
Monte Carlo simulation: Simulates 10000 different paths that the price can follow.
Analytical price: Calculates the fair price using the analytical formula, which includes the complex integral.
Price and volatility visualization: Generates a visual representation of both price and volatility paths for the first 20 simulations.
Convergence plot: Plots the running average to check that the simulation tends to the analytical optimal price.
The convergence plot shows how the Law of Large Numbers works because with 50000 simulations the average price and the analytical price are almost exactly the same.
Call price (Monte Carlo): $10.3962
Call price (Analytical): $10.3942
Difference: $0.0020
Delta: 0.6917
numpy, matplotlib, numba, scipy
Execute python heston_mc.py