Class FdmHestonHullWhiteOp
The Heston-Hull-White linear operator: the Heston equity and variance directions, a Hull-White short rate, the equity-variance correlation and the equity-rate correlation.
[WorkingType]
public sealed class FdmHestonHullWhiteOp : FdmLinearOpComposite
- Inheritance
-
FdmHestonHullWhiteOp
- Inherited Members
Remarks
A working type (the playbook's finite-difference row): its time-dependent maps are set in place by SetTime(double, double), and a step on the default scheme allocates nothing.
Its times run on the Heston process's model clock (Clock(HestonProcess, FdmQuantoHelper?, LocalVolTermStructure?)), from the earliest curve date
on the risk-free curve's day counter, the dividend curve read at the instants they denote and the Hull-White model
on the risk-free curve restated on the clock; QuantLib's operator reads the dividend curve at the risk-free curve's
times (fdmhestonhullwhiteop.cpp:62), and its reads stand where the curves share the clock.
Constructors
FdmHestonHullWhiteOp(FdmMesher, HestonProcess, HullWhiteProcess, double)
Initializes a new instance of the FdmHestonHullWhiteOp class.
public FdmHestonHullWhiteOp(FdmMesher mesher, HestonProcess hestonProcess, HullWhiteProcess hwProcess, double equityShortRateCorrelation)
Parameters
mesherFdmMesherThe three-dimensional mesher: the log spot, the variance, the short rate's state.
hestonProcessHestonProcessThe Heston process.
hwProcessHullWhiteProcessThe Hull-White process, whose reversion and volatility are read.
equityShortRateCorrelationdoubleThe equity-rate correlation.
Exceptions
- ArgumentNullException
An argument is null.
- ArgumentException
The correlations' squares sum past 1 ("correlation matrix has negative eigenvalues").
Properties
Size
Gets the number of directions.
public override int Size { get; }
Property Value
Methods
Apply(ReadOnlySpan<double>, Span<double>)
Applies the operator to r, writing the result into the caller's span.
public override void Apply(ReadOnlySpan<double> r, Span<double> result)
Parameters
rReadOnlySpan<double>The values, one per point.
resultSpan<double>The result, of
r's length; it mustn't overlapr.
ApplyDirection(int, ReadOnlySpan<double>, Span<double>)
Applies the operator's part in one direction, writing the result into the caller's span.
public override void ApplyDirection(int direction, ReadOnlySpan<double> r, Span<double> result)
Parameters
directionintThe direction.
rReadOnlySpan<double>The values, one per point.
resultSpan<double>The result, of
r's length.
ApplyMixed(ReadOnlySpan<double>, Span<double>)
Applies the operator's mixed part, writing the result into the caller's span.
public override void ApplyMixed(ReadOnlySpan<double> r, Span<double> result)
Parameters
rReadOnlySpan<double>The values, one per point.
resultSpan<double>The result, of
r's length.
Preconditioner(ReadOnlySpan<double>, double, Span<double>)
Applies the preconditioner of (1 + s·A), writing the result into the caller's
span.
public override void Preconditioner(ReadOnlySpan<double> r, double s, Span<double> result)
Parameters
rReadOnlySpan<double>The values, one per point.
sdoubleThe scale of the operator.
resultSpan<double>The result, of
r's length.
SetTime(double, double)
Sets the operator for the interval [t1, t2].
public override void SetTime(double t1, double t2)
Parameters
SolveSplitting(int, ReadOnlySpan<double>, double, Span<double>)
Solves (1 + s·Adirection) x = r for x, writing it into the
caller's span.
public override void SolveSplitting(int direction, ReadOnlySpan<double> r, double s, Span<double> result)
Parameters
directionintThe direction.
rReadOnlySpan<double>The right-hand side, one value per point.
sdoubleThe scale of the direction's operator.
resultSpan<double>The solution, of
r's length.
ToMatrixDecomp()
The operator as sparse matrices, one per part.
public override ImmutableArray<SparseMatrix> ToMatrixDecomp()
Returns
- ImmutableArray<SparseMatrix>
The matrices.
Exceptions
- NanoQLException
The operator has no sparse representation.