Examples#
This gallery walks through every public feature of
financialkit.stochastic_volatility: local volatility, stochastic
volatility, jumps, Fourier pricing, smile parametrisations and Heston
simulation. Each script illustrates one dated breakthrough from the
history page.
See also the narrative tutorials:
Each script in this gallery is self-contained and can be run directly with
python examples/stochastic_volatility/<section>/<script>.py.
Sections#
local_vol – Cox’s CEV model and Dupire’s local volatility.
jumps – Merton’s jump diffusion, the Madan-Seneta and Madan-Carr-Chang variance gamma, Bates and Kou.
heston – Hull and White’s mixing formula and the Heston model.
fourier – Carr-Madan’s FFT, Lewis’s single integral and the COS method.
smile – Hagan’s SABR, Gatheral’s SVI and Lee’s moment formula.
simulation – Andersen’s QE scheme and full-truncation Euler.
Fourier pricing#
Pricing from the characteristic function: Carr and Madan’s FFT, Lewis’s single integral and Fang and Oosterlee’s COS expansion.
Stochastic volatility#
Volatility with its own randomness: Hull and White’s mixing formula for uncorrelated variance, and Heston’s correlated square-root model.
Jumps#
Discontinuous prices: Merton’s jump diffusion, the variance gamma process in its symmetric and skewed forms, Bates’s jumps on top of Heston, and Kou’s double-exponential jumps.
Local volatility#
Volatility as a function of the price level and time: Cox’s constant elasticity of variance and Dupire’s formula, which reads the local volatility off a surface of option prices.
Simulation#
Monte Carlo for Heston when the variance can hit zero: Andersen’s quadratic-exponential scheme and the full-truncation Euler scheme.
Smile parametrisations#
Shapes for the implied volatility smile: Hagan’s SABR formula, Gatheral’s SVI, and Lee’s bound on how steep the wings can be.