25#ifndef quantlib_basket_hpp
26#define quantlib_basket_hpp
39 class DefaultLossModel;
64 const std::vector<std::string>&
names,
66 ext::shared_ptr<Pool>
pool,
95 const std::vector<std::string>&
names()
const {
return pool_->names();}
97 const std::vector<Real>&
notionals()
const;
103 const ext::shared_ptr<Pool>&
pool()
const;
219 const std::vector<Size>&
liveList()
const;
223 const ext::shared_ptr<DefaultLossModel>& lossModel);
318 return pool_->size();
326 return pool_->defaultKeys();
361 inline const std::vector<DefaultProbKey>&
Classes for default-event claims.
std::vector< Probability > probabilities(const Date &d) const
Real recoveryRate(const Date &d, Size iName) const
Real evalDateAttachAmount_
void performCalculations() const override
const ext::shared_ptr< Claim > claim_
The claim is the same for all names.
Real defaultCorrelation(const Date &d, Size iName, Size jName) const
Real detachmentAmount_
basket tranched inception detachment amount:
Real remainingAttachmentAmount() const
ext::shared_ptr< Claim > claim() const
default claim, same for all positions and counterparties
Real detachmentAmount() const
Detachment amount = detachmentRatio() * basketNotional()
const std::vector< DefaultProbKey > & remainingDefaultKeys() const
Real evalDateSettledLoss_
std::vector< DefaultProbKey > evalDateLiveKeys_
std::vector< Real > evalDateLiveNotionals_
ext::shared_ptr< Pool > pool_
const std::vector< Real > & notionals() const
Basket counterparties notionals at inception.
Real remainingTrancheNotional() const
Remaining basket tranched notional on calculation date.
std::vector< Size > evalDateLiveList_
Real attachmentAmount_
basket tranched inception attachment amount:
Real detachmentRatio() const
Detachment point expressed as a fraction of the total pool notional.
Real attachmentRatio() const
std::vector< DefaultProbKey > defaultKeys() const
The keys each counterparty enters the basket with (sensitive to)
Real attachmentAmount() const
Attachment amount = attachmentRatio() * basketNotional()
void computeBasket() const
const Date refDate_
Basket inception date.
Probability probOverLoss(const Date &d, Real lossFraction) const
std::vector< Real > notionals_
Size remainingSize() const
Number of counterparties alive on the requested date.
const ext::shared_ptr< Pool > & pool() const
Underlying pool.
Real remainingTrancheNotional(const Date &endDate) const
Real exposure(const std::string &name, const Date &=Date()) const
Returns the total expected exposures for that name.
Real densityTrancheLoss(const Date &d, Real lossFraction) const
Real trancheNotional_
basket tranched notional amount:
Probability probAtLeastNEvents(Size n, const Date &d) const
Real evalDateRemainingNot_
const std::vector< Size > & liveList() const
Indexes of remaining names. Notice these are names and not positions.
const std::vector< std::string > & names() const
Basket counterparties names at inception.
const Date & refDate() const
Basket inception date.
Real percentile(const Date &d, Probability prob) const
ext::shared_ptr< DefaultLossModel > lossModel_
Real expectedTrancheLoss(const Date &d) const
std::vector< std::string > evalDateLiveNames_
void setLossModel(const ext::shared_ptr< DefaultLossModel > &lossModel)
Assigns the default loss model to this basket. Resets calculations.
Real notional() const
Basket total notional at inception.
std::vector< Probability > probsBeingNthEvent(Size n, const Date &d) const
Real basketNotional() const
Original basket notional ignoring any losses.
Real trancheNotional() const
Original tranche notional ignoring any realized losses.
Real remainingDetachmentAmount() const
Size size() const
Basket inception number of counterparties.
const std::vector< std::string > & remainingNames() const
Real expectedShortfall(const Date &d, Probability prob) const
std::vector< Real > splitVaRLevel(const Date &date, Real loss) const
Real cumulatedLoss() const
const std::vector< Real > & remainingNotionals() const
Real evalDateDetachAmmount_
std::vector< Probability > remainingProbabilities(const Date &d) const
Real remainingNotional() const
std::map< Real, Probability > lossDistribution(const Date &) const
Framework for calculation on demand and result caching.
virtual void calculate() const
DateProxy & evaluationDate()
the date at which pricing is to be performed.
static Settings & instance()
access to the unique instance
Classes for default-event description.
default-probability term structure
Real Probability
probability
std::size_t Size
size of a container
Classes for credit-name handling.
framework for calculation on demand and result caching
Pair of loss time and amount, sortable by loss time.