Docs / quant / com.nablatensor.quant

class

GbmPath

Geometric Brownian motion as a composable model step (Seam 5).

Each step is the exact log-Euler solution of dS = rS dt + sigma S dW over that step's interval:

S_{i+1} = S_i * exp((r - sigma^2/2) dt_i + sigma sqrt(dt_i) Z)

with dt_i = maturity * grid.fraction(i). For a uniform(int) grid every dt_i is identical and the per-step drift and diffusion are a single shared tape node, so the recording matches the earlier fixed-dt form exactly.

Subclass and override drift(SDouble) or diffusion(SDouble) to get a displaced-diffusion or a term-structure variant without touching the driver or the engine.

Constructors

GbmPath(AadRecorder rec, SDouble rate, SDouble vol, int steps, SDouble maturity)

Uniform-grid convenience: n equal steps to maturity.

GbmPath(AadRecorder rec, SDouble rate, SDouble vol, TimeGrid grid, SDouble maturity)

Methods

protected SDouble drift(SDouble perStepDrift)

Hook: the deterministic per-step log-return. Identity for plain GBM.

protected SDouble diffusion(SDouble perStepVol)

Hook: the per-step volatility multiplier on Z. Identity for plain GBM.

SDouble step(SDouble spot, SDouble z, int i)

One step forward from step i given a standard-normal draw z.