Interface IDefaultLossModel
- Namespace
- NanoQL.Experimental
- Assembly
- NanoQL.dll
A default loss model: the basket's contract with the algorithms that give its joint loss statistics (latent models,
top-down models). QuantLib's DefaultLossModel, whose abstract class form is DefaultLossModel.
[Experimental("NQL0001")]
public interface IDefaultLossModel
Remarks
A model is an immutable configuration until it is bound: SetBasket(Basket) returns a copy bound to a basket,
its per-basket precomputation run once there (QuantLib's resetModel), and a basket's
SetLossModel(IDefaultLossModel?) binds it. Every statistic is a member with a body that refuses, with
QuantLib's text, unless the model implements it; QuantLib's protected statistics are public here, the basket reading
them through this interface.
An interface, beside the abstract class, so that a model with another base implements the contract over it, as QuantLib's constant-loss and Gaussian LHP models derive their latent model beside the loss model.
Properties
Basket
Gets the basket the model is bound to, or null before it is bound.
Basket? Basket { get; }
Property Value
Methods
DefaultCorrelation(Date, int, int)
Pearson's correlation of two names' default indicators by a date.
double DefaultCorrelation(Date d, int iName, int jName)
Parameters
Returns
- double
The correlation.
Exceptions
- NanoQLException
The model doesn't implement it.
DensityTrancheLoss(Date, double)
The probability density of a loss fraction of the basket's notional.
double DensityTrancheLoss(Date d, double lossFraction)
Parameters
Returns
- double
The density.
Exceptions
- NanoQLException
The model doesn't implement it.
ExpectedRecovery(Date, int, DefaultProbKey)
A name's expected recovery rate conditional on its default by a date.
double ExpectedRecovery(Date d, int iName, DefaultProbKey defaultKey)
Parameters
dDateThe date.
iNameintThe name.
defaultKeyDefaultProbKeyThe name's default key.
Returns
- double
The recovery.
Exceptions
- NanoQLException
The model doesn't implement it.
ExpectedShortfall(Date, double)
The expected shortfall at a percentile of the default loss.
double ExpectedShortfall(Date d, double percentile)
Parameters
Returns
- double
The shortfall.
Exceptions
- NanoQLException
The model doesn't implement it.
ExpectedTrancheLoss(Date)
The expected tranche loss by a date, an amount.
double ExpectedTrancheLoss(Date d)
Parameters
dDateThe date.
Returns
- double
The loss.
Exceptions
- NanoQLException
The model doesn't implement it.
LossDistribution(Date)
The full loss distribution: each loss level's probability.
ImmutableSortedDictionary<double, double> LossDistribution(Date d)
Parameters
dDateThe date.
Returns
- ImmutableSortedDictionary<double, double>
The distribution.
Exceptions
- NanoQLException
The model doesn't implement it.
Percentile(Date, double)
The value at risk at a percentile of the default loss.
double Percentile(Date d, double percentile)
Parameters
Returns
- double
The loss.
Exceptions
- NanoQLException
The model doesn't implement it.
ProbAtLeastNEvents(int, Date)
The probability of a number of defaults or more in the basket by a date.
double ProbAtLeastNEvents(int n, Date d)
Parameters
Returns
- double
The probability.
Exceptions
- NanoQLException
The model doesn't implement it.
ProbOverLoss(Date, double)
The probability of the tranche losing a fraction of its notional or more.
double ProbOverLoss(Date d, double lossFraction)
Parameters
Returns
- double
The probability.
Exceptions
- NanoQLException
The model doesn't implement it.
ProbsBeingNthEvent(int, Date)
Each live name's probability of having defaulted by a date as the n-th default of the basket, in pool order.
ImmutableArray<double> ProbsBeingNthEvent(int n, Date d)
Parameters
Returns
- ImmutableArray<double>
The probabilities.
Exceptions
- NanoQLException
The model doesn't implement it.
SetBasket(Basket)
A copy of the model bound to a basket: to its live names, over its restated tranche where names have defaulted.
IDefaultLossModel SetBasket(Basket basket)
Parameters
basketBasketThe basket.
Returns
- IDefaultLossModel
The bound model.
SplitESFLevel(Date, double)
Each name's share of an expected-shortfall loss level.
ImmutableArray<double> SplitESFLevel(Date d, double loss)
Parameters
Returns
- ImmutableArray<double>
The shares, by live name.
Exceptions
- NanoQLException
The model doesn't implement it.
SplitVaRLevel(Date, double)
Each name's share of a value-at-risk loss level.
ImmutableArray<double> SplitVaRLevel(Date d, double loss)
Parameters
Returns
- ImmutableArray<double>
The shares, by live name.
Exceptions
- NanoQLException
The model doesn't implement it.