Class InterpolatedYoYOptionletVolatilityCurve<TInterpolator>
- Namespace
- NanoQL.Experimental
- Assembly
- NanoQL.dll
A year-on-year optionlet volatility interpolated in time and flat in strike: QuantLib's
InterpolatedYoYOptionletVolatilityCurve.
[Experimental("NQL0001")]
public class InterpolatedYoYOptionletVolatilityCurve<TInterpolator> : YoYOptionletVolatilitySurface, IInterpolatedCurve<YoYInflationVolatilityTraits, TInterpolator> where TInterpolator : struct, IInterpolator
Type Parameters
TInterpolatorThe interpolator in time.
- Inheritance
-
InterpolatedYoYOptionletVolatilityCurve<TInterpolator>
- Implements
-
IInterpolatedCurve<YoYInflationVolatilityTraits, TInterpolator>
- Derived
- Inherited Members
- Extension Methods
Remarks
The dates are the volatilities' own, with no lag, measured from the reference date, so the first is usually the
base date, before it. The base level is the interpolation's value at the base date, extrapolated. A volatility past
the last date or before the first refuses, as QuantLib's interpolation, which doesn't enable extrapolation. The
last date is the reference date plus the last time rounded up to whole years, adjusted, QuantLib's own
approximation (its FIXME).
QuantLib's protected constructor without nodes, through which its piecewise curve derives, isn't ported: PiecewiseYoYOptionletVolatilityCurve<TInterpolator, TBootstrap, TTraits> implements IInterpolatedCurve<TTraits, TInterpolator> itself, as the piecewise year-on-year inflation curve does. Its nodes come from its dates and data, QuantLib's master's (#2941), where 1.44's are a list only this constructor fills.
Properties
Interpolator
Gets the interpolator the curve was built with.
public TInterpolator Interpolator { get; }
Property Value
- TInterpolator
MaxDate
Gets the latest date for which the curve can return values.
public override Date MaxDate { get; }
Property Value
Remarks
The reference date plus the last time rounded up to whole years, as an option tenor.
Methods
Create(int, Calendar, BusinessDayConvention, DayCounter, Period, Frequency, bool, IEnumerable<Date>, IEnumerable<double>, double, double, EvaluationContext, TInterpolator)
Builds the curve on the reference date the settlement days give after the evaluation date.
public static InterpolatedYoYOptionletVolatilityCurve<TInterpolator> Create(int settlementDays, Calendar cal, BusinessDayConvention bdc, DayCounter dc, Period lag, Frequency frequency, bool indexIsInterpolated, IEnumerable<Date> d, IEnumerable<double> v, double minStrike, double maxStrike, EvaluationContext context, TInterpolator i = default)
Parameters
settlementDaysintThe business days from the evaluation date to the reference date.
calCalendarThe calendar.
bdcBusinessDayConventionThe convention adjusting option dates computed from tenors.
dcDayCounterThe day counter.
lagPeriodThe observation lag.
frequencyFrequencyThe index's frequency.
indexIsInterpolatedboolWhether the index is observed with linear interpolation.
dIEnumerable<Date>The volatilities' dates, increasing.
vIEnumerable<double>The volatilities, one per date.
minStrikedoubleThe lowest strike the curve gives volatilities for.
maxStrikedoubleThe highest strike the curve gives volatilities for.
contextEvaluationContextThe evaluation context, whose evaluation date the reference date follows.
iTInterpolatorThe interpolator.
Returns
- InterpolatedYoYOptionletVolatilityCurve<TInterpolator>
The curve.
Exceptions
- ArgumentNullException
An argument is null.
- ArgumentOutOfRangeException
settlementDaysis negative, or an enum argument isn't a member of its type.- NanoQLException
The dates and volatilities differ in number or are fewer than two, with QuantLib's texts, or the interpolation refuses them.
Data()
The curve's data at its nodes, as its traits read them (discount factors, rates).
public ImmutableArray<double> Data()
Returns
- ImmutableArray<double>
The data.
Dates()
The dates of the curve's nodes.
public ImmutableArray<Date> Dates()
Returns
- ImmutableArray<Date>
The dates.
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.
Nodes()
The curve's nodes: each date with the data at it.
public ImmutableArray<KeyValuePair<Date, double>> Nodes()
Returns
- ImmutableArray<KeyValuePair<Date, double>>
The nodes.
Remarks
From the dates and data, QuantLib's master's (#2941).
Times()
The times of the curve's nodes, from the reference date.
public ImmutableArray<double> Times()
Returns
- ImmutableArray<double>
The times.
VolatilityImpl(double, double)
The volatility at a time and a strike, which a derived structure computes.
protected override double VolatilityImpl(double length, double strike)
Parameters
Returns
- double
The volatility.
Remarks
The interpolation's value at the time, whatever the strike: the smile is flat.