43 bool extrapolate)
const {
46 date1 <<
" later than " << date2);
58 bool extrapolate)
const {
60 time1 <<
" later than " << time2);
65 Time epsilon = 1.0e-5;
67 return std::sqrt(var/epsilon);
69 Time epsilon = std::min<Time>(1.0e-5, time1);
73 "variances must be non-decreasing");
74 return std::sqrt((var2-var1)/(2*epsilon));
80 "variances must be non-decreasing");
81 return std::sqrt((var2-var1)/(time2-time1));
92 date1 <<
" later than " << date2);
104 bool extrapolate)
const {
106 time1 <<
" later than " << time2);
112 "variances must be non-decreasing");
Black volatility term structure base classes.
BlackVarianceTermStructure(BusinessDayConvention bdc=Following, const DayCounter &dc=DayCounter())
default constructor
Black-volatility term structure.
BlackVolTermStructure(BusinessDayConvention bdc=Following, const DayCounter &dc=DayCounter())
default constructor
virtual Real blackVarianceImpl(Time t, Real strike) const =0
Black variance calculation.
Real blackForwardVariance(const Date &date1, const Date &date2, Real strike, bool extrapolate=false) const
forward (at-the-money) variance
Volatility blackForwardVol(const Date &date1, const Date &date2, Real strike, bool extrapolate=false) const
forward (at-the-money) volatility
BlackVolatilityTermStructure(BusinessDayConvention bdc=Following, const DayCounter &dc=DayCounter())
default constructor
Time timeFromReference(const Date &date) const
date/time conversion
void checkRange(const Date &d, bool extrapolate) const
date-range check
Volatility term structure.
void checkStrike(Rate strike, bool extrapolate) const
strike-range check
#define QL_ENSURE(condition, message)
throw an error if the given post-condition is not verified
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
BusinessDayConvention
Business Day conventions.
Real Time
continuous quantity with 1-year units
unsigned QL_INTEGER Natural
positive integer
Real Volatility
volatility