Docs / nablatensor-quant / com.nablatensor.quant

final class

LmmModel

A four-factor LIBOR Market Model (BGM) strip as a step block (Seam 5).

Four forward rates L1..L4 over equal accrual periods of length tenor, evolved log-normally under the terminal measure with a flat instantaneous volatility and a flat Brownian correlation:

dL_i / L_i = mu_i dt + vol dW_i ,   corr(dW_i, dW_j) = corr
mu_i       = - vol * sum_{j>i} corr * tenor * vol * L_j / (1 + tenor L_j)

Terminal measure (numeraire = bond maturing after the last period), so the drift of the last forward is zero and the others carry the usual frozen-per-step summation. vol and corr are differentiable inputs. The demo payoff is a physically-settled payer swaption on the strip.

Constructors

LmmModel(Nabla.Inputs<LmmMarket> in, double expiry, int steps)

Fields

static final int RATES

Methods

ADouble[] start(Nabla.Inputs<LmmMarket> in)
ADouble[] step(AadRecorder rec, ADouble[] l, ADouble[] z)

One log-Euler step with a frozen terminal-measure drift; z[i] correlated already.

ADouble[] draw(AadRecorder rec)

Per-step innovations. This minimal build uses independent innovations and carries the flat corr only through the drift summation; a full SDouble Cholesky of the innovations (so dV/dcorr also picks up the diffusion channel) is a later refinement.

static BiConsumer<AadRecorder, Nabla.Inputs<LmmMarket>> payerSwaption(double expiry, int steps, double strike)

Payer swaption struck at K, expiring after steps sub-steps, on the whole four-period strip; settled with the model's own annuity.

static BiConsumer<AadRecorder, Nabla.Inputs<LmmMarket>> receiverSwaption(double expiry, int steps, double strike)

Receiver swaption: annuity * max(K - swapRate, 0).

static BiConsumer<AadRecorder, Nabla.Inputs<LmmMarket>> capFloor(OptionType type, int stepsPerPeriod, double strike, double notional)

Cap (CALL) or floor (PUT) on the four-period strip: the strip is evolved stepsPerPeriod sub-steps per accrual period; forward L_i is read at the start of period i as its reset, and the caplet tenor * max(sign (L_i - K), 0) pays at the period end, discounted with the model's own reconstructed factors.