28 const std::vector<Real>& volSpreads,
const std::vector<Real>&
strikes,
29 const bool strikesRelativeToAtm,
const Real baseAtmLevel,
30 const Real simulatedAtmLevel,
const bool stickyAbsMoney)
31 : SmileSection(base->exerciseTime(), base->dayCounter(), base->volatilityType(),
32 base->volatilityType() == ShiftedLognormal ? base->shift() : 0.0),
33 base_(base), volSpreads_(volSpreads), strikes_(
strikes), strikesRelativeToAtm_(strikesRelativeToAtm),
34 baseAtmLevel_(baseAtmLevel), simulatedAtmLevel_(simulatedAtmLevel), stickyAbsMoney_(stickyAbsMoney) {
36 QL_REQUIRE(!
strikes_.empty(),
"SpreadedSmileSection2: strikes empty");
38 <<
strikes_.size() <<
") inconsistent with vol spreads ("
42 "SpreadedSmileSection2: if strikeRelativeToATM is true and more than one strike is given, or if "
43 "stickyAbsMoney is true, the base atm level must be given.");
47 "SpreadedSmileSection2: if stickyAbsMoney is true, the simulatedAtmLevel must be given");
72 QL_REQUIRE(f != Null<Real>(),
"SpreadedSmileSection2: atm level required");
Linear-interpolation and flat extrapolation factory and traits
Interpolation interpolate(const I1 &xBegin, const I1 &xEnd, const I2 &yBegin) const
Rate atmLevel() const override
Rate maxStrike() const override
Rate minStrike() const override
std::vector< Real > strikes_
SpreadedSmileSection2(const QuantLib::ext::shared_ptr< SmileSection > &base, const std::vector< Real > &volSpreads, const std::vector< Real > &strikes, const bool strikesRelativeToAtm=false, const Real baseAtmLevel=Null< Real >(), const Real simulatedAtmLevel=Null< Real >(), const bool stickyAbsMoney=false)
Volatility volatilityImpl(Rate strike) const override
Interpolation volSpreadInterpolation_
std::vector< Real > volSpreads_
QuantLib::ext::shared_ptr< SmileSection > base_
bool strikesRelativeToAtm_
smile section with linear interpolated vol spreads