Table of Contents

Class InterpolatedZeroInflationCurve<TInterpolator>

Namespace
NanoQL.TermStructures
Assembly
NanoQL.dll

An inflation term structure interpolating zero-coupon inflation rates.

public class InterpolatedZeroInflationCurve<TInterpolator> : ZeroInflationTermStructure, IInterpolatedCurve<ZeroInflationTraits, TInterpolator> where TInterpolator : struct, IInterpolator

Type Parameters

TInterpolator

The interpolator.

Inheritance
InterpolatedZeroInflationCurve<TInterpolator>
Implements
Derived
Inherited Members
Extension Methods

Remarks

The first date is the base date. A rate is the interpolation's value at the start of the date's inflation period, extrapolated, with the seasonality's correction. The curve implements IInterpolatedCurve<TTraits, TInterpolator> over ZeroInflationTraits, as the piecewise zero-inflation curve does.

QuantLib's protected constructor without nodes, through which its piecewise curve derives, isn't ported: the piecewise curve implements the interface itself. An extension point, for its named class.

QuantLib reads the first date before it checks how many there are, so with no date it throws std::out_of_range; here an empty list is refused at that point with QuantLib's own "too few dates", the playbook's convention for such an exception.

Constructors

InterpolatedZeroInflationCurve(Date, IEnumerable<Date>, IEnumerable<double>, Frequency, DayCounter, Seasonality?, TInterpolator)

Initializes a new instance of the InterpolatedZeroInflationCurve<TInterpolator> class.

public InterpolatedZeroInflationCurve(Date referenceDate, IEnumerable<Date> dates, IEnumerable<double> rates, Frequency frequency, DayCounter dayCounter, Seasonality? seasonality = null, TInterpolator interpolator = default)

Parameters

referenceDate Date

The reference date.

dates IEnumerable<Date>

The nodes' dates, sorted, the first one the base date.

rates IEnumerable<double>

The zero-coupon inflation rates at the nodes, one per date.

frequency Frequency

The frequency of the index the curve forecasts.

dayCounter DayCounter

The day counter.

seasonality Seasonality

The seasonality, or null for none.

interpolator TInterpolator

The interpolator.

Exceptions

ArgumentNullException

dates, rates or dayCounter is null.

ArgumentException

There are fewer than two dates, a date is default(Date), the rates aren't one per date, a rate after the first isn't above -100%, the dates aren't sorted or two give the same time, or the interpolation refuses the points.

ArgumentOutOfRangeException

frequency isn't a member of its type.

NanoQLException

The seasonality is inconsistent with the curve.

Properties

MaxDate

Gets the latest date for which the curve can return values.

public override sealed Date MaxDate { get; }

Property Value

Date

Methods

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.

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.

Rates()

The zero-coupon inflation rates at the nodes.

public ImmutableArray<double> Rates()

Returns

ImmutableArray<double>

The rates.

Times()

The times of the curve's nodes, from the reference date.

public ImmutableArray<double> Times()

Returns

ImmutableArray<double>

The times.

ZeroRateImpl(double)

The zero-coupon inflation rate at a time, which a derived structure computes.

protected override sealed double ZeroRateImpl(double t)

Parameters

t double

The time.

Returns

double

The rate.