37 ext::shared_ptr<IborIndex> baseIndex,
38 ext::shared_ptr<IborIndex> targIndex,
39 ext::shared_ptr<CorrelationStructure> correlation)
42 baseVTS->businessDayConvention(),
43 baseVTS->dayCounter()),
44 baseVTS_(baseVTS), baseIndex_(
std::move(baseIndex)), targIndex_(
std::move(targIndex)),
47 "Base index frequency must be a multiple of target tenor frequency");
71 Time yfTarg = volTS.
targIndex_->dayCounter().yearFraction(effectiveDate, maturityDate);
72 for (
Size k = 0; k < baseFloatSchedule.
dates().size() - 1; ++k) {
73 Date startDate = baseFloatSchedule.
dates()[k];
77 baseFloatSchedule.
dates()[k], baseFloatSchedule.
dates()[k + 1]);
92 std::vector<Real> volBase(v_.size());
93 for (
Size k = 0; k < fraRateBase_.size(); ++k) {
94 Real strike_k = (strike - (fraRateTarg_ - sum_v * fraRateBase_[k])) / sum_v;
95 volBase[k] = baseSmileSection_[k]->volatility(strike_k,
Normal, 0.0);
98 for (
Size i = 0; i < volBase.size(); ++i) {
99 var += v_[i] * v_[i] * volBase[i] * volBase[i];
100 for (
Size j = i + 1; j < volBase.size(); ++j) {
101 Real corr = (*correlation_)(startTimeBase_[i], startTimeBase_[j]);
102 var += 2.0 * corr * v_[i] * v_[j] * volBase[i] * volBase[j];
105 Real vol = sqrt(var);
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.
Shared handle to an observable.
Optionlet (caplet/floorlet) volatility structure.
const std::vector< Date > & dates() const
interest rate volatility smile section
virtual const Date & exerciseDate() const
std::vector< ext::shared_ptr< SmileSection > > baseSmileSection_
Volatility volatilityImpl(Rate strike) const override
TenorOptionletSmileSection(const TenorOptionletVTS &volTS, Time optionTime)
std::vector< Real > fraRateBase_
std::vector< Time > startTimeBase_
TenorOptionletVTS(const Handle< OptionletVolatilityStructure > &baseVTS, ext::shared_ptr< IborIndex > baseIndex, ext::shared_ptr< IborIndex > targIndex, ext::shared_ptr< CorrelationStructure > correlation)
ext::shared_ptr< IborIndex > targIndex_
Handle< OptionletVolatilityStructure > baseVTS_
ext::shared_ptr< IborIndex > baseIndex_
virtual const Date & referenceDate() const
the date at which discount = 1.0 and/or variance = 0.0
virtual DayCounter dayCounter() const
the day counter used for date/time conversion
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
Option exercise classes and payoff function.
Real Time
continuous quantity with 1-year units
QL_BIG_INTEGER BigInteger
large integer number
Real Volatility
volatility
std::size_t Size
size of a container
base class for Inter-Bank-Offered-Rate indexes
caplet volatility term structure based on volatility transformation