22#include <ql/math/interpolations/bilinearinterpolation.hpp>
23#include <ql/math/interpolations/flatextrapolation2d.hpp>
28 const std::vector<Date>& optionDates,
29 const std::vector<Real>&
strikes,
30 const std::vector<std::vector<Handle<Quote>>>& volSpreads)
31 : baseVol_(baseVol), optionDates_(optionDates), strikes_(
strikes), volSpreads_(volSpreads) {
34 QL_REQUIRE(!
optionDates_.empty(),
"SpreadedOptionletVolatility2(): optionDates are empty");
35 QL_REQUIRE(!
strikes_.empty(),
"SpreadedOptionletVolatility2(): strikes are empty");
47 v.push_back(v.back());
53 for (
auto const& q : v)
64 return baseVol_->businessDayConvention();
73 std::vector<Real> volSpreads(
strikes_.size());
74 for (Size k = 0; k <
strikes_.size(); ++k) {
77 return QuantLib::ext::make_shared<SpreadedSmileSection2>(
baseVol_->smileSection(optionTime), volSpreads,
strikes_);
87 for (Size k = 0; k <
strikes_.size(); ++k) {
89 QL_REQUIRE(!
volSpreads_[i][k].empty(),
"SpreadedOptionletVolatility2::performCalculations(): volSpread at "
90 << i <<
", " << k <<
" is empty");
100 OptionletVolatilityStructure::update();
101 LazyObject::update();
std::vector< Date > optionDates_
void performCalculations() const override
Calendar calendar() const override
Rate maxStrike() const override
Rate minStrike() const override
std::vector< Real > strikes_
void deepUpdate() override
SpreadedOptionletVolatility2(const Handle< OptionletVolatilityStructure > &baseVol, const std::vector< Date > &optionDates, const std::vector< Real > &strikes, const std::vector< std::vector< Handle< Quote > > > &volSpreads)
Volatility volatilityImpl(Time optionTime, Rate strike) const override
const Date & referenceDate() const override
Interpolation2D volSpreadInterpolation_
VolatilityType volatilityType() const override
std::vector< Real > optionTimes_
Handle< OptionletVolatilityStructure > baseVol_
Natural settlementDays() const override
DayCounter dayCounter() const override
Date maxDate() const override
std::vector< std::vector< Handle< Quote > > > volSpreads_
QuantLib::ext::shared_ptr< SmileSection > smileSectionImpl(Time optionTime) const override
BusinessDayConvention businessDayConvention() const override
Real displacement() const override
Time maxTime() const override
Optionlet volatility with overlayed bilinearly interpolated spread surface.
smile section with linear interpolated vol spreads