#include <ql/experimental/credit/basket.hpp>
Public Member Functions | |
Basket (const std::vector< std::string > &names, const std::vector< Real > ¬ionals, const boost::shared_ptr< Pool > pool, const std::vector< DefaultProbKey > &defaultKeys, const std::vector< boost::shared_ptr< RecoveryRateModel > > &rrModels, Real attachmentRatio=0.0, Real detachmentRatio=1.0) | |
Size | size () const |
const std::vector< std::string > & | names () const |
const std::vector< Real > & | notionals () const |
Real | notional () |
boost::shared_ptr< Pool > | pool () const |
const std::vector < DefaultProbKey > & | defaultKeys () const |
const std::vector < boost::shared_ptr < RecoveryRateModel > > & | recoveryModels () const |
const std::vector< Real > & | LGDs () const |
Real | lgd () |
Real | attachmentRatio () const |
Attachment point expressed as a fraction of the total pool notional. | |
Real | detachmentRatio () const |
Detachment point expressed as a fraction of the total pool notional. | |
Real | basketNotional () const |
Original basket notional ignoring any losses. | |
Real | basketLGD () const |
Original expected basket LGD. | |
Real | trancheNotional () const |
Original tranche notional ignoring any losses. | |
Real | attachmentAmount () const |
Attachment amount = attachmentRatio() * basketNotional() | |
Real | detachmentAmount () const |
Detachment amount = detachmentRatio() * basketNotional() | |
std::vector< Real > | probabilities (const Date &d) const |
Real | cumulatedLoss (const Date &startDate, const Date &endDate) const |
Real | remainingNotional (const Date &startDate, const Date &endDate) const |
std::vector< Real > | remainingNotionals (const Date &startDate, const Date &endDate) const |
std::vector< std::string > | remainingNames (const Date &startDate, const Date &endDate) const |
std::vector< DefaultProbKey > | remainingDefaultKeys (const Date &startDate, const Date &endDate) const |
std::vector< boost::shared_ptr < RecoveryRateModel > > | remainingRecModels (const Date &startDate, const Date &endDate) const |
Real | remainingAttachmentRatio (const Date &startDate, const Date &endDate) const |
Real | remainingAttachmentAmount (const Date &startDate, const Date &endDate) const |
Real | remainingDetachmentRatio (const Date &startDate, const Date &endDate) const |
Real | remainingDetachmentAmount (const Date &startDate, const Date &endDate) const |
void | updateScenarioLoss (bool zeroRecovery=false) |
Real | scenarioTrancheLoss (Date endDate) const |
Cumulative tranche loss up to end date under the current scenario. | |
std::vector< Loss > | scenarioIncrementalBasketLosses () const |
Vector of incremental basket losses under the current scenario. | |
std::vector< Loss > | scenarioIncrementalTrancheLosses (Date startDate=Date::minDate(), Date endDate=Date::maxDate()) const |
Vector of incremental tranche losses under the current scenario. | |
![]() | |
void | update () |
void | recalculate () |
void | freeze () |
void | unfreeze () |
![]() | |
Observable (const Observable &) | |
Observable & | operator= (const Observable &) |
void | notifyObservers () |
![]() | |
Observer (const Observer &) | |
Observer & | operator= (const Observer &) |
std::pair< std::set < boost::shared_ptr < Observable > >::iterator, bool > | registerWith (const boost::shared_ptr< Observable > &) |
Size | unregisterWith (const boost::shared_ptr< Observable > &) |
void | unregisterWithAll () |
Additional Inherited Members | |
![]() | |
virtual void | calculate () const |
![]() | |
bool | calculated_ |
bool | frozen_ |
Credit Basket.
A basket is a collection of credit names, represented by a unique identifier (a text string), associated notional amounts, a pool and tranche information. The pool is a map of "names" to issuers. The Basket structure is motivated by CDO squared instruments containing various underlying inner CDOs which can be represented by respective baskets including their tranche structure. The role of the Pool is providing a unique list of relevant issuers while names may appear multiple times across different baskets (overlap).
const std::vector<Real>& LGDs | ( | ) | const |
Loss Given Default for all issuers/notionals based on expected recovery rates for the respective issuers.
Vector of cumulative default probability to date d for al issuers in the basket.
Actual basket losses between start and end date, taking the actual recovery rates of loss events into account.
Remaining basket notional after losses between start and end date. The full notional for defaulted names is subracted, recovery ignored.
Vector of surviving notionals after losses between start and end date, recovery ignored.
Vector of surviving issuers after defaults between start and end date.
The remaining attachment amount is RAA = max (0, attachmentAmount - cumulatedLoss())
The remaining attachment ratio is then RAR = RAA / remainingNotional()
The remaining detachment amount is RDA = max (0, detachmentAmount - cumulatedLoss())
The remaining detachment ratio is then RDR = RDA / remainingNotional()
void updateScenarioLoss | ( | bool | zeroRecovery = false | ) |
Based on the default times stored in the Pool for each name, update the vector of incremental basket losses (sorted by default time) for this basket. If zeroRecovery is set to true, losses are full notional amounts, otherwise loss give defaults.