QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
Public Member Functions | Private Types | Private Attributes | List of all members
ConstantLossLatentmodel< copulaPolicy > Class Template Reference

#include <constantlosslatentmodel.hpp>

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

Public Member Functions

 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 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
 
- Public Member Functions inherited from LatentModel< copulaPolicy >
void update () override
 
Size size () const
 
Size numFactors () const
 Number of systemic factors. More...
 
Size numTotalFactors () const
 Number of total free random factors; systemic and idiosyncratic. More...
 
 LatentModel (const std::vector< std::vector< Real > > &factorsWeights, const typename copulaType::initTraits &ini=typename copulaType::initTraits())
 
 LatentModel (const std::vector< Real > &factorsWeight, const typename copulaType::initTraits &ini=typename copulaType::initTraits())
 
 LatentModel (Real correlSqr, Size nVariables, const typename copulaType::initTraits &ini=typename copulaType::initTraits())
 
 LatentModel (const Handle< Quote > &singleFactorCorrel, Size nVariables, const typename copulaType::initTraits &ini=typename copulaType::initTraits())
 
const std::vector< std::vector< Real > > & factorWeights () const
 Provides values of the factors \( a_{i,k} \). More...
 
const std::vector< Real > & idiosyncFctrs () const
 Provides values of the normalized idiosyncratic factors \( Z_i \). More...
 
Real latentVariableCorrel (Size iVar1, Size iVar2) const
 Latent variable correlations: More...
 
Probability cumulativeY (Real val, Size iVariable) const
 
Probability cumulativeZ (Real z) const
 Cumulative distribution of Z, the idiosyncratic/error factors. More...
 
Probability density (const std::vector< Real > &m) const
 Density function of M, the market/systemic factors. More...
 
Real inverseCumulativeDensity (Probability p, Size iFactor) const
 Inverse cumulative distribution of the systemic factor iFactor. More...
 
Real inverseCumulativeY (Probability p, Size iVariable) const
 
Real inverseCumulativeZ (Probability p) const
 
std::vector< RealallFactorCumulInverter (const std::vector< Real > &probs) const
 
Real latentVarValue (const std::vector< Real > &allFactors, Size iVar) const
 
const copulaTypecopula () const
 
Real integratedExpectedValue (const ext::function< Real(const std::vector< Real > &v1)> &f) const
 
std::vector< RealintegratedExpectedValueV (const ext::function< std::vector< Real >(const std::vector< Real > &v1)> &f) const
 
- Public Member Functions inherited from Observer
 Observer ()=default
 
 Observer (const Observer &)
 
Observeroperator= (const Observer &)
 
virtual ~Observer ()
 
std::pair< iterator, boolregisterWith (const ext::shared_ptr< Observable > &)
 
void registerWithObservables (const ext::shared_ptr< Observer > &)
 
Size unregisterWith (const ext::shared_ptr< Observable > &)
 
void unregisterWithAll ()
 
virtual void update ()=0
 
virtual void deepUpdate ()
 
- Public Member Functions inherited from Observable
 Observable ()
 
 Observable (const Observable &)
 
Observableoperator= (const Observable &)
 
 Observable (Observable &&)=delete
 
Observableoperator= (Observable &&)=delete
 
virtual ~Observable ()=default
 
void notifyObservers ()
 

Private Types

typedef copulaPolicy::initTraits initTraits
 

Private Attributes

const std::vector< Realrecoveries_
 

Additional Inherited Members

- Public Types inherited from LatentModel< copulaPolicy >
typedef copulaPolicy copulaType
 
- Public Types inherited from Observer
typedef set_type::iterator iterator
 
- 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 ext::shared_ptr< LMIntegration > & integration () const override
 access to integration: More...
 
- Protected Member Functions inherited from LatentModel< copulaPolicy >
- Protected Attributes inherited from DefaultLatentModel< copulaPolicy >
ext::shared_ptr< Basketbasket_
 
ext::shared_ptr< LMIntegrationintegration_
 
- Protected Attributes inherited from LatentModel< copulaPolicy >
std::vector< std::vector< Real > > factorWeights_
 
Handle< QuotecachedMktFactor_
 
std::vector< RealidiosyncFctrs_
 
Size nFactors_
 Number of systemic factors. More...
 
Size nVariables_
 Number of latent model variables, idiosyncratic terms or model dim. More...
 
copulaType copula_
 

Detailed Description

template<class copulaPolicy>
class QuantLib::ConstantLossLatentmodel< copulaPolicy >

Constant deterministic loss amount default latent model. Integrable implementation.

Definition at line 38 of file constantlosslatentmodel.hpp.

Member Typedef Documentation

◆ initTraits

typedef copulaPolicy::initTraits initTraits
private

Definition at line 41 of file constantlosslatentmodel.hpp.

Constructor & Destructor Documentation

◆ ConstantLossLatentmodel() [1/2]

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

Definition at line 43 of file constantlosslatentmodel.hpp.

+ Here is the call graph for this function:

◆ ConstantLossLatentmodel() [2/2]

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

Definition at line 56 of file constantlosslatentmodel.hpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ conditionalRecovery() [1/3]

Real conditionalRecovery ( const Date d,
Size  iName,
const std::vector< Real > &  mktFactors 
) const

Definition at line 72 of file constantlosslatentmodel.hpp.

◆ conditionalRecovery() [2/3]

Real conditionalRecovery ( Probability  uncondDefP,
Size  iName,
const std::vector< Real > &  mktFactors 
) const

Definition at line 77 of file constantlosslatentmodel.hpp.

◆ conditionalRecoveryInvP()

Real conditionalRecoveryInvP ( Real  invUncondDefP,
Size  iName,
const std::vector< Real > &  mktFactors 
) const

Definition at line 82 of file constantlosslatentmodel.hpp.

◆ conditionalRecovery() [3/3]

Real conditionalRecovery ( Real  latentVarSample,
Size  iName,
const Date d 
) const

Definition at line 87 of file constantlosslatentmodel.hpp.

◆ recoveries()

const std::vector< Real > & recoveries ( ) const

Definition at line 92 of file constantlosslatentmodel.hpp.

+ Here is the caller graph for this function:

◆ expectedRecovery()

Real expectedRecovery ( const Date d,
Size  iName,
const DefaultProbKey defKeys 
) const

Definition at line 99 of file constantlosslatentmodel.hpp.

+ Here is the caller graph for this function:

Member Data Documentation

◆ recoveries_

const std::vector<Real> recoveries_
private

Definition at line 40 of file constantlosslatentmodel.hpp.