Docs / nablatensor-cva / com.nablatensor.cva

final class

HazardCurve

A counterparty credit curve as a piecewise-constant forward hazard rate lambda(t) on a set of ascending tenor knots. Segment i covers (knot[i-1], knot[i]] with knot[-1] = 0.

survival(double) is exp(-integral_0^t lambda); the default probability over an interval is the drop in survival. The forward-hazard knots are what a CVA valuation shocks for CS01, so they are exposed directly by forwardHazards() and shifted by withParallelShift(double).

bootstrap strips a flat-forward hazard per segment from CDS par quotes on a monthly premium/protection grid; fromFlatSpread is the one-segment lambda = s / (1 - R) approximation.

Methods

static HazardCurve piecewise(double[] knotTimes, double[] forwardHazard)
static HazardCurve flat(double hazard, double lastTenor)

A single flat forward hazard out to lastTenor.

static HazardCurve fromFlatSpread(double parSpreadBp, double recovery, double lastTenor)

The lambda = s / (1 - R) approximation from one par spread.

static HazardCurve bootstrap(List<CdsQuote> quotes, double recovery, DoubleUnaryOperator discount)

Strips a flat-forward hazard per segment from ascending CDS par quotes, so that the model par spread matches each quote given the earlier segments. Premium and protection legs are integrated on a monthly grid; discount maps a time in years to a risk-free discount factor.

double hazardAt(double t)
double cumulativeHazard(double t)
double survival(double t)
double defaultProbability(double from, double to)
double[] knotTimes()
double[] forwardHazards()
HazardCurve withParallelShift(double deltaHazard)

The same curve with a constant added to every forward-hazard segment (a CS01-style shift).

HazardCurve shockedBySpread(double deltaSpreadBp, double recovery)

A parallel CDS-spread bump translated to a hazard shift d_lambda = d_s / (1 - R).

double[] threeBucketHazards()

The piecewise-flat forward hazard sampled on [0,2y], [2y,5y], [5y,+) — the demo CS01 buckets.