Table of Contents

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

TInterpolator

The interpolator in time.

Inheritance
InterpolatedYoYOptionletVolatilityCurve<TInterpolator>
Implements
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

Date

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

settlementDays int

The business days from the evaluation date to the reference date.

cal Calendar

The calendar.

bdc BusinessDayConvention

The convention adjusting option dates computed from tenors.

dc DayCounter

The day counter.

lag Period

The observation lag.

frequency Frequency

The index's frequency.

indexIsInterpolated bool

Whether the index is observed with linear interpolation.

d IEnumerable<Date>

The volatilities' dates, increasing.

v IEnumerable<double>

The volatilities, one per date.

minStrike double

The lowest strike the curve gives volatilities for.

maxStrike double

The highest strike the curve gives volatilities for.

context EvaluationContext

The evaluation context, whose evaluation date the reference date follows.

i TInterpolator

The interpolator.

Returns

InterpolatedYoYOptionletVolatilityCurve<TInterpolator>

The curve.

Exceptions

ArgumentNullException

An argument is null.

ArgumentOutOfRangeException

settlementDays is 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

length double

The time.

strike double

The strike.

Returns

double

The volatility.

Remarks

The interpolation's value at the time, whatever the strike: the smile is flat.