32 const std::vector<Period>& optionTenors,
33 std::vector<Spread> atmRateSpreads,
36 optionTimes_(optionTenors.size()), optionDates_(optionTenors.size()),
37 atmRateSpreads_(
std::move(atmRateSpreads)), volSpreads_(
std::move(volSpreads)) {
92 std::vector<Volatility> interpolatedVols(nAtmRateSpreads);
94 std::vector<Volatility> vols(nOptionsTimes);
95 for (
Size i=0; i<nAtmRateSpreads; ++i) {
96 for (
Size j=0; j<nOptionsTimes; ++j) {
103 return interpolatedVols;
117 ext::shared_ptr<SmileSection>
128 ext::shared_ptr<SabrInterpolatedSmileSection> tmp(
new
132 sabrParameters1[0], sabrParameters1[1],
133 sabrParameters1[2], sabrParameters1[3],
159 QL_REQUIRE(nStrikes>1,
"too few strikes (" << nStrikes <<
")");
160 for (
Size i=1; i<nStrikes; ++i)
162 "non increasing strike spreads: " <<
168 ") and number of columns (" <<
volSpreads_[i].size() <<
degenerate base class for the Acyclic Visitor pattern
Shared handle to an observable.
Interest rate volatility (smile) surface.
ext::shared_ptr< InterestRateIndex > index_
void accept(AcyclicVisitor &) override
Date optionDateFromTenor(const Period &) const
period/date conversion
Linear interpolation between discrete points
std::pair< iterator, bool > registerWith(const ext::shared_ptr< Observable > &)
std::vector< Date > optionDates_
void registerWithMarketData()
Handle< BlackAtmVolCurve > atmCurve_
std::vector< std::array< Real, 4 > > sabrGuesses_
std::array< Real, 4 > sabrGuesses(const Date &) const
const Date & referenceDate() const override
the date at which discount = 1.0 and/or variance = 0.0
void accept(AcyclicVisitor &) override
std::vector< Volatility > volatilitySpreads(const Period &) const
std::vector< Time > optionTimes_
std::vector< Spread > atmRateSpreads_
SabrVolSurface(const ext::shared_ptr< InterestRateIndex > &, Handle< BlackAtmVolCurve >, const std::vector< Period > &optionTenors, std::vector< Spread > atmRateSpreads, std::vector< std::vector< Handle< Quote > > > volSpreads)
std::vector< Period > optionTenors_
std::vector< std::vector< Handle< Quote > > > volSpreads_
ext::shared_ptr< SmileSection > smileSectionImpl(Time) const override
void updateSabrGuesses(const Date &d, std::array< Real, 4 > newGuesses) const
Time timeFromReference(const Date &date) const
date/time conversion
Visitor for a specific class
virtual void visit(T &)=0
#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...
Real Time
continuous quantity with 1-year units
QL_BIG_INTEGER BigInteger
large integer number
std::size_t Size
size of a container
linear interpolation between discrete points
ext::shared_ptr< BlackVolTermStructure > v
SABR interpolation interpolation between discrete points.
SABR volatility (smile) surface.
Smile section base class.