Table of Contents

Class BatesProcess

Namespace
NanoQL.Processes
Assembly
NanoQL.dll

The Bates process: the Heston square-root stochastic-volatility process with log-normal jumps, dS = (r − q − λm)S dt + √v S dW₁ + (e^J − 1)S dN, dv = κ(θ − v) dt + σ√v dW₂, dW₁dW₂ = ρ dt, N a Poisson process of intensity λ and J normal with mean ν and standard deviation δ, m = e^{ν + δ²/2} − 1.

public sealed class BatesProcess : HestonProcess
Inheritance
BatesProcess
Inherited Members

Remarks

Immutable, a HestonProcess as QuantLib's derives from it: its drift less λm, two more factors, the first drawing the step's number of jumps through the inverse Poisson distribution and the second their sizes, and QuantLib's default discretization, full truncation, where the Heston process's is the quadratic-exponential martingale scheme. The in-place Evolve(double, ReadOnlySpan<double>, double, ReadOnlySpan<double>, Span<double>) allocates nothing where the Heston step doesn't.

Constructors

BatesProcess(YieldTermStructure, YieldTermStructure, double, double, double, double, double, double, double, double, double, HestonProcessDiscretization)

Initializes a new instance of the BatesProcess class.

public BatesProcess(YieldTermStructure riskFreeRate, YieldTermStructure dividendYield, double s0, double v0, double kappa, double theta, double sigma, double rho, double lambda, double nu, double delta, HestonProcessDiscretization d = HestonProcessDiscretization.FullTruncation)

Parameters

riskFreeRate YieldTermStructure

The risk-free curve.

dividendYield YieldTermStructure

The dividend curve.

s0 double

The underlying's value.

v0 double

The variance's value.

kappa double

The variance's mean-reversion speed κ.

theta double

The variance's long-run mean θ.

sigma double

The variance's volatility σ.

rho double

The correlation ρ of the two Brownian motions.

lambda double

The jumps' intensity λ.

nu double

The log jump size's mean ν.

delta double

The log jump size's standard deviation δ.

d HestonProcessDiscretization

The discretization the Heston part steps by; full truncation by default.

Exceptions

ArgumentNullException

A curve is null.

ArgumentOutOfRangeException

d isn't a member of its enum.

Properties

Delta

Gets the log jump size's standard deviation δ.

public double Delta { get; }

Property Value

double

Factors

Gets the number of independent factors of the process; by default, its Size.

public override int Factors { get; }

Property Value

int

Remarks

Three for Broadie and Kaya's schemes, which sample the integrated variance with the third; two otherwise.

Lambda

Gets the jumps' intensity λ.

public double Lambda { get; }

Property Value

double

Nu

Gets the log jump size's mean ν.

public double Nu { get; }

Property Value

double

Methods

Drift(double, Vector)

The drift part of the equation, μ(t, x_t).

public override Vector Drift(double t, Vector x)

Parameters

t double

The time.

x Vector

The state.

Returns

Vector

A new vector.

Exceptions

ArgumentException

x holds 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

t0 double

The start of the interval.

x0 Vector

The state at its start.

dt double

The interval's length.

dw Vector

The Brownian increments, one per factor.

Returns

Vector

A new vector.

Exceptions

ArgumentException

The sizes don't match.

NanoQLException

The quadratic-exponential martingale correction has no solution ("illegal value"), or the variance's law can't be inverted.

ArgumentException

x0 holds fewer values than the state, or dw fewer increments than the process's factors, where QuantLib reads past its end.

NanoQLException

The Heston step refuses.

ArgumentException

dw holds fewer 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

t0 double

The start of the interval.

x0 ReadOnlySpan<double>

The state at its start, of the process's Size.

dt double

The interval's length.

dw ReadOnlySpan<double>

The Brownian increments, one per factor.

result Span<double>

The state at the interval's end, of the process's size at least; it mustn't overlap x0 or dw.

Remarks

The truncation, reflection and quadratic-exponential schemes step without allocating, by QuantLib's arithmetic, so the values are Evolve(double, Vector, double, Vector)'s bit for bit; the exact schemes step through it.

Exceptions

ArgumentException

The sizes don't match.

NanoQLException

The quadratic-exponential martingale correction has no solution ("illegal value"), or the variance's law can't be inverted.

ArgumentException

x0 holds fewer values than the state, or dw fewer increments than the process's factors, where QuantLib reads past their end; or result is shorter than the state.

NanoQLException

The Heston step refuses.

ArgumentException

dw holds fewer increments than the process's factors, where QuantLib reads past its end.