Table of Contents

Class OneStepOptionlets

Namespace
NanoQL.Models
Assembly
NanoQL.dll

Optionlets valued in one step: at the last rate's reset, product i pays its payoff of fᵢ times τᵢ at its payment time where the payoff is positive.

[WorkingType]
public sealed class OneStepOptionlets : MultiProductOneStep
Inheritance
OneStepOptionlets
Inherited Members

Remarks

A working type; the payoffs are shared, immutable. It refuses inputs QuantLib reads past: no payoff, more payoffs than rates, and fewer accruals or payment times than payoffs.

Constructors

OneStepOptionlets(ReadOnlySpan<double>, ReadOnlySpan<double>, ReadOnlySpan<double>, ReadOnlySpan<Payoff>)

Initializes a new instance of the OneStepOptionlets class.

public OneStepOptionlets(ReadOnlySpan<double> rateTimes, ReadOnlySpan<double> accruals, ReadOnlySpan<double> paymentTimes, ReadOnlySpan<Payoff> payoffs)

Parameters

rateTimes ReadOnlySpan<double>

The rate times, at least two.

accruals ReadOnlySpan<double>

The accrual of each optionlet, at least as many as the payoffs.

paymentTimes ReadOnlySpan<double>

The payment time of each optionlet, increasing, at least as many as the payoffs.

payoffs ReadOnlySpan<Payoff>

The payoff of each optionlet, at most one a rate; none for a product that pays nothing.

Exceptions

ArgumentException

The rate times or the payment times aren't increasing, or the inputs' sizes don't fit.

ArgumentNullException

A payoff is null.

Properties

MaxNumberOfCashFlowsPerProductPerStep

Gets 1.

public override int MaxNumberOfCashFlowsPerProductPerStep { get; }

Property Value

int

NumberOfProducts

Gets the number of optionlets.

public override int NumberOfProducts { get; }

Property Value

int

Methods

Clone()

A deep copy of the product, its state included.

public override MarketModelMultiProduct Clone()

Returns

MarketModelMultiProduct

A new product.

NextTimeStep(CurveState, Span<int>, MarketModelMultiProductCashFlow[][])

Moves the product a step: writes each product's number of cash flows at this step and the cash flows.

public override bool NextTimeStep(CurveState currentState, Span<int> numberCashFlowsThisStep, MarketModelMultiProductCashFlow[][] cashFlowsGenerated)

Parameters

currentState CurveState

The state of the curve at the step's end.

numberCashFlowsThisStep Span<int>

Each product's number of cash flows, written; one entry a product.

cashFlowsGenerated MarketModelMultiProductCashFlow[][]

Each product's cash flows, written from the first; NumberOfProducts rows of at least MaxNumberOfCashFlowsPerProductPerStep.

Returns

bool

Whether the path is finished for the product.

PossibleCashFlowTimes()

The times the product can pay at, which its cash flows' time indices index.

public override ImmutableArray<double> PossibleCashFlowTimes()

Returns

ImmutableArray<double>

The times.

Reset()

Nothing: the product has no state.

public override void Reset()