Class BatesProcess
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
riskFreeRateYieldTermStructureThe risk-free curve.
dividendYieldYieldTermStructureThe dividend curve.
s0doubleThe underlying's value.
v0doubleThe variance's value.
kappadoubleThe variance's mean-reversion speed κ.
thetadoubleThe variance's long-run mean θ.
sigmadoubleThe variance's volatility σ.
rhodoubleThe correlation ρ of the two Brownian motions.
lambdadoubleThe jumps' intensity λ.
nudoubleThe log jump size's mean ν.
deltadoubleThe log jump size's standard deviation δ.
dHestonProcessDiscretizationThe discretization the Heston part steps by; full truncation by default.
Exceptions
- ArgumentNullException
A curve is null.
- ArgumentOutOfRangeException
disn't a member of its enum.
Properties
Delta
Gets the log jump size's standard deviation δ.
public double Delta { get; }
Property Value
Factors
Gets the number of independent factors of the process; by default, its Size.
public override int Factors { get; }
Property Value
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
Nu
Gets the log jump size's mean ν.
public double Nu { get; }
Property Value
Methods
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 quadratic-exponential martingale correction has no solution ("illegal value"), or the variance's law can't be inverted.
- ArgumentException
x0holds fewer values than the state, ordwfewer increments than the process's factors, where QuantLib reads past its end.- NanoQLException
The Heston step refuses.
- ArgumentException
dwholds 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
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 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
x0holds fewer values than the state, ordwfewer increments than the process's factors, where QuantLib reads past their end; orresultis shorter than the state.- NanoQLException
The Heston step refuses.
- ArgumentException
dwholds fewer increments than the process's factors, where QuantLib reads past its end.