23 const QuantLib::ext::shared_ptr<YoYOptionletVolatilitySurface>& source,
ReactionToTimeDecay decayMode)
24 : YoYOptionletVolatilitySurface(source->settlementDays(), source->calendar(), source->businessDayConvention(),
25 source->dayCounter(), source->observationLag(), source->frequency(),
26 source->indexIsInterpolated(), source->volatilityType(), source->displacement()),
27 source_(source), decayMode_(decayMode), originalReferenceDate_(source->referenceDate()) {
29 enableExtrapolation(source->allowsExtrapolation());
42 return Date(std::min(Date::maxDate().serialNumber(), referenceDate().serialNumber() -
44 source_->maxDate().serialNumber()));
47 QL_FAIL(
"unexpected decay mode (" <<
decayMode_ <<
")");
52 return source_->volatility(optionTime, strike);
57 "ForwardVariance not yet supported for DynamicYoYOptionletVolatilityStructure");
60 Real t0 = timeFromBase(referenceDate());
61 Volatility varToRef =
source_->volatility(t0, strike) *
source_->volatility(t0, strike) * t0;
62 Volatility varToOptTime =
63 source_->volatility(optionTime, strike) *
source_->volatility(optionTime, strike) * optionTime;
64 return std::sqrt((varToOptTime - varToRef) / (optionTime - t0));
67 QL_FAIL(
"Unexpected decay mode (" <<
decayMode_ <<
")");
Rate maxStrike() const override
Rate minStrike() const override
Volatility volatilityImpl(Time optionTime, Rate strike) const override
DynamicYoYOptionletVolatilitySurface(const QuantLib::ext::shared_ptr< YoYOptionletVolatilitySurface > &source, ReactionToTimeDecay decayMode=ConstantVariance)
ReactionToTimeDecay decayMode_
const QuantLib::ext::shared_ptr< YoYOptionletVolatilitySurface > source_
Date maxDate() const override
const Date originalReferenceDate_
dynamic yoy inflation optionlet volatility structure
ReactionToTimeDecay
Reaction to Time Decay.