Class LocalVolTermStructure
- Namespace
- NanoQL.TermStructures
- Assembly
- NanoQL.dll
The local-volatility term structure: the base of the structures that give the local volatility at a time and an underlying level. Volatilities are on an annual basis.
public abstract class LocalVolTermStructure : VolatilityTermStructure
- Inheritance
-
LocalVolTermStructure
- Derived
- Inherited Members
- Extension Methods
Remarks
An extension point, as in QuantLib: the local-volatility structures derive from it.
Constructors
LocalVolTermStructure(Date, Calendar?, BusinessDayConvention, DayCounter, int?)
Initializes a new instance of the LocalVolTermStructure class at a reference date; with settlement days, for a structure a factory dates by the context.
protected LocalVolTermStructure(Date referenceDate, Calendar? calendar, BusinessDayConvention bdc, DayCounter dayCounter, int? settlementDays = null)
Parameters
referenceDateDateThe reference date.
calendarCalendarThe calendar, or null for QuantLib's empty one.
bdcBusinessDayConventionThe business-day convention of the option dates; QuantLib's default is
Following.dayCounterDayCounterThe day counter.
settlementDaysint?The settlement days the reference date was moved by, or null.
Exceptions
- ArgumentNullException
dayCounteris null.- ArgumentException
The reference date is
default(Date).- ArgumentOutOfRangeException
bdcisn't a member of its type.
Methods
LocalVol(Date, double, bool)
The local volatility at a date and underlying level.
public double LocalVol(Date d, double underlyingLevel, bool extrapolate = false)
Parameters
dDateThe date.
underlyingLeveldoubleThe underlying level.
extrapolateboolWhether to allow extrapolation.
Returns
- double
The local volatility.
Exceptions
- ArgumentException
disdefault(Date).- NanoQLException
The date or level is out of range, or the structure can't compute it.
LocalVol(double, double, bool)
The local volatility at a time and underlying level.
public double LocalVol(double t, double underlyingLevel, bool extrapolate = false)
Parameters
tdoubleThe time.
underlyingLeveldoubleThe underlying level.
extrapolateboolWhether to allow extrapolation.
Returns
- double
The local volatility.
Exceptions
- NanoQLException
The time or level is out of range, or the structure can't compute it.
LocalVolImpl(double, double)
The local volatility at a time and level, the range already checked; it must extrapolate.
protected abstract double LocalVolImpl(double t, double strike)
Parameters
Returns
- double
The local volatility.