Class InhomogeneousPoolLossModel<TCopula, TInitTraits>
- Namespace
- NanoQL.Experimental
- Assembly
- NanoQL.dll
The default loss distribution of a finite inhomogeneous pool by Hull-White bucketing: the conditional distributions of a one-factor constant-loss latent model integrated over the factor on a midpoint grid.
[Experimental("NQL0001")]
public class InhomogeneousPoolLossModel<TCopula, TInitTraits> : DefaultLossModel, IDefaultLossModel where TCopula : struct, ICopulaPolicy<TCopula, TInitTraits> where TInitTraits : struct
Type Parameters
TCopulaThe copula policy.
TInitTraitsThe policy's initialization parameters.
- Inheritance
-
InhomogeneousPoolLossModel<TCopula, TInitTraits>
- Implements
- Derived
- Inherited Members
Remarks
The losses are split into buckets from 0 to the tranche's detachment, and the expected tranche loss is a left Riemann sum of the excess probability: QuantLib's design, kept. Bound to a basket with realized defaults, the model prices its live names over the restated tranche; QuantLib's pairs the latent model's recoveries with the live notionals and refuses ("sizes differ: 3 vs 2").
Constructors
InhomogeneousPoolLossModel(ConstantLossLatentModel<TCopula, TInitTraits>, int, double, double, int)
Initializes a new instance of the InhomogeneousPoolLossModel<TCopula, TInitTraits> class.
public InhomogeneousPoolLossModel(ConstantLossLatentModel<TCopula, TInitTraits> copula, int nBuckets, double max = 5, double min = -5, int nSteps = 50)
Parameters
copulaConstantLossLatentModel<TCopula, TInitTraits>The one-factor constant-loss latent model.
nBucketsintThe number of buckets.
maxdoubleThe factor grid's upper end.
mindoubleThe factor grid's lower end.
nStepsintThe number of factor steps.
Exceptions
- ArgumentNullException
copulais null.- ArgumentException
The latent model has more than one factor ("Inhomogeneous model not implemented for multifactor").
Methods
ExpectedShortfall(Date, double)
The expected shortfall at a percentile of the default loss.
public override 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.
public override double ExpectedTrancheLoss(Date d)
Parameters
dDateThe date.
Returns
- double
The loss.
Exceptions
- NanoQLException
The model doesn't implement it.
LossDistrib(Date)
The pool's loss distribution by a date, from 0 to the tranche's detachment.
protected Distribution LossDistrib(Date d)
Parameters
dDateThe date.
Returns
- Distribution
The distribution.
Exceptions
- NanoQLException
The model isn't bound to a basket.
Percentile(Date, double)
The value at risk at a percentile of the default loss.
public override double Percentile(Date d, double percentile)
Parameters
Returns
- double
The loss.
Exceptions
- NanoQLException
The model doesn't implement it.
ResetModel()
The model's per-basket precomputation, run once on the bound copy: QuantLib's resetModel.
protected override void ResetModel()