27 const Date& referenceDate,
29 const std::vector<Date>& dates,
30 std::vector<Real> strikes,
36 maxDate_(dates.back()), volatilities_(volatilities), strikes_(
std::move(strikes)),
37 lowerExtrapolation_(lowerEx), upperExtrapolation_(upperEx) {
40 "size mismatch between date vector and vol matrix columns "
41 "and/or between money-strike vector and vol matrix rows");
44 "cannot have dates_[0] <= referenceDate_");
47 times_ = std::vector<Time>(dates.size()+1);
50 for (
Size j=1; j<=dates.size(); j++) {
53 "dates must be sorted unique");
59 setInterpolation<Bilinear>();
75 "variance must be non-decreasing");
89 if (
t==0.0)
return 0.0;
bilinear interpolation between discrete points
Black variance term structure.
Extrapolation upperExtrapolation_
std::vector< Real > strikes_
const std::vector< Handle< Quote > > & volatilities_
std::vector< Time > times_
ExtendedBlackVarianceSurface(const Date &referenceDate, const Calendar &calendar, const std::vector< Date > &dates, std::vector< Real > strikes, const std::vector< Handle< Quote > > &volatilities, DayCounter dayCounter, Extrapolation lowerExtrapolation=InterpolatorDefaultExtrapolation, Extrapolation upperExtrapolation=InterpolatorDefaultExtrapolation)
Interpolation2D varianceSurface_
Real blackVarianceImpl(Time t, Real strike) const override
Black variance calculation.
Extrapolation lowerExtrapolation_
Shared handle to an observable.
Matrix used in linear algebra.
std::pair< iterator, bool > registerWith(const ext::shared_ptr< Observable > &)
virtual const Date & referenceDate() const
the date at which discount = 1.0 and/or variance = 0.0
Time timeFromReference(const Date &date) const
date/time conversion
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
Black volatility surface modelled as variance surface.
Real Time
continuous quantity with 1-year units
Real Volatility
volatility
std::size_t Size
size of a container