Class ExtendedBlackVarianceSurface
- Namespace
- NanoQL.Experimental
- Assembly
- NanoQL.dll
A Black variance surface on volatilities at dates and strikes: the variance interpolated in time and strike (bilinearly by default) up to the last date, the last date's volatility flat beyond it. QuantLib's extension of BlackVarianceSurface to quoted volatilities.
[Experimental("NQL0001")]
public sealed class ExtendedBlackVarianceSurface : BlackVarianceTermStructure
- Inheritance
-
ExtendedBlackVarianceSurface
- Inherited Members
- Extension Methods
Remarks
Quotes are values (the playbook's Quote row), given strike by strike, each strike's at every date, as QuantLib
lays out its quotes; the surface is computed at construction and QuantLib's update() isn't ported.
SetInterpolation<TInterpolator>(TInterpolator) returns a copy on the new interpolation, where QuantLib changes the
surface. Unlike the landed surface, QuantLib's experimental one doesn't floor the interpolated variance at 0, and its
first date must be after the reference date. QuantLib holds a reference to its caller's quotes, which the values
replace. QuantLib's acyclic visitor isn't ported.
Constructors
ExtendedBlackVarianceSurface(Date, Calendar?, IEnumerable<Date>, IEnumerable<double>, IEnumerable<double>, DayCounter, ExtendedBlackVarianceSurfaceExtrapolation, ExtendedBlackVarianceSurfaceExtrapolation)
Initializes a new instance of the ExtendedBlackVarianceSurface class.
public ExtendedBlackVarianceSurface(Date referenceDate, Calendar? calendar, IEnumerable<Date> dates, IEnumerable<double> strikes, IEnumerable<double> volatilities, DayCounter dayCounter, ExtendedBlackVarianceSurfaceExtrapolation lowerExtrapolation = ExtendedBlackVarianceSurfaceExtrapolation.InterpolatorDefaultExtrapolation, ExtendedBlackVarianceSurfaceExtrapolation upperExtrapolation = ExtendedBlackVarianceSurfaceExtrapolation.InterpolatorDefaultExtrapolation)
Parameters
referenceDateDateThe reference date.
calendarCalendarThe calendar, or null for QuantLib's empty one.
datesIEnumerable<Date>The dates, after the reference date and increasing.
strikesIEnumerable<double>The strikes, increasing.
volatilitiesIEnumerable<double>The volatilities, strike by strike, each strike's at every date.
dayCounterDayCounterThe day counter.
lowerExtrapolationExtendedBlackVarianceSurfaceExtrapolationHow the surface extrapolates below its lowest strike.
upperExtrapolationExtendedBlackVarianceSurfaceExtrapolationHow the surface extrapolates above its highest strike.
Exceptions
- ArgumentNullException
An argument is null.
- ArgumentOutOfRangeException
An extrapolation isn't a member of its type.
- ArgumentException
A date is
default(Date), there are no dates, the sizes differ, the first date isn't after the reference date, the dates aren't increasing, or a strike's variance decreases.
Properties
MaxDate
Gets the latest date for which the curve can return values.
public override Date MaxDate { get; }
Property Value
Methods
BlackVarianceImpl(double, double)
The variance at a time and strike, the range already checked; it must extrapolate.
protected override double BlackVarianceImpl(double t, double strike)
Parameters
Returns
- double
The variance.
MaxStrike()
The maximum strike for which the structure returns values.
public override double MaxStrike()
Returns
- double
The strike.
MinStrike()
The minimum strike for which the structure returns values.
public override double MinStrike()
Returns
- double
The strike.
SetInterpolation<TInterpolator>(TInterpolator)
A copy of the surface interpolating its variances with another interpolator.
public ExtendedBlackVarianceSurface SetInterpolation<TInterpolator>(TInterpolator interpolator = default) where TInterpolator : struct, IInterpolator2D
Parameters
interpolatorTInterpolatorThe interpolator.
Returns
- ExtendedBlackVarianceSurface
The copy.
Type Parameters
TInterpolatorThe interpolator's type.