#include <qle/instruments/bondbasket.hpp>
Public Member Functions | |
BondBasket (const std::map< std::string, boost::shared_ptr< QuantLib::Bond >> &qlBonds, const std::map< std::string, double > &recoveries, const std::map< std::string, double > &multipliers, const std::map< std::string, QuantLib::Handle< QuantLib::YieldTermStructure >> &yieldTermStructures, const std::map< std::string, Currency > ¤cies, const boost::shared_ptr< QuantLib::Pool > pool, Currency baseCcy, const std::map< std::string, boost::shared_ptr< QuantExt::FxIndex >> &fxIndexMap, const QuantLib::Date &reinvestmentEndDate, const std::map< std::string, std::vector< double >> &reinvestmentScalar, const std::map< std::string, std::vector< std::string >> &flowType) | |
const std::map< std::string, boost::shared_ptr< QuantLib::Bond > > & | bonds () const |
Inspectors. More... | |
const boost::shared_ptr< QuantLib::Pool > & | pool () const |
const std::map< std::string, boost::shared_ptr< QuantExt::FxIndex > > & | fxIndexMap () const |
const std::set< QuantLib::Currency > | unique_currencies () const |
const double | recoveryRate (const std::string &name) const |
const double | multiplier (const std::string &name) const |
Real | convert (Real amount, Currency ccy, Date date=Date()) |
void | setGrid (std::vector< Date > dates) |
std::map< Currency, std::vector< Cash > > | scenarioCashflow (std::vector< Date > dates) |
std::map< Currency, std::vector< Cash > > | scenarioInterestflow (std::vector< Date > dates) |
std::map< Currency, std::vector< Cash > > | scenarioPrincipalflow (std::vector< Date > dates) |
std::map< Currency, std::vector< Real > > | scenarioRemainingNotional (std::vector< Date > dates) |
std::map< Currency, std::vector< Cash > > | scenarioLossflow (std::vector< Date > dates) |
std::map< Currency, std::vector< Cash > > | scenarioFeeflow (const std::vector< QuantLib::Date > &dates) |
void | fillFlowMaps () |
Bond Basket.
This class holds a basket of defaultable bonds along with the pool of relevant names. There may be more bonds than names involved, e.g. several different bonds with same issuer.
The class provides tools for evaluating basket cash flows of different kinds (interest, principal) for scenarios of default times stored for all names involved in the Pool structure.
For further information refer to the detailed QuantExt documentation.
BondBasket | ( | const std::map< std::string, boost::shared_ptr< QuantLib::Bond >> & | qlBonds, |
const std::map< std::string, double > & | recoveries, | ||
const std::map< std::string, double > & | multipliers, | ||
const std::map< std::string, QuantLib::Handle< QuantLib::YieldTermStructure >> & | yieldTermStructures, | ||
const std::map< std::string, Currency > & | currencies, | ||
const boost::shared_ptr< QuantLib::Pool > | pool, | ||
Currency | baseCcy, | ||
const std::map< std::string, boost::shared_ptr< QuantExt::FxIndex >> & | fxIndexMap, | ||
const QuantLib::Date & | reinvestmentEndDate, | ||
const std::map< std::string, std::vector< double >> & | reinvestmentScalar, | ||
const std::map< std::string, std::vector< std::string >> & | flowType | ||
) |
qlBonds | map of QuantLib bonds |
recoveries | recoveries per bonds |
multipliers | multipliers per bonds |
yieldTermStructures | discount curves per bonds |
currencies | currencies per bonds |
pool | Pool storing default time for all names involved in the basekt above |
baseCcy | Base currency |
fxIndexMap | Forex structure to compute spot and forward FX rates |
reinvestmentEndDate | end of reinvestment period |
reinvestmentScalar | scalar for reinvestment period per bonds |
flowType | flow types of cashflows per bonds |
const std::map<std::string, boost::shared_ptr<QuantLib::Bond> >& bonds | ( | ) | const |
Inspectors.
Vector of risky bonds
const boost::shared_ptr<QuantLib::Pool>& pool | ( | ) | const |
Pool of names with associated default times
const std::map<std::string, boost::shared_ptr<QuantExt::FxIndex> >& fxIndexMap | ( | ) | const |
Forex structure
const std::set<QuantLib::Currency> unique_currencies | ( | ) | const |
Unique currencies involved
const double recoveryRate | ( | const std::string & | name | ) | const |
Recovery rate for given name
const double multiplier | ( | const std::string & | name | ) | const |
Multiplier for given name
Real convert | ( | Real | amount, |
Currency | ccy, | ||
Date | date = Date() |
||
) |
FX conversion
void setGrid | ( | std::vector< Date > | dates | ) |
Set the date grid for mapping cash flows. Store for each bond cash flow date the associated date grid bucket.