QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
|
#include <defaultlossmodel.hpp>
Protected Member Functions | |
DefaultLossModel ()=default | |
Protected Attributes | |
RelinkableHandle< Basket > | basket_ |
Friends | |
class | Basket |
Statistics | |
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. 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 Real | defaultCorrelation (const Date &d, Size iName, Size jName) const |
Pearsons' default probability correlation. More... | |
virtual Probability | probAtLeastNEvents (Size n, const Date &d) const |
virtual Real | expectedRecovery (const Date &, Size iName, const DefaultProbKey &) const |
void | setBasket (Basket *bskt) |
virtual void | resetModel ()=0 |
Concrete models do now any updates/inits they need on basket reset. More... | |
Additional Inherited Members | |
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 () |
Default loss model interface definition. Allows communication between the basket and specific algorithms. Intended to hold any kind of portfolio joint loss, latent models, top-down,....
An inconvenience of this design as opposed to the full arguments/results is that when pricing several derivatives instruments on the same basket not all the pricing engines would point to the same loss model; thus when pricing a set of such instruments there might be some switching on the basket loss models, which might require recalculations (of the basket) or not depending on the pricing order.
Definition at line 48 of file defaultlossmodel.hpp.
|
protecteddefault |
Reimplemented in BaseCorrelationLossModel< BaseModel_T, Corr2DInt_T >, BinomialLossModel< LLM >, GaussianLHPLossModel, HomogeneousPoolLossModel< copulaPolicy >, InhomogeneousPoolLossModel< copulaPolicy >, RandomLM< derivedRandomLM, copulaPolicy, USNG >, RandomLM< RandomDefaultLM, copulaPolicy, SobolRsg >, RandomLM< RandomLossLM, copulaPolicy, SobolRsg >, SaddlePointLossModel< CP >, and RecursiveLossModel< copulaPolicy >.
Definition at line 67 of file defaultlossmodel.hpp.
|
protectedvirtual |
Probability of the tranche losing the same or more than the fractional amount given.
The passed lossFraction is a fraction of losses over the tranche notional (not the portfolio).
Reimplemented in GaussianLHPLossModel, and SaddlePointLossModel< CP >.
Definition at line 76 of file defaultlossmodel.hpp.
Value at Risk given a default loss percentile.
Reimplemented in SaddlePointLossModel< CP >, BinomialLossModel< LLM >, HomogeneousPoolLossModel< copulaPolicy >, InhomogeneousPoolLossModel< copulaPolicy >, RandomLM< derivedRandomLM, copulaPolicy, USNG >, RandomLM< RandomDefaultLM, copulaPolicy, SobolRsg >, RandomLM< RandomLossLM, copulaPolicy, SobolRsg >, RecursiveLossModel< copulaPolicy >, and GaussianLHPLossModel.
Definition at line 81 of file defaultlossmodel.hpp.
Expected shortfall given a default loss percentile.
Reimplemented in HomogeneousPoolLossModel< copulaPolicy >, InhomogeneousPoolLossModel< copulaPolicy >, SaddlePointLossModel< CP >, GaussianLHPLossModel, RandomLM< derivedRandomLM, copulaPolicy, USNG >, RandomLM< RandomDefaultLM, copulaPolicy, SobolRsg >, RandomLM< RandomLossLM, copulaPolicy, SobolRsg >, BinomialLossModel< LLM >, and RecursiveLossModel< copulaPolicy >.
Definition at line 85 of file defaultlossmodel.hpp.
Associated VaR fraction to each counterparty.
Reimplemented in RandomLM< derivedRandomLM, copulaPolicy, USNG >, RandomLM< RandomDefaultLM, copulaPolicy, SobolRsg >, RandomLM< RandomLossLM, copulaPolicy, SobolRsg >, and SaddlePointLossModel< CP >.
Definition at line 89 of file defaultlossmodel.hpp.
Associated ESF fraction to each counterparty.
Definition at line 93 of file defaultlossmodel.hpp.
|
protectedvirtual |
Full loss distribution.
Reimplemented in BinomialLossModel< LLM >, RandomLM< derivedRandomLM, copulaPolicy, USNG >, RandomLM< RandomDefaultLM, copulaPolicy, SobolRsg >, RandomLM< RandomLossLM, copulaPolicy, SobolRsg >, RecursiveLossModel< copulaPolicy >, and SaddlePointLossModel< CP >.
Definition at line 100 of file defaultlossmodel.hpp.
Probability density of a given loss fraction of the basket notional.
Definition at line 104 of file defaultlossmodel.hpp.
|
protectedvirtual |
Probabilities for each of the (remaining) basket elements in the pool to have defaulted by time d and at the same time be the Nth defaulting name to default in the basket. This method is oriented to default order dependent portfolio pricing (e.g. NTDs) The the probabilities ordering in the vector coincides with the pool order.
Reimplemented in RandomLM< derivedRandomLM, copulaPolicy, USNG >, RandomLM< RandomDefaultLM, copulaPolicy, SobolRsg >, and RandomLM< RandomLossLM, copulaPolicy, SobolRsg >.
Definition at line 115 of file defaultlossmodel.hpp.
Pearsons' default probability correlation.
Reimplemented in ConstantLossModel< copulaPolicy >, RandomLM< derivedRandomLM, copulaPolicy, USNG >, RandomLM< RandomDefaultLM, copulaPolicy, SobolRsg >, and RandomLM< RandomLossLM, copulaPolicy, SobolRsg >.
Definition at line 119 of file defaultlossmodel.hpp.
|
protectedvirtual |
Returns the probaility of having a given or larger number of defaults in the basket portfolio at a given time.
Reimplemented in ConstantLossModel< copulaPolicy >, RandomLM< derivedRandomLM, copulaPolicy, USNG >, RandomLM< RandomDefaultLM, copulaPolicy, SobolRsg >, and RandomLM< RandomLossLM, copulaPolicy, SobolRsg >.
Definition at line 126 of file defaultlossmodel.hpp.
|
protectedvirtual |
Expected RR for name conditinal to default by that date.
Reimplemented in RandomDefaultLM< copulaPolicy, USNG >, GaussianLHPLossModel, and ConstantLossModel< copulaPolicy >.
Definition at line 131 of file defaultlossmodel.hpp.
|
private |
Send a reference to the basket to allow the model to read the problem arguments (contained in the basket)
Definition at line 141 of file defaultlossmodel.hpp.
|
privatepure virtual |
Concrete models do now any updates/inits they need on basket reset.
Implemented in BaseCorrelationLossModel< BaseModel_T, Corr2DInt_T >, BinomialLossModel< LLM >, ConstantLossModel< copulaPolicy >, GaussianLHPLossModel, HomogeneousPoolLossModel< copulaPolicy >, InhomogeneousPoolLossModel< copulaPolicy >, RandomDefaultLM< copulaPolicy, USNG >, RandomLossLM< copulaPolicy, USNG >, RecursiveLossModel< copulaPolicy >, and SaddlePointLossModel< CP >.
|
friend |
Definition at line 53 of file defaultlossmodel.hpp.
|
mutableprotected |
Definition at line 56 of file defaultlossmodel.hpp.