Skip to main content

Module heston

Module heston 

Source
Expand description

Heston (1993) stochastic volatility model.

Dynamics under the risk-neutral measure:

dS = (r - q) S dt + sqrt(v) S dW_s
dv = kappa (theta - v) dt + vol_of_vol * sqrt(v) dW_v,   d<W_s, W_v> = rho dt

Semi-analytic pricing uses the characteristic function in the “little Heston trap” formulation (Albrecher et al. 2007), which is branch-cut stable under the principal complex logarithm, integrated with composite Simpson. Vanilla calls/puts and both binary types come from the same two probabilities: call = S e^{-qT} P1 - K e^{-rT} P2, cash-or-nothing = e^{-rT} P2, asset-or-nothing = S e^{-qT} P1.

Monte Carlo simulation lives in the Monte Carlo engine through HestonProcess: Andersen QE with martingale correction by default, full-truncation Euler on request.

Structs§

HestonFit
Calibration outcome: fitted parameters plus fit diagnostics.
HestonParams
Heston parameters. theta is the long-run variance, v0 the initial variance, vol_of_vol the volatility of variance (often written xi or sigma), rho the spot-variance correlation.
HestonQuote
One vanilla market quote for calibration.

Functions§

analytic_npv
calibrate
Calibrate Heston parameters to European vanilla quotes.
cos_smile
Price a whole strike strip in one COS pass: the characteristic function is swept once for the expiry and every strike reuses it, so a 20-strike smile costs about the same as one option. Agrees with heston_price (the independent P1/P2 integration oracle) to ~1e-6.
heston_binary_asset_price
Semi-analytic Heston price of an asset-or-nothing binary (S e^{-qT} P1 for a call).
heston_binary_cash_price
Semi-analytic Heston price of a cash-or-nothing binary (cash * e^{-rT} * P(S_T beyond K)).
heston_price
Semi-analytic Heston price of a European vanilla option.