35 const std::vector<Time>& rateTimes,
36 std::vector<Real> fixedAccruals,
37 const std::vector<Real>& floatingAccruals,
38 const std::vector<Real>& fixedStrikes,
39 const std::vector<Real>& fixedMultipliers,
40 const std::vector<Real>& floatingSpreads,
41 const std::vector<Time>& paymentTimes,
43 : rateTimes_(rateTimes), fixedAccruals_(
std::move(fixedAccruals)),
44 floatingAccruals_(floatingAccruals), fixedStrikes_(fixedStrikes),
45 fixedMultipliers_(fixedMultipliers), floatingSpreads_(floatingSpreads),
46 paymentTimes_(paymentTimes), multiplier_(payer ? -1.0 : 1.0),
47 lastIndex_(rateTimes.size() - 1) {
50 QL_REQUIRE(floatingAccruals.size() ==
lastIndex_,
" Incorrect number of floatingAccruals given, should be " <<
lastIndex_ <<
" not " << floatingAccruals.size() );
51 QL_REQUIRE(fixedStrikes.size() ==
lastIndex_,
" Incorrect number of fixedStrikes given, should be " <<
lastIndex_ <<
" not " << fixedStrikes.size() );
52 QL_REQUIRE(fixedMultipliers.size() ==
lastIndex_,
" Incorrect number of fixedMultipliers given, should be " <<
lastIndex_ <<
" not " << fixedMultipliers.size() );
53 QL_REQUIRE(floatingSpreads.size() ==
lastIndex_,
" Incorrect number of floatingSpreads given, should be " <<
lastIndex_ <<
" not " << floatingSpreads.size() );
54 QL_REQUIRE(paymentTimes.size() ==
lastIndex_,
" Incorrect number of paymentTimes given, should be " <<
lastIndex_ <<
" not " << paymentTimes.size() );
56 std::vector<Time> evolTimes(rateTimes);
65 std::vector<Size>& numberCashFlowsThisStep,
66 std::vector<std::vector<MarketModelPathwiseMultiProduct::CashFlow> >& cashFlowsGenerated)
68 numberCashFlowsThisStep[0] =1 ;
70 cashFlowsGenerated[0][0].amount[i] =0;
76 cashFlowsGenerated[0][0].amount[0] =
multiplier_*(inverseFloatingCoupon - floatingCoupon);
80 if (inverseFloatingCoupon > 0.0)
101 std::unique_ptr<MarketModelPathwiseMultiProduct>
Curve state for market-model simulations
virtual Rate forwardRate(Size i) const =0
Market-model evolution description.
std::vector< Time > paymentTimes_
std::vector< Size > suggestedNumeraires() const override
std::vector< Real > floatingAccruals_
std::vector< Real > fixedStrikes_
MarketModelPathwiseInverseFloater(const std::vector< Time > &rateTimes, std::vector< Real > fixedAccruals, const std::vector< Real > &floatingAccruals, const std::vector< Real > &fixedStrikes, const std::vector< Real > &fixedMultipliers, const std::vector< Real > &floatingSpreads, const std::vector< Time > &paymentTimes, bool payer=true)
std::vector< Real > floatingSpreads_
std::vector< Real > fixedMultipliers_
bool nextTimeStep(const CurveState ¤tState, std::vector< Size > &numberCashFlowsThisStep, std::vector< std::vector< MarketModelPathwiseMultiProduct::CashFlow > > &cashFlowsGenerated) override
return value indicates whether path is finished, TRUE means done
std::unique_ptr< MarketModelPathwiseMultiProduct > clone() const override
returns a newly-allocated copy of itself
bool alreadyDeflated() const override
std::vector< Time > possibleCashFlowTimes() const override
const EvolutionDescription & evolution() const override
Size maxNumberOfCashFlowsPerProductPerStep() const override
EvolutionDescription evolution_
Size numberOfProducts() const override
std::vector< Real > fixedAccruals_
void reset() override
during simulation put product at start of path
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
std::size_t Size
size of a container
void checkIncreasingTimes(const std::vector< Time > ×)
check for strictly increasing times, first time greater than zero