Class HullWhiteForwardProcess
The forward Hull-White stochastic process: HullWhiteProcess's dynamics in the forward measure of a time T, the drift less B(t, T)σ² and the expectation less M_T(t₀, t₀ + Δt, T).
public sealed class HullWhiteForwardProcess : ForwardMeasureProcess1D
- Inheritance
-
HullWhiteForwardProcess
- Inherited Members
Remarks
The drift's and α's terms are written as HullWhiteProcess's; B(t, T) = (1 − e^(−a(T − t)))/a as
(T − t)·(1 − e^(−a(T − t)))/(a(T − t)); and M_T(s, t, T), QuantLib's σ²/a²[(1 − e^(−u)) − ½(e^(−v) − e^(−v−2u))],
u = a(t − s), v = a(T − t), as σ²(t − s)f(u)[(T − t)f(v) + ½e^(−v)(t − s)f(u)], f(x) = (1 − e^(−x))/x, every term
positive: a divergence, QuantLib's cutting at QL_EPSILON and cancelling to O(σ²) from terms of order σ²(t − s)/a
above it, its half-year expectation −5.55e9 at a = 1e-15
(Divergences/HullWhiteForwardProcessSmallReversionTests.cs).
QuantLib's constructor leaves the forward measure time unset; WithForwardMeasureTime(double) gives a copy at one, and the drift and the expectation refuse to read an unset one.
Constructors
HullWhiteForwardProcess(YieldTermStructure, double, double)
Initializes a new instance of the HullWhiteForwardProcess class, with no forward measure time.
public HullWhiteForwardProcess(YieldTermStructure h, double a, double sigma)
Parameters
hYieldTermStructureThe curve.
adoubleThe mean-reversion speed.
sigmadoubleThe volatility, not negative.
Exceptions
- ArgumentNullException
his null.- ArgumentOutOfRangeException
sigmais negative or NaN (the Ornstein-Uhlenbeck process's refusal).
Properties
A
Gets the mean-reversion speed a.
public double A { get; }
Property Value
Sigma
Gets the volatility σ.
public double Sigma { get; }
Property Value
X0
Gets the initial value of the state variable.
public override double X0 { get; }
Property Value
Methods
Alpha(double)
α(t) = f(t) + ½(σ(1 − e^(−at))/a)², f the curve's instantaneous forward.
public double Alpha(double t)
Parameters
tdoubleThe time.
Returns
- double
α(t).
B(double, double)
B(t, T) = (1 − e^(−a(T − t)))/a.
public double B(double t, double T)
Parameters
Returns
- double
B(t, T).
Diffusion(double, double)
The diffusion part of the equation, σ(t, x_t).
public override double Diffusion(double t, double x)
Parameters
Returns
- double
The diffusion.
Drift(double, double)
The drift part of the equation, μ(t, x_t).
public override double Drift(double t, double x)
Parameters
Returns
- double
The drift.
Exceptions
- NanoQLException
The process has no forward measure time.
Expectation(double, double, double)
The expectation E(x_{t0 + Δt} | x_{t0} = x0) of the process after a time interval Δt; by default, the discretization's drift applied to x0 by Apply(double, double).
public override double Expectation(double t0, double x0, double dt)
Parameters
t0doubleThe start of the interval.
x0doubleThe state at its start.
dtdoubleThe interval's length.
Returns
- double
The expectation.
Exceptions
- NanoQLException
The process has no discretization.
- NanoQLException
The process has no forward measure time.
M_T(double, double, double)
The forward measure's correction to the expectation from s to t: M_T(s, t, T).
public double M_T(double s, double t, double T)
Parameters
Returns
- double
M_T(s, t, T).
StdDeviation(double, double, double)
The standard deviation S(x_{t0 + Δt} | x_{t0} = x0) of the process after a time interval Δt; by default, the discretization's diffusion.
public override double StdDeviation(double t0, double x0, double dt)
Parameters
t0doubleThe start of the interval.
x0doubleThe state at its start.
dtdoubleThe interval's length.
Returns
- double
The standard deviation.
Exceptions
- NanoQLException
The process has no discretization.
Variance(double, double, double)
The variance V(x_{t0 + Δt} | x_{t0} = x0) of the process after a time interval Δt; by default, the discretization's variance.
public override double Variance(double t0, double x0, double dt)
Parameters
t0doubleThe start of the interval.
x0doubleThe state at its start.
dtdoubleThe interval's length.
Returns
- double
The variance.
Exceptions
- NanoQLException
The process has no discretization.
WithForwardMeasureTime(double)
A copy of the process at another forward measure time.
public override HullWhiteForwardProcess WithForwardMeasureTime(double forwardMeasureTime)
Parameters
forwardMeasureTimedoubleThe forward measure time T.
Returns
- HullWhiteForwardProcess
The copy; the receiver doesn't change.