Class RandomLossLM<TCopula, TInitTraits, TUsng>
- Namespace
- NanoQL.Experimental
- Assembly
- NanoQL.dll
The random spot recovery rate loss model simulation for any copula: each path's defaults and their recoveries, on a spot-recovery latent model's default and recovery variables.
[Experimental("NQL0001")]
public class RandomLossLM<TCopula, TInitTraits, TUsng> : RandomLM<TCopula, TInitTraits, TUsng>, IDefaultLossModel where TCopula : struct, ICopulaPolicy<TCopula, TInitTraits> where TInitTraits : struct where TUsng : class, ISeedableRsg<TUsng>
Type Parameters
TCopulaThe copula policy.
TInitTraitsThe policy's initialization parameters.
TUsngThe uniform sequence generator, which the copula inverts.
- Inheritance
-
RandomLM<TCopula, TInitTraits, TUsng>RandomLossLM<TCopula, TInitTraits, TUsng>
- Implements
- Derived
- Inherited Members
Remarks
A default's recovery is kept in 256ths, QuantLib's rounding, as a value: QuantLib's stores the count in 8 bits, so a recovery of 1, 256/256, reads 0, a full loss for no loss, and its 12-bit name and day fields wrap past 4,095. Bound to a basket, the model simulates the live names. The simulation's rules are RandomLM<TCopula, TInitTraits, TUsng>'s.
Constructors
RandomLossLM(SpotRecoveryLatentModel<TCopula, TInitTraits>, int, long, double, int)
Initializes a new instance of the RandomLossLM<TCopula, TInitTraits, TUsng> class.
public RandomLossLM(SpotRecoveryLatentModel<TCopula, TInitTraits> copula, int nSims, long seed, double accuracy = 1E-06, int maxHorizon = 4050)
Parameters
copulaSpotRecoveryLatentModel<TCopula, TInitTraits>The spot-recovery latent model.
nSimsintThe number of paths, at least 1.
seedlongThe generator's seed, in [1, 4294967295]; QuantLib's default is 2863311530.
accuracydoubleThe default day's solver accuracy.
maxHorizonintThe simulation's horizon in days, QuantLib's 4,050 by default.
Exceptions
- ArgumentNullException
copulais null.- ArgumentOutOfRangeException
A count or the seed lies outside its range.
Methods
ResetModel()
The model's per-basket precomputation, run once on the bound copy: QuantLib's resetModel.
protected override void ResetModel()