Random spot recovery rate latent variable portfolio model. More...
#include <ql/experimental/credit/spotlosslatentmodel.hpp>
Public Member Functions | |
SpotRecoveryLatentModel (const std::vector< std::vector< Real > > &factorWeights, const std::vector< Real > &recoveries, Real modelA, LatentModelIntegrationType::LatentModelIntegrationType integralType, const typename copulaPolicy::initTraits &ini=copulaPolicy::initTraits()) | |
void | resetBasket (const boost::shared_ptr< Basket > basket) const |
Probability | conditionalDefaultProbability (const Date &date, Size iName, const std::vector< Real > &mktFactors) 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 |
Real | expCondRecovery (const Date &d, Size iName, const std::vector< Real > &mktFactors) const |
Real | expCondRecoveryP (Real uncondDefP, Size iName, const std::vector< Real > &mktFactors) const |
Real | expCondRecoveryInvPinvRR (Real invUncondDefP, Real invUncondRR, Size iName, const std::vector< Real > &mktFactors) const |
Real | conditionalRecovery (Real latentVarSample, Size iName, const Date &d) const |
Real | latentRRVarValue (const std::vector< Real > &allFactors, Size iName) const |
Real | conditionalExpLossRR (const Date &d, Size iName, const std::vector< Real > &mktFactors) const |
Real | conditionalExpLossRRInv (Real invP, Real invRR, Size iName, const std::vector< Real > &mktFactors) const |
Real | expectedLoss (const Date &d, Size iName) const |
![]() | |
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 |
![]() | |
Observer (const Observer &) | |
Observer & | operator= (const Observer &) |
std::pair< std::set < boost::shared_ptr < Observable > >::iterator, bool > | registerWith (const boost::shared_ptr< Observable > &) |
Size | unregisterWith (const boost::shared_ptr< Observable > &) |
void | unregisterWithAll () |
![]() | |
Observable (const Observable &) | |
Observable & | operator= (const Observable &) |
void | notifyObservers () |
Protected Member Functions | |
const boost::shared_ptr < LMIntegration > & | integration () const |
access to integration: | |
![]() |
Additional Inherited Members | |
![]() | |
typedef copulaPolicy | copulaType |
![]() | |
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_ |
Random spot recovery rate latent variable portfolio model.
Expected conditional spot recovery rate. Conditional on a set of systemic factors and default returns the integrated attainable recovery values.
Implements equation 42 on p.14 (second). Remember that for this call to make sense the sample used must be one leading to a default. Theres no check on this. This member typically to be used within a simulation.
Due to the way the latent model is splitted in two parts, we call the base class for the default sample and the LM owned here for the RR model sample. This sample only makes sense if it led to a default.
allFactors | All sampled factors, default and RR valiables. |
iVar | The index of the name for which we want the RR sample |
Single name expected loss.