29 const Period& observationLag,
31 bool indexIsInterpolated)
34 frequency_(frequency), indexIsInterpolated_(indexIsInterpolated)
53 bool extrapolate)
const {
55 "date (" <<
d <<
") is before base date");
57 "date (" <<
d <<
") is past max curve date ("
61 "strike (" << strike <<
") is outside the curve domain ["
67 bool extrapolate)
const {
69 "time (" <<
t <<
") is before base date");
71 "time (" <<
t <<
") is past max curve time ("
75 "strike (" << strike <<
") is outside the curve domain ["
83 bool extrapolate)
const {
91 checkRange(maturityDate-useLag, strike, extrapolate);
95 std::pair<Date,Date> dd =
107 bool extrapolate)
const {
109 return volatility(maturityDate, strike, obsLag, extrapolate);
118 const Period& obsLag)
const {
126 useDate = maturityDate - useLag;
142 bool extrapolate)
const {
Real minStrike() const override=0
the minimum strike for which the term structure can return vols
virtual Volatility volatilityImpl(Time length, Rate strike) const =0
virtual Time timeFromBase(const Date &date, const Period &obsLag=Period(-1, Days)) const
base date will be in the past because of observation lag
virtual Period observationLag() const
virtual bool indexIsInterpolated() const
CPIVolatilitySurface(Natural settlementDays, const Calendar &, BusinessDayConvention bdc, const DayCounter &dc, const Period &observationLag, Frequency frequency, bool indexIsInterpolated)
virtual Date baseDate() const
virtual Frequency frequency() const
virtual void checkRange(const Date &, Rate strike, bool extrapolate) const
virtual Volatility totalVariance(const Date &exerciseDate, Rate strike, const Period &obsLag=Period(-1, Days), bool extrapolate=false) const
Real maxStrike() const override=0
the maximum strike for which the term structure can return vols
Volatility volatility(const Date &maturityDate, Rate strike, const Period &obsLag=Period(-1, Days), bool extrapolate=false) const
Returns the volatility for a given maturity date and strike rate.
Time yearFraction(const Date &, const Date &, const Date &refPeriodStart=Date(), const Date &refPeriodEnd=Date()) const
Returns the period between two dates as a fraction of year.
template class providing a null value for a given type.
virtual const Date & referenceDate() const
the date at which discount = 1.0 and/or variance = 0.0
virtual Time maxTime() const
the latest time for which the curve can return values
virtual Date maxDate() const =0
the latest date for which the curve can return values
Time timeFromReference(const Date &date) const
date/time conversion
virtual DayCounter dayCounter() const
the day counter used for date/time conversion
Volatility term structure.
Date optionDateFromTenor(const Period &) const
period/date conversion
zero inflation (i.e. CPI/RPI/HICP/etc.) volatility structures
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
Frequency
Frequency of events.
BusinessDayConvention
Business Day conventions.
Real Time
continuous quantity with 1-year units
unsigned QL_INTEGER Natural
positive integer
Real Volatility
volatility
Base classes for inflation term structures.
std::pair< Date, Date > inflationPeriod(const Date &d, Frequency frequency)
utility function giving the inflation period for a given date