Skip to main content

Module interpolation

Module interpolation 

Source
Expand description

Interpolation toolkit, one scheme per file — the single home for every interpolation in the library (curves, smiles, surfaces) and a standalone toolkit in its own right.

1-D:

  • linear: piecewise linear with flat extrapolation — the pillar bracketing used by discount curves and smile interpolation;
  • cubic_spline: C2 cubic splines with Natural, Clamped and Not-a-Knot boundary conditions;
  • pchip: Fritsch-Carlson monotone cubic Hermite (PCHIP) — shape-preserving, no overshoot on monotone data (the safe choice for zero curves and CDF-like data);
  • akima: Akima’s spline — local, outlier-robust slopes with far less oscillation than a global cubic fit.

2-D (volatility grids):

  • bilinear: rectangular-grid bilinear interpolation with flat extrapolation;
  • thin_plate: bivariate thin-plate spline (RBF) on scattered points, with optional smoothing — for irregular vol quote grids.

Related: linalg holds the nearest-correlation projection (Higham) used to repair empirical correlation surfaces.

Re-exports§

pub use akima::Akima;
pub use bilinear::BilinearGrid;
pub use cubic_spline::BoundaryCondition;
pub use cubic_spline::CubicSpline;
pub use linear::bracket;
pub use linear::interp_pairs;
pub use linear::lerp;
pub use linear::linear_interp;
pub use pchip::Pchip;
pub use thin_plate::ThinPlateSpline;

Modules§

akima
Akima’s spline: cubic Hermite interpolation with slopes chosen from local weighted secant differences. Purely local (a moved point only affects its neighborhood) and far less prone to the wide oscillations a global cubic spline develops around outliers and flat runs.
bilinear
Bilinear interpolation on a rectangular grid — the baseline 2-D scheme for strike x expiry volatility grids.
cubic_spline
C2 cubic spline interpolation with the three classical boundary conditions.
linear
Piecewise linear interpolation and the pillar bracketing shared by curves and smiles.
pchip
PCHIP: Fritsch-Carlson monotone piecewise cubic Hermite interpolation. Shape-preserving — the interpolant is monotone wherever the data are, so it never overshoots or invents wiggles the way an unconstrained cubic spline can. The safe choice for curves that must stay monotone (discount factors, CDFs) or non-negative.
thin_plate
Bivariate thin-plate spline: the minimum-bending-energy surface through scattered (x, y, z) points — the natural interpolant for an irregular volatility quote grid (no rectangular layout required).