Class IsdaCurve
java.lang.Object
com.quantfinlib.credit.IsdaCurve
A curve of the kind the ISDA CDS Standard Model works on: continuously
compounded zero rates r_i at node times t_i (years, ACT/365F from the
curve's base date), interpolated linearly in
r(t) * t. That
makes the instantaneous forward piecewise constant between nodes,
which is what lets the model integrate its legs in closed form
segment by segment (ISDA CDS Standard Model, "ISDA CDS Standard Model
proposed numerical fix", Markit 2009, and the JPMorgan CDS library
JpmcdsZeroPrice). Before the first node the zero rate is held
at r_1 and after the last at r_n, so the forward there is r_1 and r_n.
The same object serves as a discount curve (value(double)
is the discount factor P(t)) and as a survival curve (the "rate" is
the average hazard, value(t) is Q(t)). ofHazardRates(double[], double[])
builds the second from piecewise-constant hazards on (t_{i-1}, t_i].
Research lane, deterministic.
-
Method Summary
Modifier and TypeMethodDescriptionstatic IsdaCurveflat(double rate) A flat curve: constant zero rate (or constant hazard).static IsdaCurveofHazardRates(double[] times, double[] hazards) Survival curve from piecewise-constant hazards:hazards[i]applies on (t_{i-1}, t_i] with t_{-1} = 0, and the last hazard continues beyond the last node.static IsdaCurveofZeroRates(double[] times, double[] zeroRates) Curve from zero rates.doublerateTimesTime(double t) r(t) * t, the integrated forward from 0 to t.doubletime(int i) Node time i.double[]Copy of the node times.intNumber of nodes (a hazard curve carries one extra node 1000 years out).doublevalue(double t) exp(-r(t) t): the discount factor, or the survival probability.doublezeroRate(double t) Continuously compounded zero rate at t > 0.
-
Method Details
-
ofZeroRates
Curve from zero rates.- Parameters:
times- strictly ascending node times in years, all > 0 and finitezeroRates- continuously compounded zero rates at the nodes, finite- Returns:
- the curve
-
ofHazardRates
Survival curve from piecewise-constant hazards:hazards[i]applies on (t_{i-1}, t_i] with t_{-1} = 0, and the last hazard continues beyond the last node.- Parameters:
times- strictly ascending node times in years, all > 0 and finitehazards- hazards per year, ≥ 0 and finite- Returns:
- the curve, whose
value(double)is Q(t)
-
flat
A flat curve: constant zero rate (or constant hazard). -
rateTimesTime
public double rateTimesTime(double t) r(t) * t, the integrated forward from 0 to t.- Parameters:
t- time in years, ≥ 0 and finite- Returns:
- the integral
-
zeroRate
public double zeroRate(double t) Continuously compounded zero rate at t > 0. -
value
public double value(double t) exp(-r(t) t): the discount factor, or the survival probability. -
timesLength
public int timesLength()Number of nodes (a hazard curve carries one extra node 1000 years out). -
time
public double time(int i) Node time i. -
timesCopy
public double[] timesCopy()Copy of the node times.
-