QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
|
#include <gaussianlhplossmodel.hpp>
Public Types | |
typedef GaussianCopulaPolicy | copulaType |
Public Types inherited from LatentModel< GaussianCopulaPolicy > | |
typedef GaussianCopulaPolicy | copulaType |
Public Types inherited from Observer | |
typedef set_type::iterator | iterator |
Public Member Functions | |
GaussianLHPLossModel (const Handle< Quote > &correlQuote, const std::vector< Handle< RecoveryRateQuote > > "es) | |
GaussianLHPLossModel (Real correlation, const std::vector< Real > &recoveries) | |
GaussianLHPLossModel (const Handle< Quote > &correlQuote, const std::vector< Real > &recoveries) | |
void | update () override |
Real | expectedTrancheLoss (const Date &d) const override |
Real | probOverLoss (const Date &d, Real remainingLossFraction) const override |
Real | expectedShortfall (const Date &d, Probability perctl) const override |
Returns the ESF as an absolute amount (rather than a fraction) More... | |
Real | percentile (const Date &d, Real perctl) const override |
Value at Risk given a default loss percentile. More... | |
Probability | averageProb (const Date &d) const |
Real | averageRecovery (const Date &d) const |
Public Member Functions inherited from Observable | |
Observable () | |
Observable (const Observable &) | |
Observable & | operator= (const Observable &) |
Observable (Observable &&)=delete | |
Observable & | operator= (Observable &&)=delete |
virtual | ~Observable ()=default |
void | notifyObservers () |
Public Member Functions inherited from LatentModel< GaussianCopulaPolicy > | |
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< Real > | allFactorCumulInverter (const std::vector< Real > &probs) const |
Real | latentVarValue (const std::vector< Real > &allFactors, Size iVar) const |
const copulaType & | copula () const |
Real | integratedExpectedValue (const ext::function< Real(const std::vector< Real > &v1)> &f) const |
std::vector< Real > | integratedExpectedValueV (const ext::function< std::vector< Real >(const std::vector< Real > &v1)> &f) const |
Public Member Functions inherited from Observer | |
Observer ()=default | |
Observer (const Observer &) | |
Observer & | operator= (const Observer &) |
virtual | ~Observer () |
std::pair< iterator, bool > | registerWith (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 () |
Protected Member Functions | |
Real | percentilePortfolioLossFraction (const Date &d, Real perctl) const |
Real | expectedRecovery (const Date &d, Size iName, const DefaultProbKey &ik) const override |
Protected Member Functions inherited from DefaultLossModel | |
DefaultLossModel ()=default | |
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 Real | defaultCorrelation (const Date &d, Size iName, Size jName) const |
Pearsons' default probability correlation. More... | |
virtual Probability | probAtLeastNEvents (Size n, const Date &d) const |
Protected Member Functions inherited from LatentModel< GaussianCopulaPolicy > | |
virtual const ext::shared_ptr< LMIntegration > & | integration () const |
Private Member Functions | |
void | resetModel () override |
Concrete models do now any updates/inits they need on basket reset. More... | |
Real | expectedTrancheLossImpl (Real remainingNot, Real prob, Real averageRR, Real attachLimit, Real detachLimit) const |
Private Attributes | |
Real | sqrt1minuscorrel_ |
Handle< Quote > | correl_ |
std::vector< Handle< RecoveryRateQuote > > | rrQuotes_ |
Real | beta_ |
BivariateCumulativeNormalDistribution | biphi_ |
Static Private Attributes | |
static CumulativeNormalDistribution const | phi_ |
Additional Inherited Members | |
Protected Attributes inherited from DefaultLossModel | |
RelinkableHandle< Basket > | basket_ |
Protected Attributes inherited from LatentModel< GaussianCopulaPolicy > | |
std::vector< std::vector< Real > > | factorWeights_ |
Handle< Quote > | cachedMktFactor_ |
std::vector< Real > | idiosyncFctrs_ |
Size | nFactors_ |
Number of systemic factors. More... | |
Size | nVariables_ |
Number of latent model variables, idiosyncratic terms or model dim. More... | |
copulaType | copula_ |
Portfolio loss model with analytical expected tranche loss for a large homogeneous pool with Gaussian one-factor copula. See for example "The Normal Inverse Gaussian Distribution for Synthetic CDO pricing.", Anna Kalemanova, Bernd Schmid, Ralf Werner, Journal of Derivatives, Vol. 14, No. 3, (Spring 2007), pp. 80-93. http://www.defaultrisk.com/pp_crdrv_91.htm
It can be used to price a credit derivative or to provide risk metrics of a portfolio.
Definition at line 61 of file gaussianlhplossmodel.hpp.
typedef GaussianCopulaPolicy copulaType |
Definition at line 64 of file gaussianlhplossmodel.hpp.
GaussianLHPLossModel | ( | const Handle< Quote > & | correlQuote, |
const std::vector< Handle< RecoveryRateQuote > > & | quotes | ||
) |
GaussianLHPLossModel | ( | Real | correlation, |
const std::vector< Real > & | recoveries | ||
) |
Definition at line 51 of file gaussianlhplossmodel.cpp.
GaussianLHPLossModel | ( | const Handle< Quote > & | correlQuote, |
const std::vector< Real > & | recoveries | ||
) |
|
overridevirtual |
This method must be implemented in derived classes. An instance of Observer does not call this method directly: instead, it will be called by the observables the instance registered with when they need to notify any changes.
Implements Observer.
Definition at line 78 of file gaussianlhplossmodel.hpp.
|
overrideprivatevirtual |
Concrete models do now any updates/inits they need on basket reset.
Implements DefaultLossModel.
Definition at line 88 of file gaussianlhplossmodel.hpp.
|
private |
attachLimit | as a fraction of the underlying live portfolio notional |
Definition at line 85 of file gaussianlhplossmodel.cpp.
Reimplemented from DefaultLossModel.
Definition at line 98 of file gaussianlhplossmodel.hpp.
The passed remainingLossFraction is in live tranche units, not portfolio as a fraction of the remaining(live) tranche (i.e. a_remaining=0% and det_remaining=100%)
Reimplemented from DefaultLossModel.
Definition at line 118 of file gaussianlhplossmodel.cpp.
|
overridevirtual |
Returns the ESF as an absolute amount (rather than a fraction)
Reimplemented from DefaultLossModel.
Definition at line 156 of file gaussianlhplossmodel.cpp.
Definition at line 187 of file gaussianlhplossmodel.cpp.
|
overrideprotectedvirtual |
Expected RR for name conditinal to default by that date.
Reimplemented from DefaultLossModel.
Definition at line 136 of file gaussianlhplossmodel.hpp.
Value at Risk given a default loss percentile.
Reimplemented from DefaultLossModel.
Definition at line 142 of file gaussianlhplossmodel.hpp.
Probability averageProb | ( | const Date & | d | ) | const |
Definition at line 153 of file gaussianlhplossmodel.hpp.
Definition at line 171 of file gaussianlhplossmodel.hpp.
|
mutableprivate |
Definition at line 193 of file gaussianlhplossmodel.hpp.
Definition at line 195 of file gaussianlhplossmodel.hpp.
|
private |
Definition at line 196 of file gaussianlhplossmodel.hpp.
|
private |
Definition at line 208 of file gaussianlhplossmodel.hpp.
|
private |
Definition at line 209 of file gaussianlhplossmodel.hpp.
|
staticprivate |
Definition at line 210 of file gaussianlhplossmodel.hpp.