Class MultiCurveRisk
java.lang.Object
com.quantfinlib.rates.MultiCurveRisk
Curve risk on a bootstrapped OIS + projection curve pair by bumping the
market quotes and rebuilding: the sensitivities a desk hedges with,
because they are expressed in the instruments it can trade.
All results are the change in pv(discount, projection) for a
+1bp move in the named quote(s), by central difference
(PV(+1bp) - PV(-1bp)) / 2, which removes the second-order term.
bucketedDv01(LocalDate, List, List, CurveInterpolation, ToDoubleBiFunction): one quote at a time (OIS quotes first, then projection quotes, each in the order given). Rebuilding moves the projection curve too when an OIS quote moves, because the projection bootstrap discounts on OIS.keyRateDv01(LocalDate, List, List, CurveInterpolation, ToDoubleBiFunction, double[]): Ho (1992, "Key rate durations", Journal of Fixed Income 2(2)) triangular weights on the pillar times of both instrument sets; key j moves each quote byw_j(t) * 1bp, w_j the hat function on the key tenors (flat beyond the first and last key). The weights sum to one at every t, so the key-rate DV01s add up toparallelDv01(LocalDate, List, List, CurveInterpolation, ToDoubleBiFunction)to first order.parallelDv01(LocalDate, List, List, CurveInterpolation, ToDoubleBiFunction): every quote +1bp.
On a log-linear curve the buckets add up to the parallel DV01 to about 1e-7 relative. A monotone-convex curve is continuous but not differentiable in its quotes where an interval changes shape zone, so a 1bp bump can cross a kink and the buckets then add up only to within a few percent of the parallel figure; the gap closes as the bump shrinks.
-
Method Summary
Modifier and TypeMethodDescriptionstatic double[]bucketedDv01(LocalDate valuationDate, List<CurveInstrument> oisInstruments, List<CurveInstrument> projectionInstruments, CurveInterpolation interpolation, ToDoubleBiFunction<DiscountCurve, DiscountCurve> pv) Per-quote DV01, OIS quotes first then projection quotes.static CurvePairbuildCurves(LocalDate valuationDate, List<CurveInstrument> oisInstruments, List<CurveInstrument> projectionInstruments, CurveInterpolation interpolation) Builds the curve pair: OIS fromoisInstruments, projection fromprojectionInstrumentsdiscounted on it (the OIS curve itself when that list is empty).static double[]keyRateDv01(LocalDate valuationDate, List<CurveInstrument> oisInstruments, List<CurveInstrument> projectionInstruments, CurveInterpolation interpolation, ToDoubleBiFunction<DiscountCurve, DiscountCurve> pv, double[] keyTenorsYears) Key-rate DV01s atkeyTenorsYears(strictly increasing, ACT/365F years); one value per key.static doubleparallelDv01(LocalDate valuationDate, List<CurveInstrument> oisInstruments, List<CurveInstrument> projectionInstruments, CurveInterpolation interpolation, ToDoubleBiFunction<DiscountCurve, DiscountCurve> pv) DV01 for a +1bp move in every quote.
-
Method Details
-
buildCurves
public static CurvePair buildCurves(LocalDate valuationDate, List<CurveInstrument> oisInstruments, List<CurveInstrument> projectionInstruments, CurveInterpolation interpolation) Builds the curve pair: OIS fromoisInstruments, projection fromprojectionInstrumentsdiscounted on it (the OIS curve itself when that list is empty). -
bucketedDv01
public static double[] bucketedDv01(LocalDate valuationDate, List<CurveInstrument> oisInstruments, List<CurveInstrument> projectionInstruments, CurveInterpolation interpolation, ToDoubleBiFunction<DiscountCurve, DiscountCurve> pv) Per-quote DV01, OIS quotes first then projection quotes. -
parallelDv01
public static double parallelDv01(LocalDate valuationDate, List<CurveInstrument> oisInstruments, List<CurveInstrument> projectionInstruments, CurveInterpolation interpolation, ToDoubleBiFunction<DiscountCurve, DiscountCurve> pv) DV01 for a +1bp move in every quote. -
keyRateDv01
public static double[] keyRateDv01(LocalDate valuationDate, List<CurveInstrument> oisInstruments, List<CurveInstrument> projectionInstruments, CurveInterpolation interpolation, ToDoubleBiFunction<DiscountCurve, DiscountCurve> pv, double[] keyTenorsYears) Key-rate DV01s atkeyTenorsYears(strictly increasing, ACT/365F years); one value per key.
-