Models

The library groups models along two axes.

Short-rate vs full-curve. Short-rate models describe the instantaneous rate \(r(t)\) and derive everything else from it; the curve at any future time is a function of a low-dimensional state. Full-curve models evolve the entire forward curve (HJM) or a vector of market forward rates (LMM), allowing richer curve movements at the cost of Monte Carlo pricing for most products.

Equilibrium vs no-arbitrage. Equilibrium models (Vasicek, CIR) imply the initial curve from their parameters: fitting a market curve is a least-squares approximation, generally inexact. No-arbitrage models (Ho-Lee, Hull-White, G2++, HJM, LMM) take the observed curve as an input and reproduce it exactly by construction.

Every short-rate model implements bond_price, zero_rate, simulate, and — where the model admits closed forms — bond_option plus cap/floor pricing via the model-independent replication of a caplet as a bond put. Models come from the factory:

from interest_rate_models import get_model

model = get_model("hull-white", curve=curve, a=0.1, sigma=0.01)

The factory accepts "vasicek", "cir" ("cox-ingersoll-ross"), "ho-lee" ("holee"), "hull-white" ("hullwhite", "hw"), "g2++" ("g2pp"), "hjm" ("heath-jarrow-morton"), and "lmm" ("libor-market-model", "bgm"), case-insensitive.

Choosing a model

Model

Family

Factors

Fits curve exactly

Closed-form bonds / options

Rates can go negative

Vasicek

equilibrium short-rate

1

no

yes / yes

yes

Cox-Ingersoll-Ross

equilibrium short-rate

1

no

yes / yes

no

Ho-Lee

no-arbitrage short-rate

1

yes

yes / yes

yes

Hull-White

no-arbitrage short-rate

1

yes

yes / yes

yes

G2++

no-arbitrage short-rate

2

yes

yes / yes

yes

Heath-Jarrow-Morton

full-curve

any

yes

MC (Gaussian)

yes

LIBOR Market Model

full-curve

up to N

yes

Black caplets, Rebonato swaptions, MC

no (lognormal forwards)

Rules of thumb: Hull-White is the workhorse for single-factor pricing against a fitted curve; G2++ adds the second factor needed for products sensitive to curve twists; CIR guarantees positive rates; the LMM prices cap/floor and swaption books in their market-standard (Black) quotation; HJM is the general framework when you need custom factor volatility structures.

Each model page follows the same structure: overview, dynamics, bond pricing, options, simulation, parameters, usage, and references.