Docs / nablatensor-quant / com.nablatensor.quant

class

SchwartzOneFactor

Schwartz one-factor mean-reverting commodity spot as a composable step block (Seam 5) — the same Ornstein-Uhlenbeck machinery as HullWhite1F, applied to the log price:

d ln S = kappa (level - ln S) dt + sigma dW

The log price is Gaussian, so at horizon T:

  • E[ln S_T] = e^{-kappa T} ln S_0 + (1 - e^{-kappa T}) level;
  • Var[ln S_T] = sigma^2 (1 - e^{-2 kappa T}) / (2 kappa), which tends to the stationary sigma^2 / (2 kappa);
  • the futures price is futuresPrice below.

Constructors

SchwartzOneFactor(Nabla.Inputs<SchwartzMarket> in, double maturity, int steps)

Methods

ADouble startLog(Nabla.Inputs<SchwartzMarket> in)
ADouble step(ADouble logSpot, ADouble z)

One Euler step on the log price.

static double futuresPrice(SchwartzMarket m, double maturity)

The closed-form futures price today for delivery at T: exp( e^{-kappa T} ln S_0 + (1 - e^{-kappa T}) level + sigma^2 (1 - e^{-2 kappa T}) / (4 kappa) ).

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

European call/put on the terminal spot, discounted at the flat rate. Not a futures option — the underlying is S_T itself.