29 const std::vector<Time>& rateTimes,
30 const std::vector<Time>& forwardOptionPaymentTimes,
31 const std::vector<Time>& swaptionPaymentTimes,
32 std::vector<ext::shared_ptr<StrikedTypePayoff> > forwardPayOffs,
33 std::vector<ext::shared_ptr<StrikedTypePayoff> > swapPayOffs,
37 forwardOptionPaymentTimes_(forwardOptionPaymentTimes),
38 swaptionPaymentTimes_(swaptionPaymentTimes), forwardPayOffs_(
std::move(forwardPayOffs)),
39 swapPayOffs_(
std::move(swapPayOffs)), period_(period), offset_(offset) {
41 "we need at least two rate times in MultiStepPeriodCapletSwaptions ");
53 "the offset must be less then the period in MultiStepPeriodCapletSwaptions ");
55 "we must have at least one FRA after the periodizing in MultiStepPeriodCapletSwaptions ");
58 "we must have precisely one payment time for each forward option MultiStepPeriodCapletSwaptions ");
61 "we must have precisely one payoff for each forward option MultiStepPeriodCapletSwaptions ");
64 "we must have precisely one payment time for each swaption in MultiStepPeriodCapletSwaptions ");
67 "we must have precisely one payoff for each swaption in MultiStepPeriodCapletSwaptions ");
72 std::vector<Size>& numberCashFlowsThisStep,
73 std::vector<std::vector<MarketModelMultiProduct::CashFlow> >&
77 for (
Size & i : numberCashFlowsThisStep)
84 Real forward = (1.0 / df - 1.0) / tau;
101 for (
unsigned long i = 0; i < numberPeriods; ++i) {
109 Real swapRate = (P0 - Pn) / B;
114 if (swaptionValue > 0) {
133 std::unique_ptr<MarketModelMultiProduct>
Curve state for market-model simulations
virtual Real discountRatio(Size i, Size j) const =0
Multiple-step market-model product.
std::vector< Time > rateTimes_
std::vector< Time > paymentTimes_
std::vector< ext::shared_ptr< StrikedTypePayoff > > forwardPayOffs_
std::unique_ptr< MarketModelMultiProduct > clone() const override
returns a newly-allocated copy of itself
bool nextTimeStep(const CurveState ¤tState, std::vector< Size > &numberCashFlowsThisStep, std::vector< std::vector< CashFlow > > &cashFlowsGenerated) override
return value indicates whether path is finished, TRUE means done
std::vector< Time > swaptionPaymentTimes_
std::vector< Time > forwardOptionPaymentTimes_
std::vector< ext::shared_ptr< StrikedTypePayoff > > swapPayOffs_
MultiStepPeriodCapletSwaptions(const std::vector< Time > &rateTimes, const std::vector< Time > &forwardOptionPaymentTimes, const std::vector< Time > &swaptionPaymentTimes, std::vector< ext::shared_ptr< StrikedTypePayoff > > forwardPayOffs, std::vector< ext::shared_ptr< StrikedTypePayoff > > swapPayOffs, Size period, Size offset)
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
Real Time
continuous quantity with 1-year units
std::size_t Size
size of a container
void checkIncreasingTimes(const std::vector< Time > ×)
check for strictly increasing times, first time greater than zero
Payoffs for various options.