Table of Contents

Class IntegralNtdEngine

Namespace
NanoQL.Experimental
Assembly
NanoQL.dll

The integral engine for n-th-to-default swaps: each premium period's default leg integrated in steps of a given size, the contract triggered by the basket's n-th default.

[Experimental("NQL0001")]
public static class IntegralNtdEngine
Inheritance
IntegralNtdEngine
Inherited Members

Remarks

A static class: Calculate(NthToDefault, EvaluationContext, Period, YieldTermStructure) takes the engine's inputs and returns the results, in place of QuantLib's engine object. It reads the statistics through the swap's basket, which must be of the engine's evaluation date. QuantLib's engine takes the basket as homogeneous, hard-coded: the recovery is read from the basket's first name for all, and its branch for unequal recoveries is never taken, so it isn't ported. Here the first live name's: once the first name has defaulted, QuantLib's on the restated basket, where a read of the first name would price every future default at its settled recovery. The fair premium leaves the upfront out, QuantLib's CDS convention.

The upfront is the swap's nominal times its rate. QuantLib's is the basket's remaining notional times the rate (integralntdengine.cpp:157-163), 5 for a 1,000 nominal on a 100 basket (Divergences/NthToDefaultUpfrontTests.cs); where the nominal is the basket's notional, QuantLib's. A discount before the discount curve's reference date is 1, and a default probability before a default curve's 0, where QuantLib's reads refuse them ("negative time"). A realized default lowers the order the basket's probabilities read; once the realized defaults reach it, the contract is triggered.

Methods

Calculate(NthToDefault, EvaluationContext, Period, YieldTermStructure)

Prices an n-th-to-default swap.

public static NthToDefaultResults Calculate(NthToDefault ntd, EvaluationContext context, Period integrationStep, YieldTermStructure discountCurve)

Parameters

ntd NthToDefault

The swap.

context EvaluationContext

The evaluation context, of the basket's evaluation date.

integrationStep Period

The default leg's integration step, shortened to a day at each period's end.

discountCurve YieldTermStructure

The discount curve.

Returns

NthToDefaultResults

The swap's results.

Exceptions

ArgumentNullException

A reference argument is null.

NanoQLException

The basket's evaluation date isn't the context's, the basket has no loss model, or the model refuses a statistic.