28 const std::vector<Date>& dates,
29 const std::vector<Volatility>& blackVolCurve,
31 bool forceMonotoneVariance)
33 maxDate_(dates.back()) {
36 "mismatch between date vector and black vol vector");
42 "cannot have dates[0] <= referenceDate");
44 variances_ = std::vector<Real>(dates.size()+1);
45 times_ = std::vector<Time>(dates.size()+1);
49 for (j=1; j<=blackVolCurve.size(); j++) {
52 "dates must be sorted unique!");
54 blackVolCurve[j-1]*blackVolCurve[j-1];
56 || !forceMonotoneVariance,
57 "variance must be non-decreasing");
61 setInterpolation<Linear>();
Black volatility curve modelled as variance curve.
BlackVarianceCurve(const Date &referenceDate, const std::vector< Date > &dates, const std::vector< Volatility > &blackVolCurve, DayCounter dayCounter, bool forceMonotoneVariance=true)
std::vector< Real > variances_
std::vector< Time > times_
Interpolation varianceCurve_
Real blackVarianceImpl(Time t, Real) const override
Black variance calculation.
Black variance term structure.
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
Real Time
continuous quantity with 1-year units
std::size_t Size
size of a container
linear interpolation between discrete points