#include <qle/termstructures/spreadedoptionletvolatility2.hpp>
◆ SpreadedOptionletVolatility2()
SpreadedOptionletVolatility2 |
( |
const Handle< OptionletVolatilityStructure > & |
baseVol, |
|
|
const std::vector< Date > & |
optionDates, |
|
|
const std::vector< Real > & |
strikes, |
|
|
const std::vector< std::vector< Handle< Quote > > > & |
volSpreads |
|
) |
| |
Definition at line 27 of file spreadedoptionletvolatility2.cpp.
33
34 QL_REQUIRE(!
optionDates_.empty(),
"SpreadedOptionletVolatility2(): optionDates are empty");
35 QL_REQUIRE(!
strikes_.empty(),
"SpreadedOptionletVolatility2(): strikes are empty");
36
37
41 }
42
43
47 v.push_back(v.back());
48 }
49
53 for (auto const& q : v)
54 registerWith(q);
55}
std::vector< Date > optionDates_
std::vector< Real > strikes_
std::vector< Real > optionTimes_
Handle< OptionletVolatilityStructure > baseVol_
std::vector< std::vector< Handle< Quote > > > volSpreads_
◆ businessDayConvention()
BusinessDayConvention businessDayConvention |
( |
| ) |
const |
|
override |
◆ minStrike()
◆ maxStrike()
◆ dayCounter()
DayCounter dayCounter |
( |
| ) |
const |
|
override |
◆ maxDate()
◆ maxTime()
◆ referenceDate()
const Date & referenceDate |
( |
| ) |
const |
|
override |
◆ calendar()
Calendar calendar |
( |
| ) |
const |
|
override |
◆ settlementDays()
Natural settlementDays |
( |
| ) |
const |
|
override |
◆ volatilityType()
VolatilityType volatilityType |
( |
| ) |
const |
|
override |
◆ displacement()
Real displacement |
( |
| ) |
const |
|
override |
◆ update()
◆ deepUpdate()
◆ smileSectionImpl()
QuantLib::ext::shared_ptr< SmileSection > smileSectionImpl |
( |
Time |
optionTime | ) |
const |
|
overrideprotected |
Definition at line 71 of file spreadedoptionletvolatility2.cpp.
71 {
72 calculate();
73 std::vector<Real> volSpreads(
strikes_.size());
74 for (Size k = 0; k <
strikes_.size(); ++k) {
76 }
77 return QuantLib::ext::make_shared<SpreadedSmileSection2>(
baseVol_->smileSection(optionTime), volSpreads,
strikes_);
78}
Interpolation2D volSpreadInterpolation_
◆ volatilityImpl()
Volatility volatilityImpl |
( |
Time |
optionTime, |
|
|
Rate |
strike |
|
) |
| const |
|
overrideprotected |
◆ performCalculations()
void performCalculations |
( |
| ) |
const |
|
overrideprotected |
Definition at line 84 of file spreadedoptionletvolatility2.cpp.
84 {
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");
92 }
93 }
97}
◆ baseVol_
Handle<OptionletVolatilityStructure> baseVol_ |
|
private |
◆ optionDates_
std::vector<Date> optionDates_ |
|
private |
◆ strikes_
std::vector<Real> strikes_ |
|
private |
◆ volSpreads_
std::vector<std::vector<Handle<Quote> > > volSpreads_ |
|
private |
◆ optionTimes_
std::vector<Real> optionTimes_ |
|
mutableprivate |
◆ volSpreadValues_
◆ volSpreadInterpolation_
Interpolation2D volSpreadInterpolation_ |
|
mutableprivate |