Table of Contents

Class EvolutionDescriptionFunctions

Namespace
NanoQL.Models
Assembly
NanoQL.dll

The numeraire functions of an evolution: the measures and the numeraires' checks.

public static class EvolutionDescriptionFunctions
Inheritance
EvolutionDescriptionFunctions
Inherited Members

Methods

CheckCompatibility(EvolutionDescription, ReadOnlySpan<int>)

Checks that there is one numeraire for each evolution time, and that each step's numeraire bond hasn't expired at the step's end, as QuantLib checks: at every step but the last.

public static void CheckCompatibility(EvolutionDescription evolution, ReadOnlySpan<int> numeraires)

Parameters

evolution EvolutionDescription

The evolution.

numeraires ReadOnlySpan<int>

The numeraires, one per step, each the index of a rate time.

Remarks

QuantLib's loop stops before the last step, so a last step's numeraire may mature inside that step, which its documentation's contract ("each numeraire must not have expired before the end of the step") excludes. It is kept: the models cut each forward's covariance at its own fixing, so the drifts under such a numeraire are those under the bond rolled into the next at its maturity, and the curve state's discount ratio to the matured bond reads its frozen forward, the rolled position's value, which prices correctly (bonds stay martingales and caplets within their Monte Carlo errors of Black's).

A numeraire past the rate times at a step QuantLib checks is read past its vector, and refused (Divergences/MarketModelUndefinedReadsTests.cs); the last step's numeraire isn't read here, as in QuantLib.

Exceptions

ArgumentException

The numeraires aren't one per step, or a step's numeraire before the last has expired before the step's end.

ArgumentOutOfRangeException

A numeraire QuantLib reads isn't the index of a rate time.

IsInMoneyMarketMeasure(EvolutionDescription, ReadOnlySpan<int>)

Whether numeraires are the money-market measure's: at each step the first unexpired bond.

public static bool IsInMoneyMarketMeasure(EvolutionDescription evolution, ReadOnlySpan<int> numeraires)

Parameters

evolution EvolutionDescription

The evolution.

numeraires ReadOnlySpan<int>

The numeraires, at least one per step.

Returns

bool

Whether each step's numeraire is the measure's.

Exceptions

ArgumentException

There are fewer numeraires than steps.

ArgumentOutOfRangeException

A numeraire is negative.

IsInMoneyMarketPlusMeasure(EvolutionDescription, ReadOnlySpan<int>, int)

Whether numeraires are the offset money-market measure's: at each step the offset-th unexpired bond.

public static bool IsInMoneyMarketPlusMeasure(EvolutionDescription evolution, ReadOnlySpan<int> numeraires, int offset = 1)

Parameters

evolution EvolutionDescription

The evolution.

numeraires ReadOnlySpan<int>

The numeraires, at least one per step.

offset int

The offset, at most the last rate time's index.

Returns

bool

Whether each step's numeraire is the measure's.

Remarks

QuantLib reads a numeraire per step, past the vector where there are fewer, undefined, which is refused.

Exceptions

ArgumentException

The offset is past the last numeraire, or there are fewer numeraires than steps.

ArgumentOutOfRangeException

The offset or a numeraire is negative.

IsInTerminalMeasure(EvolutionDescription, ReadOnlySpan<int>)

Whether numeraires are the terminal measure's: the smallest of them is the last bond.

public static bool IsInTerminalMeasure(EvolutionDescription evolution, ReadOnlySpan<int> numeraires)

Parameters

evolution EvolutionDescription

The evolution.

numeraires ReadOnlySpan<int>

The numeraires, at least one.

Returns

bool

Whether the smallest numeraire is the last rate time's index.

Remarks

QuantLib takes the smallest of no numeraires by dereferencing an empty range's end, undefined, which is refused.

Exceptions

ArgumentException

There is no numeraire.

ArgumentOutOfRangeException

A numeraire is negative.

MoneyMarketMeasure(EvolutionDescription)

The discretely compounded money-market measure: at each step the first unexpired bond.

public static ImmutableArray<int> MoneyMarketMeasure(EvolutionDescription evolution)

Parameters

evolution EvolutionDescription

The evolution.

Returns

ImmutableArray<int>

The numeraires, one per step.

MoneyMarketPlusMeasure(EvolutionDescription, int)

The offset discretely compounded money-market measure: at each step the offset-th unexpired bond, the usual money-market measure at offset 0.

public static ImmutableArray<int> MoneyMarketPlusMeasure(EvolutionDescription evolution, int offset = 1)

Parameters

evolution EvolutionDescription

The evolution.

offset int

The offset, at most the last rate time's index.

Returns

ImmutableArray<int>

The numeraires, one per step.

Exceptions

ArgumentException

The offset is past the last numeraire.

ArgumentOutOfRangeException

The offset is negative.

TerminalMeasure(EvolutionDescription)

The terminal measure: the last bond as every step's numeraire.

public static ImmutableArray<int> TerminalMeasure(EvolutionDescription evolution)

Parameters

evolution EvolutionDescription

The evolution.

Returns

ImmutableArray<int>

The numeraires, one per step.