Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Private Member Functions | List of all members
ConstantLossModel< copulaPolicy > Class Template Reference

#include <qle/models/constantlosslatentmodel.hpp>

+ Inheritance diagram for ConstantLossModel< copulaPolicy >:
+ Collaboration diagram for ConstantLossModel< copulaPolicy >:

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 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

Real defaultCorrelation (const Date &d, Size iName, Size jName) const
 Pearsons' default probability correlation. More...
 
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 () 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 Member Functions inherited from DefaultLossModel
 DefaultLossModel ()
 
virtual Real expectedTrancheLoss (const Date &d, Real recoveryRate=Null< Real >()) 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. More...
 
virtual Real expectedShortfall (const Date &d, Real percentile) const
 Expected shortfall given a default loss percentile. More...
 
virtual std::vector< Real > splitVaRLevel (const Date &d, Real loss) const
 Associated VaR fraction to each counterparty. More...
 
virtual std::vector< Real > splitESFLevel (const Date &d, Real loss) const
 Associated ESF fraction to each counterparty. More...
 
virtual std::map< Real, Probability > lossDistribution (const Date &) const
 Full loss distribution. More...
 
virtual Real densityTrancheLoss (const Date &d, Real lossFraction) const
 Probability density of a given loss fraction of the basket notional. More...
 
virtual std::vector< Probability > probsBeingNthEvent (Size n, const Date &d) const
 
virtual QuantLib::Real correlation () const
 

Private Member Functions

virtual void resetModel ()
 Concrete models do now any updates/inits they need on basket reset. More...
 

Additional Inherited Members

- Protected Attributes inherited from DefaultLatentModel< copulaPolicy >
QuantLib::ext::shared_ptr< Basketbasket_
 
QuantLib::ext::shared_ptr< LMIntegration > integration_
 
- Protected Attributes inherited from DefaultLossModel
RelinkableHandle< QuantExt::Basketbasket_
 

Detailed Description

template<class copulaPolicy>
class QuantExt::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.

Definition at line 94 of file constantlosslatentmodel.hpp.

Constructor & Destructor Documentation

◆ ConstantLossModel() [1/2]

ConstantLossModel ( const std::vector< std::vector< Real > > &  factorWeights,
const std::vector< Real > &  recoveries,
LatentModelIntegrationType::LatentModelIntegrationType  integralType,
const typename copulaPolicy::initTraits &  ini = copulaPolicy::initTraits() 
)

Definition at line 96 of file constantlosslatentmodel.hpp.

99 : ConstantLossLatentmodel<copulaPolicy>(factorWeights, recoveries, integralType, ini) {}
const std::vector< Real > & recoveries() const

◆ ConstantLossModel() [2/2]

ConstantLossModel ( const Handle< Quote > &  mktCorrel,
const std::vector< Real > &  recoveries,
LatentModelIntegrationType::LatentModelIntegrationType  integralType,
Size  nVariables,
const typename copulaPolicy::initTraits &  ini = copulaPolicy::initTraits() 
)

Definition at line 101 of file constantlosslatentmodel.hpp.

104 : ConstantLossLatentmodel<copulaPolicy>(mktCorrel, recoveries, integralType, nVariables, ini) {}

Member Function Documentation

◆ defaultCorrelation()

Real defaultCorrelation ( const Date &  d,
Size  iName,
Size  jName 
) const
protectedvirtual

Pearsons' default probability correlation.

Reimplemented from DefaultLossModel.

Definition at line 112 of file constantlosslatentmodel.hpp.

112 {
114 }
Real defaultCorrelation(const Date &d, Size iNamei, Size iNamej) const
+ Here is the call graph for this function:

◆ 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.

Definition at line 115 of file constantlosslatentmodel.hpp.

115 {
117 }
Probability probAtLeastNEvents(Size n, const Date &date) const
+ Here is the call graph for this function:

◆ expectedRecovery()

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

Expected RR for name conditinal to default by that date.

Reimplemented from DefaultLossModel.

Definition at line 118 of file constantlosslatentmodel.hpp.

118 {
120 }
Real expectedRecovery(const Date &d, Size iName, const DefaultProbKey &defKeys) const
+ Here is the call graph for this function:

◆ resetModel()

virtual void resetModel ( )
privatevirtual

Concrete models do now any updates/inits they need on basket reset.

Implements DefaultLossModel.

Definition at line 123 of file constantlosslatentmodel.hpp.

123 {
124 // update the default latent model we derive from
126 }
void resetBasket(const QuantLib::ext::shared_ptr< Basket > basket) const
RelinkableHandle< QuantExt::Basket > basket_
+ Here is the call graph for this function: