Class ExtOUWithJumpsProcess
- Namespace
- NanoQL.Experimental
- Assembly
- NanoQL.dll
Kluge's spot model, an extended Ornstein-Uhlenbeck process plus exponential jumps (an extension of Lucia and Schwartz's): S = e^(X + Y), dX = α(μ(t) − X)dt + σdW, dY = −βY dt + J dN, the jumps exponential with rate η.
[Experimental("NQL0001")]
public sealed class ExtOUWithJumpsProcess : StochasticProcess
- Inheritance
-
ExtOUWithJumpsProcess
- Inherited Members
Remarks
Immutable; two state variables, X and Y, and three factors: X's Brownian draw, the draw that times a jump and the draw that sizes it, each an inverse normal mapped to a uniform within [ε, 1 − ε]. The in-place Evolve(double, ReadOnlySpan<double>, double, ReadOnlySpan<double>, Span<double>) allocates nothing, for QuantLib's swing cases' 200,000 paths.
A step draws at most one jump, QuantLib's first-order scheme: the probability of a jump in a step of length dt is 1 − e^(−λdt), and two or more are taken as one, a bias of order (λdt)² that shrinks with the step.
References: T. Kluge, Pricing Swing Options and other Electricity Derivatives, 2008; B. Hambly, S. Howison and T. Kluge, Modelling spikes and pricing swing options in electricity markets.
Constructors
ExtOUWithJumpsProcess(ExtendedOrnsteinUhlenbeckProcess, double, double, double, double)
Initializes a new instance of the ExtOUWithJumpsProcess class.
public ExtOUWithJumpsProcess(ExtendedOrnsteinUhlenbeckProcess process, double y0, double beta, double jumpIntensity, double eta)
Parameters
processExtendedOrnsteinUhlenbeckProcessThe extended Ornstein-Uhlenbeck process X.
y0doubleThe jump component Y's value today.
betadoubleThe jump component's mean-reversion speed β.
jumpIntensitydoubleThe jumps' intensity λ.
etadoubleThe jump sizes' exponential rate η.
Exceptions
- ArgumentNullException
processis null.
Properties
Beta
Gets the jump component's mean-reversion speed β.
public double Beta { get; }
Property Value
Eta
Gets the jump sizes' exponential rate η.
public double Eta { get; }
Property Value
ExtendedOrnsteinUhlenbeckProcess
Gets the extended Ornstein-Uhlenbeck process X.
public ExtendedOrnsteinUhlenbeckProcess ExtendedOrnsteinUhlenbeckProcess { get; }
Property Value
Factors
Gets the number of independent factors of the process; by default, its Size.
public override int Factors { get; }
Property Value
JumpIntensity
Gets the jumps' intensity λ.
public double JumpIntensity { get; }
Property Value
Size
Gets the number of dimensions of the process.
public override int Size { get; }
Property Value
Methods
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.
Remarks
QuantLib's 2 × 2 matrix, X's volatility its one non-zero entry; the jump component has no diffusion.
Exceptions
- ArgumentException
xis empty, 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.
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.
Exceptions
- ArgumentException
The sizes don't match.
- ArgumentException
x0holds fewer values than the state, where QuantLib reads past its end;dwfewer increments than the process's factors, the third of which QuantLib reads when a jump falls in the step; 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.