Class OneStepOptionlets
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
rateTimesReadOnlySpan<double>The rate times, at least two.
accrualsReadOnlySpan<double>The accrual of each optionlet, at least as many as the payoffs.
paymentTimesReadOnlySpan<double>The payment time of each optionlet, increasing, at least as many as the payoffs.
payoffsReadOnlySpan<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
NumberOfProducts
Gets the number of optionlets.
public override int NumberOfProducts { get; }
Property Value
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
currentStateCurveStateThe state of the curve at the step's end.
numberCashFlowsThisStepSpan<int>Each product's number of cash flows, written; one entry a product.
cashFlowsGeneratedMarketModelMultiProductCashFlow[][]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()