30 const std::vector<Period>& optionTenors,
31 const std::vector<Period>& swapTenors,
32 const std::vector<Spread>& strikeSpreads,
34 ext::shared_ptr<SwapIndex> swapIndexBase,
35 ext::shared_ptr<SwapIndex> shortSwapIndexBase,
36 bool vegaWeightedSmileFit)
41 atmVol->businessDayConvention(),
42 atmVol->dayCounter()),
43 atmVol_(atmVol), nStrikes_(strikeSpreads.size()), strikeSpreads_(strikeSpreads),
44 localStrikes_(nStrikes_), localSmile_(nStrikes_), volSpreads_(
std::move(volSpreads)),
45 swapIndexBase_(
std::move(swapIndexBase)), shortSwapIndexBase_(
std::move(shortSwapIndexBase)),
46 vegaWeightedSmileFit_(vegaWeightedSmileFit) {
50 "non increasing strike spreads: " <<
57 "mismatch between number of option tenors * swap tenors (" <<
63 "mismatch between number of strikes (" <<
nStrikes_ <<
64 ") and number of columns (" <<
volSpreads_[i].size() <<
75 ") is not less or equal than index tenor (" <<
90 const Period& swapTenor)
const {
Shared handle to an observable.
Rate fixing(const Date &fixingDate, bool forecastTodaysFixing=false) const override
returns the fixing at the given date
std::pair< iterator, bool > registerWith(const ext::shared_ptr< Observable > &)
base class for swap-rate indexes
Rate atmStrike(const Date &optionDate, const Period &swapTenor) const
ext::shared_ptr< SwapIndex > swapIndexBase_
std::vector< Spread > strikeSpreads_
Handle< SwaptionVolatilityStructure > atmVol_
SwaptionVolatilityCube(const Handle< SwaptionVolatilityStructure > &atmVolStructure, const std::vector< Period > &optionTenors, const std::vector< Period > &swapTenors, const std::vector< Spread > &strikeSpreads, std::vector< std::vector< Handle< Quote > > > volSpreads, ext::shared_ptr< SwapIndex > swapIndexBase, ext::shared_ptr< SwapIndex > shortSwapIndexBase, bool vegaWeightedSmileFit)
ext::shared_ptr< SwapIndex > shortSwapIndexBase_
std::vector< std::vector< Handle< Quote > > > volSpreads_
void registerWithVolatilitySpread()
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
detail::ordinal_holder ordinal(Size)
outputs naturals as 1st, 2nd, 3rd...
std::size_t Size
size of a container
Swaption volatility cube.