Class HybridHestonHullWhiteProcess
The three-factor hybrid of a Heston equity and a Hull-White short rate in its forward measure: its state is the underlying, its variance and the short rate, the equity correlated with the short rate.
public sealed class HybridHestonHullWhiteProcess : StochasticProcess
- Inheritance
-
HybridHestonHullWhiteProcess
- Inherited Members
Remarks
Immutable over its Heston process and its forward Hull-White process. The Hull-White process the hybrid evolves, its
model and its numeraire's end discount are on the Heston process's risk-free curve, from the given process's
reversion, volatility and forward-measure time, which HullWhiteProcess returns; the given process's
own curve isn't read. QuantLib builds its model on the Heston curve but takes the short rate from the given
process's curve (hybridhestonhullwhiteprocess.cpp:37-46, :64, :137, :179), so the numeraire
prices a bond on one curve at a rate taken from the other; here all of it runs on the one curve, QuantLib's bits
where the two curves are one.
The process's times run on the Heston process's model clock, from the earliest reference date of its curves on the risk-free curve's day counter, each curve read at the instant a time denotes, the Hull-White parts on the risk-free curve restated on that clock; QuantLib's process reads the dividend curve at the risk-free curve's times.
The step's terms m₂, m₄, m₅, v₁ and v₁₂, QuantLib's expressions, cancel as a·dt falls: below a·dt of NanoQL.Processes.HybridHestonHullWhiteProcess.StepCut they are evaluated in double-double, below its floor in quad-double and below that by the cubic in a through four quad-double values, QuantLib's double and bits from the cut up, the cut where QuantLib's double first departs from the expressions' exact values by more than 1e-12 relative, measured at the run. The in-place Evolve(double, ReadOnlySpan<double>, double, ReadOnlySpan<double>, Span<double>) steps by the same arithmetic without allocating.
Constructors
HybridHestonHullWhiteProcess(HestonProcess, HullWhiteForwardProcess, double, HybridHestonHullWhiteProcessDiscretization)
Initializes a new instance of the HybridHestonHullWhiteProcess class.
public HybridHestonHullWhiteProcess(HestonProcess hestonProcess, HullWhiteForwardProcess hullWhiteProcess, double corrEquityShortRate, HybridHestonHullWhiteProcessDiscretization discretization = HybridHestonHullWhiteProcessDiscretization.BSMHullWhite)
Parameters
hestonProcessHestonProcessThe Heston process.
hullWhiteProcessHullWhiteForwardProcessThe forward Hull-White process, whose reversion, volatility and forward-measure time are read.
corrEquityShortRatedoubleThe correlation of the equity with the short rate.
discretizationHybridHestonHullWhiteProcessDiscretizationThe discretization.
Exceptions
- ArgumentNullException
A process is null.
- ArgumentOutOfRangeException
discretizationisn't a member of its type.- ArgumentException
The correlations' squares sum past 1 ("correlation matrix is not positive definite"), or the Hull-White volatility isn't positive ("positive vol of Hull White process is required").
- NanoQLException
The Hull-White process has no forward-measure time.
Properties
Discretization
Gets the discretization.
public HybridHestonHullWhiteProcessDiscretization Discretization { get; }
Property Value
Eta
Gets the correlation of the equity with the short rate: QuantLib's eta().
public double Eta { get; }
Property Value
HestonProcess
Gets the Heston process.
public HestonProcess HestonProcess { get; }
Property Value
HullWhiteProcess
Gets the forward Hull-White process the hybrid evolves: on the Heston process's risk-free curve, with the given process's reversion, volatility and forward-measure time.
public HullWhiteForwardProcess HullWhiteProcess { get; }
Property Value
Size
Gets the number of dimensions of the process.
public override int Size { get; }
Property Value
Methods
Apply(Vector, Vector)
Applies a change to the state; by default x + Δx.
public override Vector Apply(Vector x0, Vector dx)
Parameters
Returns
- Vector
A new vector.
Exceptions
- ArgumentException
The sizes differ.
- ArgumentException
x0ordxholds fewer values than the state, where QuantLib reads past its end.
Diffusion(double, Vector)
The diffusion part of the equation, σ(t, x_t).
public override Matrix Diffusion(double t, Vector x)
Parameters
Returns
- Matrix
A new matrix.
Exceptions
- ArgumentException
xholds fewer values than the Heston process's state, where QuantLib reads past its end.
Drift(double, Vector)
The drift part of the equation, μ(t, x_t).
public override Vector Drift(double t, Vector x)
Parameters
Returns
- Vector
A new vector.
Exceptions
- ArgumentException
xholds fewer values than the state, where QuantLib reads past its end.
Evolve(double, Vector, double, Vector)
The state after a time interval Δt; by default E(x0, t0, Δt) + S(x0, t0, Δt) · Δw, where E is the expectation and S the standard deviation, applied to the expectation by Apply(Vector, Vector).
public override Vector Evolve(double t0, Vector x0, double dt, Vector dw)
Parameters
t0doubleThe start of the interval.
x0VectorThe state at its start.
dtdoubleThe interval's length.
dwVectorThe Brownian increments, one per factor.
Returns
- Vector
A new vector.
Exceptions
- ArgumentException
The sizes don't match.
- NanoQLException
The step's variances aren't positive ("zero or negative variance given"), or its terminal correlation is invalid.
- ArgumentException
x0holds fewer values than the state, ordwfewer increments than the process's factors, where QuantLib reads past its end.
Evolve(double, ReadOnlySpan<double>, double, ReadOnlySpan<double>, Span<double>)
The state after a time interval Δt, written into the caller's span: the in-place form of Evolve(double, Vector, double, Vector), by default its values, copied.
public override void Evolve(double t0, ReadOnlySpan<double> x0, double dt, ReadOnlySpan<double> dw, Span<double> result)
Parameters
t0doubleThe start of the interval.
x0ReadOnlySpan<double>The state at its start, of the process's Size.
dtdoubleThe interval's length.
dwReadOnlySpan<double>The Brownian increments, one per factor.
resultSpan<double>The state at the interval's end, of the process's size at least; it mustn't overlap
x0ordw.
Remarks
The same arithmetic without allocating, so the values are Evolve(double, Vector, double, Vector)'s bit for bit.
Exceptions
- ArgumentException
The sizes don't match.
- NanoQLException
The step's variances aren't positive, or its terminal correlation is invalid.
- ArgumentException
x0holds fewer values than the state, ordwfewer increments than the process's factors, where QuantLib reads past their end; orresultis shorter than the state.
InitialValues()
The initial values of the state variables.
public override Vector InitialValues()
Returns
- Vector
A new vector.
InitialValues(Span<double>)
The initial values of the state variables, written into the caller's span; by default InitialValues()'s values, copied.
public override void InitialValues(Span<double> result)
Parameters
Exceptions
- ArgumentException
resultis shorter than the process's size.- ArgumentException
resultis shorter than the process's size.
Numeraire(double, Vector)
The numeraire at a time and state: the Hull-White zero bond to the forward-measure time over its initial discount.
public double Numeraire(double t, Vector x)
Parameters
Returns
- double
The numeraire's value.
Exceptions
- ArgumentException
xholds fewer values than the state, where QuantLib reads past its end.
Time(Date)
The time of a date: on the Heston process's model clock, QuantLib's, the risk-free curve's, where the dividend curve isn't dated before it.
public override double Time(Date date)
Parameters
dateDateThe date.
Returns
- double
The time.
Exceptions
- ArgumentException
dateisdefault(Date).