22#include <ql/math/interpolations/linearinterpolation.hpp>
23#include <ql/termstructures/volatility/interpolatedsmilesection.hpp>
26#include <boost/make_shared.hpp>
34 const bool flatExtrapolation)
35 : OptionletVolatilityStructure(s->referenceDate(), s->calendar(), s->businessDayConvention(), s->dayCounter()),
36 optionletStripper_(s), nInterpolations_(s->optionletMaturities()), strikeInterpolations_(nInterpolations_),
37 flatExtrapolation_(flatExtrapolation) {
49 vector<Real> stdDevs(optionletStrikes.size());
51 for (Size i = 0; i < optionletStrikes.size(); ++i) {
58 return QuantLib::ext::make_shared<InterpolatedSmileSection<LinearFlat> >(t, optionletStrikes, stdDevs, Null<Real>(),
62 return QuantLib::ext::make_shared<InterpolatedSmileSection<Linear> >(
74 QuantLib::ext::shared_ptr<LinearInterpolation> timeInterpolator =
75 QuantLib::ext::make_shared<LinearInterpolation>(optionletTimes.begin(), optionletTimes.end(), vol.begin());
79 return timeInterpolator->operator()(lengthEff,
true);
85 const vector<Volatility>& optionletVolatilities =
optionletStripper_->optionletVolatilities(i);
86 QuantLib::ext::shared_ptr<Interpolation> tmp = QuantLib::ext::make_shared<LinearInterpolation>(
87 optionletStrikes.begin(), optionletStrikes.end(), optionletVolatilities.begin());
void performCalculations() const override
Rate maxStrike() const override
Rate minStrike() const override
VolatilityType volatilityType() const override
const QuantLib::ext::shared_ptr< DatedStrippedOptionletBase > optionletStripper_
Volatility volatilityImpl(Time length, Rate strike) const override
Date maxDate() const override
vector< QuantLib::ext::shared_ptr< Interpolation > > strikeInterpolations_
QuantLib::ext::shared_ptr< SmileSection > smileSectionImpl(Time optionTime) const override
Real displacement() const override
DatedStrippedOptionletAdapter(const QuantLib::ext::shared_ptr< DatedStrippedOptionletBase > &s, const bool flatExtrapolation)
Linear-interpolation and flat extrapolation factory and traits
StrippedOptionlet Adapter.
RandomVariable sqrt(RandomVariable x)
CompiledFormula min(CompiledFormula x, const CompiledFormula &y)
CompiledFormula max(CompiledFormula x, const CompiledFormula &y)