#include <qle/termstructures/spreadedsmilesection2.hpp>
|
| 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) |
|
Rate | minStrike () const override |
|
Rate | maxStrike () const override |
|
Rate | atmLevel () const override |
|
Definition at line 35 of file spreadedsmilesection2.hpp.
◆ SpreadedSmileSection2()
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 |
|
) |
| |
- If stickyAbsMoney = true or if strikes are relative to atm and more than one strike is giv en, the base smile section must provide an ATM level that does not react to changes in the rate levels. Alternatively, baseAtmLevel can be provided.
- If stickyAbsMoney = true, simulatedAtmLevel must be provided and represent the ATM level that does react to changes in the rate levels.
Definition at line 27 of file spreadedsmilesection2.cpp.
31 : SmileSection(base->exerciseTime(), base->dayCounter(), base->volatilityType(),
32 base->volatilityType() == ShiftedLognormal ? base->shift() : 0.0),
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.");
44 }
45 if (stickyAbsMoney) {
47 "SpreadedSmileSection2: if stickyAbsMoney is true, the simulatedAtmLevel must be given");
48 }
52 }
53}
std::vector< Real > strikes_
Interpolation volSpreadInterpolation_
std::vector< Real > volSpreads_
QuantLib::ext::shared_ptr< SmileSection > base_
bool strikesRelativeToAtm_
◆ minStrike()
◆ maxStrike()
◆ atmLevel()
◆ volatilityImpl()
Volatility volatilityImpl |
( |
Rate |
strike | ) |
const |
|
overrideprotected |
Definition at line 61 of file spreadedsmilesection2.cpp.
61 {
62 Real effStrike;
65 } else {
66 effStrike = strike;
67 }
72 QL_REQUIRE(f != Null<Real>(), "SpreadedSmileSection2: atm level required");
74 } else {
76 }
77}
Rate atmLevel() const override
◆ base_
QuantLib::ext::shared_ptr<SmileSection> base_ |
|
private |
◆ volSpreads_
std::vector<Real> volSpreads_ |
|
private |
◆ strikes_
std::vector<Real> strikes_ |
|
private |
◆ strikesRelativeToAtm_
bool strikesRelativeToAtm_ |
|
private |
◆ baseAtmLevel_
◆ simulatedAtmLevel_
◆ stickyAbsMoney_
◆ volSpreadInterpolation_
Interpolation volSpreadInterpolation_ |
|
private |