32 Real initialNumeraireValue)
33 : evolver_(
std::move(evolver)), product_(product),
34 initialNumeraireValue_(initialNumeraireValue), numberProducts_(product->numberOfProducts()),
35 numerairesHeld_(product->numberOfProducts()),
40 product_->maxNumberOfCashFlowsPerProductPerStep());
42 const std::vector<Time>& cashFlowTimes =
44 const std::vector<Rate>& rateTimes =
product_->evolution().rateTimes();
46 for (
Real cashFlowTime : cashFlowTimes)
54 Real principalInNumerairePortfolio = 1.0;
69 const std::vector<MarketModelMultiProduct::CashFlow>& cashflows =
78 Real bonds = cashflows[j].amount *
99 principalInNumerairePortfolio *=
100 evolver_->currentState().discountRatio(numeraire,
115 std::vector<Real> values(
product_->numberOfProducts());
116 for (
Size i=0; i<numberOfPaths; ++i) {
118 stats.
add(values,weight);
ext::shared_ptr< MarketModelEvolver > evolver_
std::vector< MarketModelDiscounter > discounters_
Real initialNumeraireValue_
void multiplePathValues(SequenceStatisticsInc &stats, Size numberOfPaths)
std::vector< std::vector< MarketModelMultiProduct::CashFlow > > cashFlowsGenerated_
std::vector< Size > numberCashFlowsThisStep_
std::vector< Real > numerairesHeld_
Real singlePathValues(std::vector< Real > &values)
AccountingEngine(ext::shared_ptr< MarketModelEvolver > evolver, const Clone< MarketModelMultiProduct > &product, Real initialNumeraireValue)
Clone< MarketModelMultiProduct > product_
cloning proxy to an underlying object
Statistics analysis of N-dimensional (sequence) data.
void add(const Sequence &sample, Real weight=1.0)
Real numeraireBonds(const CurveState &, Size numeraire) const
std::size_t Size
size of a container
std::vector< Size > numberCashFlowsThisStep_
std::vector< std::vector< CashFlow > > cashFlowsGenerated_