Skip to main content

Module fit

Module fit 

Expand description

Fitting a parametric discount curve to a bond universe.

A smoother, not a repricer. Four parameters over fifty bonds cannot reproduce fifty prices and is not meant to: what it produces is a shape, and what makes the shape judgeable is the residual per bond. So the fit returns both, from one call — a residuals accessor nobody reaches for is how a smoother ships unjudged.

Use the calibration ladder (calibrate) where exactness matters; it fits one parameter per quote and reprices every one.

§The Jacobian is seeded

The curve seam substitutes a mode-generic parameter vector, so the sensitivity of every bond’s model price to every parameter comes from one forward pass per bond — no bump size, no truncation error. Parameter counts wider than one seeding block loop over blocks, which is what par_quote_jacobian already does one layer up.

Structs§

BondFitRow
One bond’s place in a fit.
FittedBondCurve
A fitted curve and the residuals that say how well it fits.

Enums§

FitError
Why a fit produced no curve.
FitWeights
How price residuals are weighted.
FittedForm
Which functional shape a fit reaches for.
FittedFormKind
A parametric form named without its basis count.

Constants§

LANES 🔒
The seeding width one pass covers. Matches the calibration Jacobian’s, for the same reason: it is the lane count JetK carries.

Functions§

basis 🔒
A bond’s street basis — semiannual, the compounding a fitted government curve’s inputs are quoted on.
fit_bond_curve
Fit a parametric discount curve to quotes — (bond, clean price) pairs — as of reference.
model_clean 🔒
The clean price bond takes on curve, per 100 face, in mode R, where it settles from reference: the flows after settlement carried there.
residuals_and_jacobian 🔒
The weighted residual vector and its Jacobian at one parameter point.