Class LogNormalCotSwapRatePc
The predictor-corrector evolver of a displaced log-normal coterminal swap market model: the model's rates are the coterminal swap rates, each step predicted with the drifts at its start and corrected with the average of those and the drifts on the predicted curve.
[WorkingType]
public sealed class LogNormalCotSwapRatePc : MarketModelEvolver
- Inheritance
-
LogNormalCotSwapRatePc
- Inherited Members
Remarks
A working type, copying each step's pseudo-root at construction; one step allocates nothing after a path's warm-up.
SetInitialState(CurveState) reads any curve state's coterminal swap rates, through the base's virtual read, where
QuantLib's casts the state to its own type and dereferences a null pointer for any other (an access violation;
lognormalcotswapratepc.cpp:92-93; Divergences/SwapRatePcInitialStateTests.cs).
Constructors
LogNormalCotSwapRatePc(MarketModel, BrownianGeneratorFactory, ReadOnlySpan<int>, int)
Initializes a new instance of the LogNormalCotSwapRatePc class.
public LogNormalCotSwapRatePc(MarketModel marketModel, BrownianGeneratorFactory factory, ReadOnlySpan<int> numeraires, int initialStep = 0)
Parameters
marketModelMarketModelThe model evolved, its rates the coterminal swap rates.
factoryBrownianGeneratorFactoryThe factory of the Brownian generator.
numerairesReadOnlySpan<int>The numeraires, one per step, compatible with the evolution.
initialStepintThe step each path starts from, below the number of steps.
Exceptions
- ArgumentException
The numeraires aren't compatible with the evolution.
- ArgumentOutOfRangeException
initialStepisn't a step.
Properties
CurrentState
Gets the curve state after the last step: the evolver's own, valid until its next step.
public override CurveState CurrentState { get; }
Property Value
CurrentStep
Gets the step the next AdvanceStep() takes.
public override int CurrentStep { get; }
Property Value
Numeraires
Gets the numeraires, one per step.
public override ImmutableArray<int> Numeraires { get; }
Property Value
Methods
AdvanceStep()
Evolves the rates over the current step.
public override double AdvanceStep()
Returns
- double
The step's weight.
SetInitialState(CurveState)
Sets the state each path starts from.
public override void SetInitialState(CurveState cs)
Parameters
csCurveStateThe curve state whose rates each path starts from.
Remarks
Any curve state's coterminal swap rates, where QuantLib's reads only its own type's.
Exceptions
- ArgumentException
The state's swap rates aren't one per rate.
StartNewPath()
Starts a new path.
public override double StartNewPath()
Returns
- double
The path's weight.