Default event Latent Model. More...
#include <qle/models/defaultprobabilitylatentmodel.hpp>
Public Member Functions | |
DefaultLatentModel (const std::vector< std::vector< Real > > &factorWeights, LatentModelIntegrationType::LatentModelIntegrationType integralType, const initTraits &ini=initTraits()) | |
DefaultLatentModel (const Handle< Quote > &mktCorrel, Size nVariables, LatentModelIntegrationType::LatentModelIntegrationType integralType, const initTraits &ini=initTraits()) | |
void | resetBasket (const QuantLib::ext::shared_ptr< Basket > basket) const |
Probability | conditionalDefaultProbability (Probability prob, Size iName, const std::vector< Real > &mktFactors) const |
Probability | conditionalDefaultProbabilityInvP (Real invCumYProb, Size iName, const std::vector< Real > &m) const |
Probability | probOfDefault (Size iName, const Date &d) const |
Real | defaultCorrelation (const Date &d, Size iNamei, Size iNamej) const |
Probability | probAtLeastNEvents (Size n, const Date &date) const |
Protected Member Functions | |
void | update () override |
Probability | conditionalDefaultProbability (const Date &date, Size iName, const std::vector< Real > &mktFactors) const |
Probability | condProbProduct (Real invCumYProb1, Real invCumYProb2, Size iName1, Size iName2, const std::vector< Real > &mktFactors) const |
Real | conditionalProbAtLeastNEvents (Size n, const Date &date, const std::vector< Real > &mktFactors) const |
Conditional probability of n default events or more. More... | |
const QuantLib::ext::shared_ptr< LMIntegration > & | integration () const override |
access to integration: More... | |
Protected Attributes | |
QuantLib::ext::shared_ptr< Basket > | basket_ |
QuantLib::ext::shared_ptr< LMIntegration > | integration_ |
Private Types | |
typedef copulaPolicy::initTraits | initTraits |
Default event Latent Model.
This is a model for joint default events based on a generic Latent Model. It models solely the default events in a portfolio, not making any reference to severities, exposures, etc... An implicit correspondence is stablished between the variables modelled and the names in the basket given by the basket and model variable access indices. The class is parametric on the Latent Model copula.
Definition at line 44 of file defaultprobabilitylatentmodel.hpp.
|
private |
Definition at line 62 of file defaultprobabilitylatentmodel.hpp.
DefaultLatentModel | ( | const std::vector< std::vector< Real > > & | factorWeights, |
LatentModelIntegrationType::LatentModelIntegrationType | integralType, | ||
const initTraits & | ini = initTraits() |
||
) |
factorWeights | Latent model independent factors weights for each variable. |
integralType | Integration type. |
ini | Copula initialization if any. |
Definition at line 73 of file defaultprobabilitylatentmodel.hpp.
DefaultLatentModel | ( | const Handle< Quote > & | mktCorrel, |
Size | nVariables, | ||
LatentModelIntegrationType::LatentModelIntegrationType | integralType, | ||
const initTraits & | ini = initTraits() |
||
) |
Definition at line 79 of file defaultprobabilitylatentmodel.hpp.
void resetBasket | ( | const QuantLib::ext::shared_ptr< Basket > | basket | ) | const |
Definition at line 92 of file defaultprobabilitylatentmodel.hpp.
Probability conditionalDefaultProbability | ( | Probability | prob, |
Size | iName, | ||
const std::vector< Real > & | mktFactors | ||
) | const |
Returns the probability of default of a given name conditional on the realization of a given set of values of the model independent factors. The date at which the probability is given is implicit in the probability since theres not other time dependence in this model.
prob | Unconditional probability of default. |
iName | desired name. |
mktFactors | Value of LM independent factors. |
Definition at line 109 of file defaultprobabilitylatentmodel.hpp.
|
overrideprotected |
Definition at line 125 of file defaultprobabilitylatentmodel.hpp.
Probability conditionalDefaultProbabilityInvP | ( | Real | invCumYProb, |
Size | iName, | ||
const std::vector< Real > & | m | ||
) | const |
Returns the probability of default of a given name conditional on the realization of a given set of values of the model independent factors. The date at which the probability is given is implicit in the probability since theres not other time dependent in this model. Same intention as above but provides a performance opportunity, if the integration is along the market factors (as usually is) avoids computing the inverse of the probability on each call.
invCumYProb | Inverse cumul of the unconditional probability of default, has to follow the same copula law for results to be coherent |
iName | desired name. |
m | Value of LM independent factors. |
Definition at line 144 of file defaultprobabilitylatentmodel.hpp.
|
protected |
Returns the probability of default of a given name conditional on the realization of a given set of values of the model independent factors.
date | The date for the probability of default. |
iName | desired name. |
mktFactors | Value of LM independent factors. |
Same intention as the above methods. Usage of this one is typically more expensive because most often the date we call this method with repeats itself and with this one the probability can not be cached outside the call.
Definition at line 167 of file defaultprobabilitylatentmodel.hpp.
|
protected |
Conditional default probability product, intermediate step in the correlation calculation.
Definition at line 175 of file defaultprobabilitylatentmodel.hpp.
|
protected |
Conditional probability of n default events or more.
Definition at line 246 of file defaultprobabilitylatentmodel.hpp.
|
overrideprotected |
Probability probOfDefault | ( | Size | iName, |
const Date & | d | ||
) | const |
Computes the unconditional probability of default of a given name. Trivial method for testing
Definition at line 190 of file defaultprobabilitylatentmodel.hpp.
Real defaultCorrelation | ( | const Date & | d, |
Size | iNamei, | ||
Size | iNamej | ||
) | const |
Pearsons' default probability correlation. Users should consider specialization on the copula type for specific distributions since that might simplify the integrations, most importantly if this is to be used in calibration of observations for factor coefficients as it is expensive to integrate directly.
Definition at line 222 of file defaultprobabilitylatentmodel.hpp.
Probability probAtLeastNEvents | ( | Size | n, |
const Date & | date | ||
) | const |
Returns the probaility of having a given or larger number of defaults in the basket portfolio at a given time.
Definition at line 214 of file defaultprobabilitylatentmodel.hpp.
|
mutableprotected |
Definition at line 58 of file defaultprobabilitylatentmodel.hpp.
|
protected |
Definition at line 59 of file defaultprobabilitylatentmodel.hpp.