29 ext::shared_ptr<HullWhite> model,
30 Time forwardMeasureTime)
31 : args_(args), model_(
std::move(model)), forwardMeasureTime_(forwardMeasureTime) {
35 Date referenceDate =
model_->termStructure()->referenceDate();
71 Rate ri_1, ri_2, currentLibor;
78 ri_2 = path[i-pastFixings+2];
83 ri_1 = path[i-pastFixings+1];
84 ri_2 = path[i-pastFixings+2];
87 model_->discountBond(fixing, start, ri_1);
89 model_->discountBond(fixing, end, ri_1);
90 currentLibor = (d1/d2-1)/tau;
94 1.0/
model_->discountBond(end, Tb, ri_2);
100 std::max(currentLibor - strike, 0.0) :
101 std::max(strike - currentLibor, 0.0);
Arguments for cap/floor calculation
std::vector< Time > accrualTimes
std::vector< Rate > forwards
std::vector< Date > startDates
std::vector< Real > gearings
std::vector< Rate > floorRates
std::vector< Real > nominals
std::vector< Date > endDates
std::vector< Rate > capRates
std::vector< Date > fixingDates
Time yearFraction(const Date &, const Date &, const Date &refPeriodStart=Date(), const Date &refPeriodEnd=Date()) const
Returns the period between two dates as a fraction of year.
single-factor random walk
DiscountFactor endDiscount_
ext::shared_ptr< HullWhite > model_
HullWhiteCapFloorPricer(const CapFloor::arguments &, ext::shared_ptr< HullWhite >, Time forwardMeasureTime)
CapFloor::arguments args_
std::vector< Time > endTimes_
std::vector< Time > fixingTimes_
Real operator()(const Path &path) const override
std::vector< Time > startTimes_
Real Time
continuous quantity with 1-year units
Real DiscountFactor
discount factor between dates
std::size_t Size
size of a container
ext::shared_ptr< QuantLib::Payoff > payoff
Monte Carlo Hull-White engine for cap/floors.