Table of Contents

Class FdmHestonHullWhiteOp

Namespace
NanoQL.Methods
Assembly
NanoQL.dll

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

mesher FdmMesher

The three-dimensional mesher: the log spot, the variance, the short rate's state.

hestonProcess HestonProcess

The Heston process.

hwProcess HullWhiteProcess

The Hull-White process, whose reversion and volatility are read.

equityShortRateCorrelation double

The 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

int

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

r ReadOnlySpan<double>

The values, one per point.

result Span<double>

The result, of r's length; it mustn't overlap r.

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

direction int

The direction.

r ReadOnlySpan<double>

The values, one per point.

result Span<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

r ReadOnlySpan<double>

The values, one per point.

result Span<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

r ReadOnlySpan<double>

The values, one per point.

s double

The scale of the operator.

result Span<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

t1 double

The start time.

t2 double

The end time, not before t1.

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

direction int

The direction.

r ReadOnlySpan<double>

The right-hand side, one value per point.

s double

The scale of the direction's operator.

result Span<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.