Class KeyRateDurations

java.lang.Object
com.quantfinlib.rates.KeyRateDurations

public final class KeyRateDurations extends Object
Key-rate durations — WHERE on the curve a bond's rate risk lives. BondPricer.dv01 answers "what does one parallel basis point cost?"; a curve rarely moves in parallel, so risk desks slice that DV01 across the curve's tenors: bump ONE node, hold the rest, reprice. The vector of per-node sensitivities is the hedging recipe (each KRD is offset with the instrument that drives that node), and its sum recovers the parallel duration — a consistency check the tests pin.

Mechanics: for each curve tenor, the zero rate at that node is bumped ±1bp (all other nodes fixed — the curve's own interpolation spreads the bump between neighbors, which IS the standard convention), the bond is repriced off each bumped curve, and the central difference gives the sensitivity. Prices per 100 face follow the BondPricer convention. Research lane; deterministic.

  • Method Summary

    Modifier and Type
    Method
    Description
    static double[]
    keyRateDv01s(double face, double couponRate, int frequency, double maturityYears, YieldCurve curve)
    Per-node price sensitivities of a fixed-coupon bond to a 1bp bump of each curve tenor, in price units per 100 face (positive = the bond LOSES that much when the node rises 1bp — DV01 sign convention).
    static double
    parallelDv01(double face, double couponRate, int frequency, double maturityYears, YieldCurve curve)
    The parallel DV01 off the curve (every node bumped together) — the number the key-rate slices must add back up to, within the curve-interpolation tolerance the tests document.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • keyRateDv01s

      public static double[] keyRateDv01s(double face, double couponRate, int frequency, double maturityYears, YieldCurve curve)
      Per-node price sensitivities of a fixed-coupon bond to a 1bp bump of each curve tenor, in price units per 100 face (positive = the bond LOSES that much when the node rises 1bp — DV01 sign convention). Index i corresponds to tenors()[i] ascending.
    • parallelDv01

      public static double parallelDv01(double face, double couponRate, int frequency, double maturityYears, YieldCurve curve)
      The parallel DV01 off the curve (every node bumped together) — the number the key-rate slices must add back up to, within the curve-interpolation tolerance the tests document.