Table of Contents

Class CPICapFloorTermPriceSurface

Namespace
NanoQL.Experimental
Assembly
NanoQL.dll

CPI cap and floor prices by maturity and strike, filled across all strikes by put-call parity: QuantLib's CPICapFloorTermPriceSurface.

[Experimental("NQL0001")]
public abstract class CPICapFloorTermPriceSurface : TermStructure
Inheritance
CPICapFloorTermPriceSurface
Derived
Inherited Members
Extension Methods

Remarks

A CPI cap or floor has one flow, on cumulative inflation to its maturity, so no stripping is needed, and the index's zero-inflation curve gives the at-the-money level. Strikes are quoted as yearly average inflation and become actual strikes as (1 + quote)^T, as zero-coupon inflation swaps quote; the observation lag is the quoted instruments'.

An extension point: InterpolatedCPICapFloorTermPriceSurface<TInterpolator2D> derives from it. QuantLib's surface follows the evaluation date (TermStructure(0, …)), so a derived class's factory computes the reference date and passes it in; AtmRate(Date, EvaluationContext) and Price(Date, double, EvaluationContext) read the index's fixings, from the context. The protected range checks, which QuantLib never calls, are kept; a price past the last maturity or strike extrapolates.

Constructors

CPICapFloorTermPriceSurface(Date, double, double, Period, Calendar, BusinessDayConvention, DayCounter, ZeroInflationIndex, CPIInterpolationType, YieldTermStructure, IReadOnlyList<double>, IReadOnlyList<double>, IReadOnlyList<Period>, Matrix, Matrix)

Initializes a new instance of the CPICapFloorTermPriceSurface class.

protected CPICapFloorTermPriceSurface(Date referenceDate, double nominal, double baseRate, Period observationLag, Calendar cal, BusinessDayConvention bdc, DayCounter dc, ZeroInflationIndex zii, CPIInterpolationType interpolationType, YieldTermStructure yts, IReadOnlyList<double> cStrikes, IReadOnlyList<double> fStrikes, IReadOnlyList<Period> cfMaturities, Matrix cPrice, Matrix fPrice)

Parameters

referenceDate Date

The reference date, the evaluation date adjusted.

nominal double

The prices' nominal.

baseRate double

The at-the-money rate at the reference date, where no inflation time has passed.

observationLag Period

The quoted instruments' observation lag.

cal Calendar

The calendar adjusting option dates.

bdc BusinessDayConvention

The convention adjusting option dates.

dc DayCounter

The day counter.

zii ZeroInflationIndex

The zero-inflation index, which must hold a zero-inflation curve.

interpolationType CPIInterpolationType

How the index is observed.

yts YieldTermStructure

The nominal curve.

cStrikes IReadOnlyList<double>

The cap strikes, quoted.

fStrikes IReadOnlyList<double>

The floor strikes, quoted.

cfMaturities IReadOnlyList<Period>

The maturities, increasing.

cPrice Matrix

The cap prices, a row per cap strike and a column per maturity.

fPrice Matrix

The floor prices, a row per floor strike and a column per maturity.

Exceptions

ArgumentNullException

An argument is null.

ArgumentOutOfRangeException

An enum argument isn't a member of its enum.

NanoQLException

The index has no zero-inflation curve, or the data are too few, mis-sized, non-positive or not monotonic, with QuantLib's texts.

Properties

BaseRate

Gets the at-the-money rate at the reference date.

public virtual double BaseRate { get; }

Property Value

double

BusinessDayConvention

Gets the convention adjusting option dates.

public virtual BusinessDayConvention BusinessDayConvention { get; }

Property Value

BusinessDayConvention

CapStrikes

Gets the cap strikes, quoted.

public virtual ImmutableArray<double> CapStrikes { get; }

Property Value

ImmutableArray<double>

FloorStrikes

Gets the floor strikes, quoted.

public virtual ImmutableArray<double> FloorStrikes { get; }

Property Value

ImmutableArray<double>

Frequency

Gets the index's frequency.

public virtual Frequency Frequency { get; }

Property Value

Frequency

InterpolationType

Gets how the index is observed.

protected CPIInterpolationType InterpolationType { get; }

Property Value

CPIInterpolationType

Maturities

Gets the maturities.

public virtual ImmutableArray<Period> Maturities { get; }

Property Value

ImmutableArray<Period>

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 maturity.

MaxStrike

Gets the highest strike.

public virtual double MaxStrike { get; }

Property Value

double

MinDate

Gets the earliest maturity's date, the reference date plus the first maturity.

public virtual Date MinDate { get; }

Property Value

Date

MinStrike

Gets the lowest strike.

public virtual double MinStrike { get; }

Property Value

double

Nominal

Gets the prices' nominal.

public virtual double Nominal { get; }

Property Value

double

NominalTermStructure

Gets the nominal curve.

protected YieldTermStructure NominalTermStructure { get; }

Property Value

YieldTermStructure

ObservationLag

Gets the quoted instruments' observation lag.

public virtual Period ObservationLag { get; }

Property Value

Period

Strikes

Gets the strikes, the floors' and the caps' above them, quoted.

public virtual ImmutableArray<double> Strikes { get; }

Property Value

ImmutableArray<double>

ZeroInflationIndex

Gets the zero-inflation index.

public ZeroInflationIndex ZeroInflationIndex { get; }

Property Value

ZeroInflationIndex

Methods

AtmRate(Date, EvaluationContext)

The at-the-money rate to a maturity: the index's lagged fixing growth from the reference date, as a yearly rate over its inflation time; the base rate where no time has passed.

public double AtmRate(Date maturity, EvaluationContext context)

Parameters

maturity Date

The maturity.

context EvaluationContext

The evaluation context, whose fixings the index reads.

Returns

double

The rate.

Exceptions

ArgumentNullException

context is null.

NanoQLException

A fixing can't be read or forecast.

BaseDate()

The base date: the index's zero-inflation curve's.

public virtual Date BaseDate()

Returns

Date

The date.

CapPrice(Date, double)

The cap price at a date and a quoted strike.

public abstract double CapPrice(Date d, double k)

Parameters

d Date

The date.

k double

The strike, quoted.

Returns

double

The price.

CapPrice(Period, double)

The cap price at a tenor and a quoted strike.

public virtual double CapPrice(Period d, double k)

Parameters

d Period

The tenor.

k double

The strike, quoted.

Returns

double

The price.

CapPrices()

The cap prices, a row per cap strike and a column per maturity.

public virtual Matrix CapPrices()

Returns

Matrix

A copy.

CheckMaturity(Date)

Whether a date lies within the surface's maturities: QuantLib's protected check, which nothing calls.

protected virtual bool CheckMaturity(Date d)

Parameters

d Date

The date.

Returns

bool

true when it does.

CheckStrike(double)

Whether a strike lies within the surface's strikes: QuantLib's protected check, which nothing calls.

protected virtual bool CheckStrike(double k)

Parameters

k double

The strike.

Returns

bool

true when it does.

CpiOptionDateFromTenor(Period)

The option date of a tenor: the reference date plus the tenor, adjusted.

public virtual Date CpiOptionDateFromTenor(Period p)

Parameters

p Period

The tenor.

Returns

Date

The date.

FloorPrice(Date, double)

The floor price at a date and a quoted strike.

public abstract double FloorPrice(Date d, double k)

Parameters

d Date

The date.

k double

The strike, quoted.

Returns

double

The price.

FloorPrice(Period, double)

The floor price at a tenor and a quoted strike.

public virtual double FloorPrice(Period d, double k)

Parameters

d Period

The tenor.

k double

The strike, quoted.

Returns

double

The price.

FloorPrices()

The floor prices, a row per floor strike and a column per maturity.

public virtual Matrix FloorPrices()

Returns

Matrix

A copy.

Price(Date, double, EvaluationContext)

The price at a date and a quoted strike, a cap's above the at-the-money rate and a floor's below.

public abstract double Price(Date d, double k, EvaluationContext context)

Parameters

d Date

The date.

k double

The strike, quoted.

context EvaluationContext

The evaluation context, whose fixings the at-the-money rate reads.

Returns

double

The price.

Price(Period, double, EvaluationContext)

The price at a tenor and a quoted strike, a cap's above the at-the-money rate and a floor's below.

public virtual double Price(Period d, double k, EvaluationContext context)

Parameters

d Period

The tenor.

k double

The strike, quoted.

context EvaluationContext

The evaluation context, whose fixings the at-the-money rate reads.

Returns

double

The price.