QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
|
#include <recursivelossmodel.hpp>
Public Member Functions | |
RecursiveLossModel (const ext::shared_ptr< ConstantLossLatentmodel< copulaPolicy > > &m, Size nbuckets=1) | |
Real | expectedTrancheLoss (const Date &date) const override |
std::vector< Real > | lossProbability (const Date &date) const |
std::map< Real, Probability > | lossDistribution (const Date &d) const override |
Full loss distribution. More... | |
Real | percentile (const Date &d, Real percentile) const override |
Value at Risk given a default loss percentile. More... | |
Real | expectedShortfall (const Date &d, Real perctl) const override |
Expected shortfall given a default loss percentile. More... | |
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 () |
Protected Member Functions | |
void | resetModel () override |
Concrete models do now any updates/inits they need on basket reset. More... | |
Protected Member Functions inherited from DefaultLossModel | |
DefaultLossModel ()=default | |
virtual Probability | probOverLoss (const Date &d, Real lossFraction) const |
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 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 |
Protected Attributes | |
const ext::shared_ptr< ConstantLossLatentmodel< copulaPolicy > > | copula_ |
Protected Attributes inherited from DefaultLossModel | |
RelinkableHandle< Basket > | basket_ |
Private Member Functions | |
std::map< Real, Probability > | conditionalLossDistrib (const std::vector< Probability > &pDefDate, const std::vector< Real > &mktFactor) const |
Real | expectedConditionalLoss (const std::vector< Probability > &pDefDate, const std::vector< Real > &mktFactor) const |
Portfolio loss conditional to the market factor value. More... | |
std::vector< Real > | conditionalLossProb (const std::vector< Probability > &pDefDate, const std::vector< Real > &mktFactor) const |
std::map< Real, Probability > | conditionalLossDistribInvP (const std::vector< Real > &pDefDate, const std::vector< Real > &mktFactor) const |
Real | expectedConditionalLossInvP (const std::vector< Real > &pDefDate, const std::vector< Real > &mktFactor) const |
Private Attributes | |
const Size | nBuckets_ |
std::vector< Real > | wk_ |
Real | lossUnit_ |
Real | attachAmount_ |
name to name factor. In the single factor copula: More... | |
Real | detachAmount_ |
Real | notional_ |
Size | remainingBsktSize_ |
std::vector< Real > | notionals_ |
Recursive STCDO default loss model for a heterogeneous pool of names. The pool names are heterogeneous in their default probabilities, notionals and recovery rates. Correlations are given by the latent model. The recursive pricing algorithm used here is described in Andersen, Sidenius and Basu; "All your hedges in one basket", Risk, November 2003, pages 67-72
Notice that using copulas other than Gaussian it is only an approximation (see remark on p.68). \todo Make the loss unit equal to some small fraction depending on the portfolio loss weights (notionals and recoveries). As it is now this is ok for pricing but not for risk metrics. See the discussion in O'Kane 18.3.2 \todo Intengrands should all use the inverted probabilities for performance instead of calling the copula inversion with the same vals.
Definition at line 47 of file recursivelossmodel.hpp.
|
explicit |
Definition at line 49 of file recursivelossmodel.hpp.
|
private |
pDefDate | Vector of unconditional default probabilities for each live name (at the current evaluation date). This is passed instead of the date for performance reasons (if in the future other magnitudes -e.g. lgd- are contingent on the date they shouldd be passed too). |
Definition at line 302 of file recursivelossmodel.hpp.
|
private |
Portfolio loss conditional to the market factor value.
Definition at line 406 of file recursivelossmodel.hpp.
|
private |
Definition at line 469 of file recursivelossmodel.hpp.
|
private |
Definition at line 350 of file recursivelossmodel.hpp.
|
private |
Definition at line 438 of file recursivelossmodel.hpp.
|
overrideprotectedvirtual |
Concrete models do now any updates/inits they need on basket reset.
Implements DefaultLossModel.
Definition at line 191 of file recursivelossmodel.hpp.
Reimplemented from DefaultLossModel.
Definition at line 131 of file recursivelossmodel.hpp.
Definition at line 178 of file recursivelossmodel.hpp.
|
overridevirtual |
Full loss distribution.
Reimplemented from DefaultLossModel.
Definition at line 216 of file recursivelossmodel.hpp.
Value at Risk given a default loss percentile.
Reimplemented from DefaultLossModel.
Definition at line 233 of file recursivelossmodel.hpp.
Expected shortfall given a default loss percentile.
Reimplemented from DefaultLossModel.
Definition at line 262 of file recursivelossmodel.hpp.
|
protected |
Definition at line 106 of file recursivelossmodel.hpp.
|
private |
Definition at line 109 of file recursivelossmodel.hpp.
|
mutableprivate |
Definition at line 110 of file recursivelossmodel.hpp.
|
mutableprivate |
Definition at line 111 of file recursivelossmodel.hpp.
|
mutableprivate |
name to name factor. In the single factor copula:
Definition at line 118 of file recursivelossmodel.hpp.
|
private |
Definition at line 119 of file recursivelossmodel.hpp.
|
private |
Definition at line 120 of file recursivelossmodel.hpp.
|
mutableprivate |
Definition at line 121 of file recursivelossmodel.hpp.
|
mutableprivate |
Definition at line 122 of file recursivelossmodel.hpp.