Class BlackVarianceCurve
- Namespace
- NanoQL.TermStructures
- Assembly
- NanoQL.dll
A Black volatility curve modelled as a variance curve: the market's at-the-money Black volatilities at a set of dates, interpolated on their variances, linearly by default. For strike dependence, see BlackVarianceSurface.
public sealed class BlackVarianceCurve : BlackVarianceTermStructure
- Inheritance
-
BlackVarianceCurve
- Inherited Members
- Extension Methods
Remarks
SetInterpolation<TInterpolator>(TInterpolator) returns a copy re-interpolated with another interpolator; the curve it is called on is unchanged, where QuantLib's re-interpolates the curve itself and notifies its observers.
Constructors
BlackVarianceCurve(Date, IEnumerable<Date>, IEnumerable<double>, DayCounter, bool, BlackVolTimeExtrapolationType)
Initializes a new instance of the BlackVarianceCurve class.
public BlackVarianceCurve(Date referenceDate, IEnumerable<Date> dates, IEnumerable<double> blackVolCurve, DayCounter dayCounter, bool forceMonotoneVariance = true, BlackVolTimeExtrapolationType timeExtrapolationType = BlackVolTimeExtrapolationType.FlatVolatility)
Parameters
referenceDateDateThe reference date.
datesIEnumerable<Date>The dates of the volatilities, after the reference date and sorted.
blackVolCurveIEnumerable<double>The at-the-money Black volatility at each date.
dayCounterDayCounterThe day counter.
forceMonotoneVarianceboolWhether the variances must be non-decreasing.
timeExtrapolationTypeBlackVolTimeExtrapolationTypeHow the curve extrapolates beyond its last date.
Remarks
QuantLib reads dates.back() of an empty list before its checks (blackvariancecurve.cpp:35), which
is undefined; nanoql refuses no dates first.
Exceptions
- ArgumentNullException
dates,blackVolCurveordayCounteris null.- ArgumentOutOfRangeException
timeExtrapolationTypeisn't a member of its type.- ArgumentException
No dates are given; the dates and volatilities differ in number; the first date isn't after the reference date; the dates aren't sorted and unique; or a forced monotone 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 curve whose variances are interpolated by another interpolator.
public BlackVarianceCurve SetInterpolation<TInterpolator>(TInterpolator interpolator = default) where TInterpolator : struct, IInterpolator
Parameters
interpolatorTInterpolatorThe interpolator's settings.
Returns
- BlackVarianceCurve
A new curve; this one is unchanged.
Type Parameters
TInterpolatorThe interpolator.
Exceptions
- ArgumentException
The interpolator can't interpolate the curve's points.