27#include <ql/experimental/credit/distribution.hpp>
28#include <ql/experimental/credit/randomdefaultmodel.hpp>
29#include <ql/math/distributions/bivariatenormaldistribution.hpp>
30#include <ql/math/distributions/normaldistribution.hpp>
55 QuantLib::ext::shared_ptr<RandomDefaultModel> rdm,
61 double errorTolerance = 1.0e-6,
63 std::vector<QuantLib::Period> lossDistributionPeriods = std::vector<QuantLib::Period>())
70 void interestWaterfall(Size sampleIndex, Size dateIndex,
const vector<Date>& dates,
71 map<Currency, vector<Cash>>& basketFlow, map<Currency, Cash>& trancheFlow,
72 map<Currency, vector<vector<Real>>>& balance, map<Currency, Real>& interest,
73 map<Currency, Real>& interestAcc, Real cureAmount)
const;
78 const vector<Date>& dates, map<Currency, vector<Cash>>& iFlows,
79 vector<map<Currency, Cash>>& tranches,
80 vector<map<Currency, vector<vector<Real>>>>& balances, Real cureAmount)
const;
84 map<Currency, vector<Cash>>& basketFlow, map<Currency, Cash>& trancheFlow,
85 map<Currency, vector<vector<Real>>>& balance, map<Currency, Real>& interest)
const;
87 Real
icocCureAmount(Size sampleIndex, Size dateIndex, Size trancheNo, Real basketNotional, Real basketInterest,
88 vector<map<Currency, vector<vector<Real>>>>& trancheBalances, vector<Real> trancheInterestRates,
89 Real icRatios, Real ocRatios)
const;
94 QuantLib::ext::shared_ptr<RandomDefaultModel>
rdm_;
collateralized bond obligation pricing engine
CBO engine, Monte Carlo for the sample payoff.
std::map< QuantLib::Date, std::string > getLossDistributionDates(const QuantLib::Date &valuationDate) const
Return dates on the CBO schedule that are closest to the requested lossDistributionPeriods.
MonteCarloCBOEngine(QuantLib::ext::shared_ptr< RandomDefaultModel > rdm, Size samples=1000, Size bins=20, double errorTolerance=1.0e-6, std::vector< QuantLib::Period > lossDistributionPeriods=std::vector< QuantLib::Period >())
void calculate() const override
void interestWaterfall(Size sampleIndex, Size dateIndex, const vector< Date > &dates, map< Currency, vector< Cash > > &basketFlow, map< Currency, Cash > &trancheFlow, map< Currency, vector< vector< Real > > > &balance, map< Currency, Real > &interest, map< Currency, Real > &interestAcc, Real cureAmount) const
interest waterfall
QuantLib::ext::shared_ptr< RandomDefaultModel > rdm_
void principalWaterfall(Size sampleIndex, Size dateIndex, const vector< Date > &dates, map< Currency, vector< Cash > > &basketFlow, map< Currency, Cash > &trancheFlow, map< Currency, vector< vector< Real > > > &balance, map< Currency, Real > &interest) const
pricipal waterfall
std::vector< QuantLib::Period > lossDistributionPeriods_
Periods from valuation date for which to return loss distributions.
Real icocCureAmount(Size sampleIndex, Size dateIndex, Size trancheNo, Real basketNotional, Real basketInterest, vector< map< Currency, vector< vector< Real > > > > &trancheBalances, vector< Real > trancheInterestRates, Real icRatios, Real ocRatios) const
icoc cure amount
void icocInterestWaterfall(Size i, Size j, Size k, const vector< Date > &dates, map< Currency, vector< Cash > > &iFlows, vector< map< Currency, Cash > > &tranches, vector< map< Currency, vector< vector< Real > > > > &balances, Real cureAmount) const
icoc interest waterfall