Class Heston
dS = (r−q)S dt + √v S dW₁ dv = κ(θ − v) dt + σᵥ √v dW₂, d⟨W₁,W₂⟩ = ρ dtso the model PRODUCES a smile: ρ < 0 tilts it (equity skew — spot down, vol up), σᵥ fattens the wings, κ/θ set how fast and where variance mean-reverts.
Pricing is semi-analytic: the European call is two probabilities recovered from the model's characteristic function by numerical integration. This implementation uses the "little Heston trap" formulation (Albrecher et al. 2007), which is numerically stable for long maturities where the original 1993 branch-cut form explodes, and fixed-step Simpson integration on a damped integrand — deterministic, allocation-light, and accurate to well past test tolerance for practical parameter ranges.
Honesty notes: the Feller condition 2κθ ≥ σᵥ² keeps
the variance strictly positive; parameters violating it are accepted
(markets calibrate there constantly) but the Monte Carlo cross-check
in the tests uses full-truncation Euler for exactly that reason. No
calibration is shipped — calibrating five parameters to a vol surface
is an optimization-layer exercise (optimization package tools
apply); this class prices given parameters. Research lane.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic doublecall(double spot, double strike, double rate, double divYield, double timeYears, Heston.Params p) European call under Heston (semi-analytic).static doublecallMonteCarlo(double spot, double strike, double rate, double divYield, double timeYears, Heston.Params p, int steps, int paths, long seed) Full-truncation Euler Monte Carlo — the pricing cross-check (used by the tests to validate the semi-analytic integral, and usable for payoffs the closed form cannot reach).static doubleput(double spot, double strike, double rate, double divYield, double timeYears, Heston.Params p) European put via put-call parity.
-
Method Details
-
call
public static double call(double spot, double strike, double rate, double divYield, double timeYears, Heston.Params p) European call under Heston (semi-analytic). -
put
public static double put(double spot, double strike, double rate, double divYield, double timeYears, Heston.Params p) European put via put-call parity. -
callMonteCarlo
public static double callMonteCarlo(double spot, double strike, double rate, double divYield, double timeYears, Heston.Params p, int steps, int paths, long seed) Full-truncation Euler Monte Carlo — the pricing cross-check (used by the tests to validate the semi-analytic integral, and usable for payoffs the closed form cannot reach). Deterministic per seed.
-