Table of Contents

Class OneStepForwards

Namespace
NanoQL.Models
Assembly
NanoQL.dll

Forward-rate agreements valued in one step: at the last rate's reset, product i pays (fᵢ − Kᵢ) τᵢ at its payment time.

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

Remarks

A working type. It refuses inputs QuantLib reads past: no strike, more strikes than rates, and fewer accruals or payment times than strikes.

Constructors

OneStepForwards(ReadOnlySpan<double>, ReadOnlySpan<double>, ReadOnlySpan<double>, ReadOnlySpan<double>)

Initializes a new instance of the OneStepForwards class.

public OneStepForwards(ReadOnlySpan<double> rateTimes, ReadOnlySpan<double> accruals, ReadOnlySpan<double> paymentTimes, ReadOnlySpan<double> strikes)

Parameters

rateTimes ReadOnlySpan<double>

The rate times, at least two.

accruals ReadOnlySpan<double>

The accrual of each forward, at least as many as the strikes.

paymentTimes ReadOnlySpan<double>

The payment time of each forward, increasing, at least as many as the strikes.

strikes ReadOnlySpan<double>

The strike of each forward, 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.

Properties

MaxNumberOfCashFlowsPerProductPerStep

Gets 1.

public override int MaxNumberOfCashFlowsPerProductPerStep { get; }

Property Value

int

NumberOfProducts

Gets the number of forwards.

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()