Table of Contents

Class SpreadedHazardRateCurve

Namespace
NanoQL.Experimental
Assembly
NanoQL.dll

A default-probability structure with an additive spread on the hazard rates of an original curve, whose reference date, calendar, day counter and range it takes.

[Experimental("NQL0001")]
public sealed class SpreadedHazardRateCurve : HazardRateStructure
Inheritance
SpreadedHazardRateCurve
Inherited Members
Extension Methods

Remarks

Immutable: QuantLib's stays linked to its original and its spread quote, which change through it; here both are values, a new curve for a new original or spread. The survival probability is the exact integral of the hazard rate the curve reports, the original's plus the spread: QuantLib's integrates it numerically with its base's 48-point rule, which misses the exact survival by 5.4e-6 to 5.4e-5 relative on flat originals at 1 to 10 years and by 1.05e-4 on a stepped one at four years, and which QuantLib warns derived classes to override (Divergences/SpreadedHazardRateCurveTests.cs). The original's rate is its own kind's: on the hazard kinds its survival's, jumps apart; on the survival and density kinds the density over the survival with its jumps; on the affine structures the deterministic part alone, the model's left out, as QuantLib's integral leaves it; so each kind integrates its rate in closed form, and an original that gives none, a user's, is integrated numerically, as QuantLib does.

Constructors

SpreadedHazardRateCurve(DefaultProbabilityTermStructure, double)

A default-probability structure with an additive spread on the hazard rates of an original curve, whose reference date, calendar, day counter and range it takes.

public SpreadedHazardRateCurve(DefaultProbabilityTermStructure originalCurve, double spread)

Parameters

originalCurve DefaultProbabilityTermStructure

The original curve.

spread double

The spread added to the hazard rate.

Remarks

Immutable: QuantLib's stays linked to its original and its spread quote, which change through it; here both are values, a new curve for a new original or spread. The survival probability is the exact integral of the hazard rate the curve reports, the original's plus the spread: QuantLib's integrates it numerically with its base's 48-point rule, which misses the exact survival by 5.4e-6 to 5.4e-5 relative on flat originals at 1 to 10 years and by 1.05e-4 on a stepped one at four years, and which QuantLib warns derived classes to override (Divergences/SpreadedHazardRateCurveTests.cs). The original's rate is its own kind's: on the hazard kinds its survival's, jumps apart; on the survival and density kinds the density over the survival with its jumps; on the affine structures the deterministic part alone, the model's left out, as QuantLib's integral leaves it; so each kind integrates its rate in closed form, and an original that gives none, a user's, is integrated numerically, as QuantLib does.

Properties

MaxDate

Gets the latest date for which the curve can return values.

public override Date MaxDate { get; }

Property Value

Date

MaxTime

Gets the latest time for which the curve can return values.

public override double MaxTime { get; }

Property Value

double

Methods

HazardRateImpl(double)

The hazard rate at a time, which derived curves calculate. Range checks have already been performed, so it must assume that extrapolation is required.

protected override double HazardRateImpl(double t)

Parameters

t double

The time.

Returns

double

The rate.

SurvivalProbabilityImpl(double)

The survival probability at a time: QuantLib's default, the hazard rate integrated from 0 with a 48-point Gauss-Chebyshev rule, which derived curves should override where they can do better.

protected override double SurvivalProbabilityImpl(double t)

Parameters

t double

The time.

Returns

double

The probability.