19#include <ql/math/interpolations/linearinterpolation.hpp>
25 const DayCounter& dc,
const std::vector<Time>& times,
26 const std::vector<Handle<Quote> >& blackVolCurve,
bool requireMonotoneVariance)
27 : BlackVarianceTermStructure(settlementDays, cal, bdc, dc), times_(times), quotes_(blackVolCurve),
28 requireMonotoneVariance_(requireMonotoneVariance) {
30 QL_REQUIRE(times.size() == blackVolCurve.size(),
"mismatch between date vector and black vol vector");
35 QL_REQUIRE(times[0] > 0,
"cannot have times[0] <= 0");
42 for (Size j = 1; j <
times_.size(); j++) {
43 QL_REQUIRE(
times_[j] >
times_[j - 1],
"times must be sorted unique!");
50 TermStructure::update();
55 for (Size j = 1; j <=
quotes_.size(); j++) {
59 "variance must be non-decreasing at j:" << j <<
" got var[j]:" <<
variances_[j]
Black volatility curve modeled as variance curve.
BlackVarianceCurve3(Natural settlementDays, const Calendar &cal, BusinessDayConvention bdc, const DayCounter &dc, const std::vector< Time > ×, const std::vector< Handle< Quote > > &blackVolCurve, bool requireMonotoneVariance=true)
void performCalculations() const override
std::vector< Real > variances_
std::vector< Time > times_
bool requireMonotoneVariance_
Interpolation varianceCurve_
std::vector< Handle< Quote > > quotes_
virtual Real blackVarianceImpl(Time t, Real) const override