Table of Contents

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

process ExtendedOrnsteinUhlenbeckProcess

The extended Ornstein-Uhlenbeck process X.

y0 double

The jump component Y's value today.

beta double

The jump component's mean-reversion speed β.

jumpIntensity double

The jumps' intensity λ.

eta double

The jump sizes' exponential rate η.

Exceptions

ArgumentNullException

process is null.

Properties

Beta

Gets the jump component's mean-reversion speed β.

public double Beta { get; }

Property Value

double

Eta

Gets the jump sizes' exponential rate η.

public double Eta { get; }

Property Value

double

ExtendedOrnsteinUhlenbeckProcess

Gets the extended Ornstein-Uhlenbeck process X.

public ExtendedOrnsteinUhlenbeckProcess ExtendedOrnsteinUhlenbeckProcess { get; }

Property Value

ExtendedOrnsteinUhlenbeckProcess

Factors

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

public override int Factors { get; }

Property Value

int

JumpIntensity

Gets the jumps' intensity λ.

public double JumpIntensity { get; }

Property Value

double

Size

Gets the number of dimensions of the process.

public override int Size { get; }

Property Value

int

Methods

Diffusion(double, Vector)

The diffusion part of the equation, σ(t, x_t).

public override Matrix Diffusion(double t, Vector x)

Parameters

t double

The time.

x Vector

The state.

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

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

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.

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.

Exceptions

ArgumentException

The sizes don't match.

ArgumentException

x0 holds fewer values than the state, where QuantLib reads past its end; dw fewer increments than the process's factors, the third of which QuantLib reads when a jump falls in the step; or result is 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

result Span<double>

The values, of the process's Size at least.

Exceptions

ArgumentException

result is shorter than the process's size.

ArgumentException

result is shorter than the process's size.