Docs / nablatensor-quant / com.nablatensor.quant

class

HestonModel

Heston stochastic volatility as a composable step block (Seam 5):

dS = r S dt + sqrt(v) S dW1
dv = kappa (theta - v) dt + xi sqrt(v) dW2 ,   corr(dW1, dW2) = rho

Full-truncation Euler: the drift and diffusion of v use max(v, 0) while the state may drift slightly negative, which keeps the scheme bias small. Every parameter — including rho — is a differentiable input, so one adjoint sweep returns the price plus its sensitivity to v0, kappa, theta, xi and rho next to the spot / rate Greeks. The max floor sits on a measure-zero set, so the variance-parameter adjoints match a finite bump only approximately (a few percent); the spot / rate / strike / rho adjoints are exact to Monte-Carlo noise.

Constructors

HestonModel(Nabla.Inputs<HestonMarket> in, double maturity, int steps)

Methods

State start(Nabla.Inputs<HestonMarket> in)
State step(AadRecorder rec, State s, ADouble z1, ADouble zv)

One full-truncation Euler step. z1 drives the spot; zv is an independent normal that is correlated into the variance factor here.

protected ADouble spotDrift(ADouble base)

Hook: the per-step spot log-drift. Identity for plain Heston.

protected ADouble spotDiffusion(ADouble sqrtVariance)

Hook: the sqrt(v) multiplier on the spot Brownian. Identity for plain Heston.

static BiConsumer<AadRecorder, Nabla.Inputs<HestonMarket>> european(OptionType type, double maturity, int steps)

A European call/put on the Heston terminal spot, discounted at the flat rate.