19#ifndef quantext_defaultlossmodel_hpp
20#define quantext_defaultlossmodel_hpp
22#include <ql/experimental/credit/defaultprobabilitykey.hpp>
23#include <ql/instruments/claim.hpp>
27#include <ql/utilities/null_deleter.hpp>
59 mutable RelinkableHandle<QuantExt::Basket>
basket_;
72 QL_FAIL(
"expectedTrancheLoss Not implemented for this model.");
80 virtual Probability
probOverLoss(
const Date& d, Real lossFraction)
const {
81 QL_FAIL(
"probOverLoss Not implemented for this model.");
85 QL_FAIL(
"percentile Not implemented for this model.");
89 QL_FAIL(
"eSF Not implemented for this model.");
92 virtual std::vector<Real>
splitVaRLevel(
const Date& d, Real loss)
const {
93 QL_FAIL(
"splitVaRLevel Not implemented for this model.");
96 virtual std::vector<Real>
splitESFLevel(
const Date& d, Real loss)
const {
97 QL_FAIL(
"splitESFLevel Not implemented for this model.");
104 QL_FAIL(
"lossDistribution Not implemented for this model.");
108 QL_FAIL(
"densityTrancheLoss Not implemented for this model.");
118 QL_FAIL(
"probsBeingNthEvent Not implemented for this model.");
122 QL_FAIL(
"defaultCorrelation Not implemented for this model.");
128 QL_FAIL(
"probAtLeastNEvents Not implemented for this model.");
133 QL_FAIL(
"expected recovery Not implemented for this model.");
141 return QuantLib::Null<QuantLib::Real>();
160 basket_.linkTo(QuantLib::ext::shared_ptr<QuantExt::Basket>(bskt, null_deleter()),
false);
basket of issuers and related notionals
virtual Real defaultCorrelation(const Date &d, Size iName, Size jName) const
Pearsons' default probability correlation.
virtual Probability probOverLoss(const Date &d, Real lossFraction) const
virtual std::map< Real, Probability > lossDistribution(const Date &) const
Full loss distribution.
virtual void resetModel()=0
Concrete models do now any updates/inits they need on basket reset.
virtual Real expectedTrancheLoss(const Date &d, Real recoveryRate=Null< Real >()) const
virtual std::vector< Probability > probsBeingNthEvent(Size n, const Date &d) const
virtual Real expectedShortfall(const Date &d, Real percentile) const
Expected shortfall given a default loss percentile.
virtual QuantLib::Real correlation() const
RelinkableHandle< QuantExt::Basket > basket_
virtual Real expectedRecovery(const Date &, Size iName, const DefaultProbKey &) const
virtual Real percentile(const Date &d, Real percentile) const
Value at Risk given a default loss percentile.
virtual Real densityTrancheLoss(const Date &d, Real lossFraction) const
Probability density of a given loss fraction of the basket notional.
void setBasket(QuantExt::Basket *bskt)
virtual Probability probAtLeastNEvents(Size n, const Date &d) const
virtual std::vector< Real > splitVaRLevel(const Date &d, Real loss) const
Associated VaR fraction to each counterparty.
virtual std::vector< Real > splitESFLevel(const Date &d, Real loss) const
Associated ESF fraction to each counterparty.