45 {
46
47
48
49
50
51
52
53 Date numFixingDate = coupon_->fixingDate();
54
55
56 Date denFixingDate = numFixingDate - 1 * Years;
57
58
59
60 Date today = Settings::instance().evaluationDate();
61 const auto& index = coupon_->yoyIndex();
62 auto freq = index->frequency();
63 auto ip = inflationPeriod(today - index->availabilityLag(), freq);
64 bool isInterp = index->interpolated();
65 if ((!isInterp && denFixingDate < ip.first) || (isInterp && denFixingDate < ip.first - Period(freq))) {
66 return coupon_->indexFixing();
67 }
68
69
70 auto zts =
model_->infjy(
index_)->realRate()->termStructure();
71 auto S =
inflationTime(denFixingDate, *zts, index->interpolated());
72 auto T =
inflationTime(numFixingDate, *zts, index->interpolated());
73
75}
Real jyExpectedIndexRatio(const QuantLib::ext::shared_ptr< CrossAssetModel > &model, Size index, Time S, Time T, bool indexIsInterpolated)
Time inflationTime(const Date &date, const QuantLib::ext::shared_ptr< InflationTermStructure > &inflationTs, bool indexIsInterpolated, const DayCounter &dayCounter)