QuantLib: ConstantLossModel< copulaPolicy > Class Template Reference

A free/open-source library for quantitative finance Reference manual - version 1.12

Public Member Functions | Protected Member Functions | List of all members
ConstantLossModel< copulaPolicy > Class Template Reference

`#include <ql/experimental/credit/constantlosslatentmodel.hpp>`

Inheritance diagram for ConstantLossModel< copulaPolicy >:
[legend]

## Public Member Functions
| ConstantLossModel (const std::vector< std::vector< Real > > &factorWeights, const std::vector< Real > &recoveries, LatentModelIntegrationType::LatentModelIntegrationType integralType, const typename copulaPolicy::initTraits &ini=copulaPolicy::initTraits())
| ConstantLossModel (const Handle< Quote > &mktCorrel, const std::vector< Real > &recoveries, LatentModelIntegrationType::LatentModelIntegrationType integralType, Size nVariables, const typename copulaPolicy::initTraits &ini=copulaPolicy::initTraits())
Public Member Functions inherited from ConstantLossLatentmodel< copulaPolicy >
| ConstantLossLatentmodel (const std::vector< std::vector< Real > > &factorWeights, const std::vector< Real > &recoveries, LatentModelIntegrationType::LatentModelIntegrationType integralType, const initTraits &ini=initTraits())
| ConstantLossLatentmodel (const Handle< Quote > &mktCorrel, const std::vector< Real > &recoveries, LatentModelIntegrationType::LatentModelIntegrationType integralType, Size nVariables, const initTraits &ini=initTraits())
Real | conditionalRecovery (const Date &d, Size iName, const std::vector< Real > &mktFactors) const
Real | conditionalRecovery (Probability uncondDefP, Size iName, const std::vector< Real > &mktFactors) const
Real | conditionalRecoveryInvP (Real invUncondDefP, Size iName, const std::vector< Real > &mktFactors) const
Real | conditionalRecovery (Real latentVarSample, Size iName, const Date &d) const
const std::vector< Real > & | recoveries () const
Real | expectedRecovery (const Date &d, Size iName, const DefaultProbKey &defKeys) const
Public Member Functions inherited from DefaultLatentModel< copulaPolicy >
| 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 boost::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
Public Member Functions inherited from LatentModel< copulaPolicy >
void | update ()
Real | latentVarValue (const std::vector< Real > &allFactors, Size iVar) const
const copulaType & | copula () const
Size | size () const
Size | numFactors () const
| Number of systemic factors.
Size | numTotalFactors () const
| Number of total free random factors; systemic and idiosyncratic.
| LatentModel (const std::vector< std::vector< Real > > &factorsWeights, const typename copulaType::initTraits &ini=copulaType::initTraits())
| LatentModel (const std::vector< Real > &factorsWeight, const typename copulaType::initTraits &ini=copulaType::initTraits())
| LatentModel (const Real correlSqr, Size nVariables, const typename copulaType::initTraits &ini=copulaType::initTraits())
| LatentModel (const Handle< Quote > &singleFactorCorrel, Size nVariables, const typename copulaType::initTraits &ini=copulaType::initTraits())
const std::vector< std::vector< Real > > & | factorWeights () const
| Provides values of the factors \( a_{i,k} \).
const std::vector< Real > & | idiosyncFctrs () const
| Provides values of the normalized idiosyncratic factors \( Z_i \).
Real | latentVariableCorrel (Size iVar1, Size iVar2) const
| Latent variable correlations:
Probability | cumulativeY (Real val, Size iVariable) const
Probability | cumulativeZ (Real z) const
| Cumulative distribution of Z, the idiosyncratic/error factors.
Probability | density (const std::vector< Real > &m) const
| Density function of M, the market/systemic factors.
Real | inverseCumulativeDensity (Probability p, Size iFactor) const
| Inverse cumulative distribution of the systemic factor iFactor.
Real | inverseCumulativeY (Probability p, Size iVariable) const
Real | inverseCumulativeZ (Probability p) const
Disposable< std::vector< Real > > | allFactorCumulInverter (const std::vector< Real > &probs) const
Real | integratedExpectedValue (const boost::function< Real(const std::vector< Real > &v1)> &f) const
Disposable< std::vector< Real > > | integratedExpectedValue (const boost::function< Disposable< std::vector< Real > >(const std::vector< Real > &v1)> &f) const
Public Member Functions inherited from Observer
| Observer (const Observer &)
Observer & | operator= (const Observer &)
std::pair< iterator, bool > | registerWith (const boost::shared_ptr< Observable > &)
void | registerWithObservables (const boost::shared_ptr< Observer > &)
Size | unregisterWith (const boost::shared_ptr< Observable > &)
void | unregisterWithAll ()
virtual void | deepUpdate ()
Public Member Functions inherited from Observable
| Observable (const Observable &)
Observable & | operator= (const Observable &)
void | notifyObservers ()

## Protected Member Functions
Real | defaultCorrelation (const Date &d, Size iName, Size jName) const
| Pearsons' default probability correlation.
Probability | probAtLeastNEvents (Size n, const Date &d) const
Real | expectedRecovery (const Date &d, Size iName, const DefaultProbKey &k) const
Protected Member Functions inherited from DefaultLatentModel< copulaPolicy >
void | update ()
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.
const boost::shared_ptr< LMIntegration > & | integration () const
| access to integration:
Protected Member Functions inherited from LatentModel< copulaPolicy >
Protected Member Functions inherited from DefaultLossModel
virtual Real | expectedTrancheLoss (const Date &d) const
virtual Probability | probOverLoss (const Date &d, Real lossFraction) const
virtual Real | percentile (const Date &d, Real percentile) const
| Value at Risk given a default loss percentile.
virtual Real | expectedShortfall (const Date &d, Real percentile) const
| Expected shortfall given a default loss percentile.
virtual Disposable< std::vector< Real > > | splitVaRLevel (const Date &d, Real loss) const
| Associated VaR fraction to each counterparty.
virtual Disposable< std::vector< Real > > | splitESFLevel (const Date &d, Real loss) const
| Associated ESF fraction to each counterparty.
virtual Disposable< std::map< Real, Probability > > | lossDistribution (const Date &) const
| Full loss distribution.
virtual Real | densityTrancheLoss (const Date &d, Real lossFraction) const
| Probability density of a given loss fraction of the basket notional.
virtual Disposable< std::vector< Probability > > | probsBeingNthEvent (Size n, const Date &d) const

## Additional Inherited Members
Public Types inherited from LatentModel< copulaPolicy >
typedef copulaPolicy | copulaType
Public Types inherited from Observer
typedef std::set< boost::shared_ptr< Observable > > | set_type
typedef set_type::iterator | iterator
Protected Attributes inherited from DefaultLatentModel< copulaPolicy >
boost::shared_ptr< Basket > | basket_
boost::shared_ptr< LMIntegration > | integration_
Protected Attributes inherited from LatentModel< copulaPolicy >
std::vector< std::vector< Real > > | factorWeights_
Handle< Quote > | cachedMktFactor_
std::vector< Real > | idiosyncFctrs_
Size | nFactors_
| Number of systemic factors.
Size | nVariables_
| Number of latent model variables, idiosyncratic terms or model dim.
copulaType | copula_
Protected Attributes inherited from DefaultLossModel
RelinkableHandle< Basket > | basket_

## Detailed Description

### template<class copulaPolicy>
class QuantLib::ConstantLossModel< copulaPolicy >

ConstantLossLatentModel interface for loss models. While it does not provide distribution type losses (e.g. expected tranche losses) because it lacks an integration algorithm it serves to allow pricing of digital type products like NTDs.

Alternatively fuse with the aboves class.

## Member Function Documentation

## ◆ probAtLeastNEvents()

Probability probAtLeastNEvents | ( | Size | n,
|  | const Date & | d
| ) |  | const
| protectedvirtual

Returns the probaility of having a given or larger number of defaults in the basket portfolio at a given time.

Reimplemented from DefaultLossModel.

## ◆ expectedRecovery()

Real expectedRecovery | ( | const Date & | ,
|  | Size | iName,
|  | const DefaultProbKey & |
| ) |  | const
| protectedvirtual

Expected RR for name conditinal to default by that date.

Reimplemented from DefaultLossModel.