The Brownian Motion (BM) model (bm
) derives directly from the linear
drift (sdeld
) model:
Create a univariate Brownian motion (bm
) object to represent the model
using bm
:
obj = bm(0, 0.3) % (A = Mu, Sigma)
obj = Class BM: Brownian Motion ---------------------------------------- Dimensions: State = 1, Brownian = 1 ---------------------------------------- StartTime: 0 StartState: 0 Correlation: 1 Drift: drift rate function F(t,X(t)) Diffusion: diffusion rate function G(t,X(t)) Simulation: simulation method/function simByEuler Mu: 0 Sigma: 0.3
bm
objects display the parameter A
as
the more familiar Mu
.
The bm
object also provides an overloaded Euler simulation method that
improves run-time performance in certain common situations. This specialized method
is invoked automatically only if all the following conditions
are met:
The expected drift, or trend, rate Mu
is a column
vector.
The volatility rate, Sigma
, is a matrix.
No end-of-period adjustments and/or processes are made.
If specified, the random noise process Z
is a
three-dimensional array.
If Z
is unspecified, the assumed Gaussian
correlation structure is a double matrix.
The Constant Elasticity of Variance (CEV) model (cev
) also derives directly from the
linear drift (sdeld
) model:
The cev
object constrains A to an
NVars
-by-1
vector of zeros.
D is a diagonal matrix whose elements are the corresponding
element of the state vector X, raised to an exponent
α(t).
Create a univariate cev
object to represent the model using cev
:
obj = cev(0.25, 0.5, 0.3) % (B = Return, Alpha, Sigma)
obj = Class CEV: Constant Elasticity of Variance ------------------------------------------ Dimensions: State = 1, Brownian = 1 ------------------------------------------ StartTime: 0 StartState: 1 Correlation: 1 Drift: drift rate function F(t,X(t)) Diffusion: diffusion rate function G(t,X(t)) Simulation: simulation method/function simByEuler Return: 0.25 Alpha: 0.5 Sigma: 0.3
cev
and gbm
objects display the parameter
B
as the more familiar Return
.
The Geometric Brownian Motion (GBM) model (gbm
) derives directly from the CEV (cev
) model:
Compared to the cev
object, a gbm
object constrains all elements of the alpha
exponent vector to one such that D is now a diagonal matrix with
the state vector X along the main diagonal.
The gbm
object also provides two simulation methods that can be used by
separable models:
An overloaded Euler simulation method that improves run-time performance in certain common situations. This specialized method is invoked automatically only if all the following conditions are true:
The expected rate of return (Return
) is
a diagonal matrix.
The volatility rate (Sigma
) is a
matrix.
No end-of-period adjustments/processes are made.
If specified, the random noise process
Z
is a three-dimensional
array.
If Z
is unspecified, the assumed
Gaussian correlation structure is a double matrix.
An approximate analytic solution (simBySolution
)
obtained by applying a Euler approach to the transformed (using Ito's
formula) logarithmic process. In general, this is
not the exact solution to this GBM model, as
the probability distributions of the simulated and true state vectors
are identical only for piecewise constant
parameters. If the model parameters are piecewise constant over each
observation period, the state vector
Xt is lognormally
distributed and the simulated process is exact for the observation times
at which Xt is sampled.
Create a univariate gbm
object to represent the model using gbm
:
obj = gbm(0.25, 0.3) % (B = Return, Sigma)
obj = Class GBM: Generalized Geometric Brownian Motion ------------------------------------------------ Dimensions: State = 1, Brownian = 1 ------------------------------------------------ StartTime: 0 StartState: 1 Correlation: 1 Drift: drift rate function F(t,X(t)) Diffusion: diffusion rate function G(t,X(t)) Simulation: simulation method/function simByEuler Return: 0.25 Sigma: 0.3
The sdemrd
object derives directly from the sdeddo
object. It provides an
interface in which the drift-rate function is expressed in mean-reverting drift
form:
sdemrd
objects provide a parametric alternative to the linear drift
form by reparameterizing the general linear drift such that:
Create an sdemrd
object using sdemrd
with a square root
exponent to represent the model:
obj = sdemrd(0.2, 0.1, 0.5, 0.05)
obj = Class SDEMRD: SDE with Mean-Reverting Drift ------------------------------------------- Dimensions: State = 1, Brownian = 1 ------------------------------------------- StartTime: 0 StartState: 1 Correlation: 1 Drift: drift rate function F(t,X(t)) Diffusion: diffusion rate function G(t,X(t)) Simulation: simulation method/function simByEuler Alpha: 0.5 Sigma: 0.05 Level: 0.1 Speed: 0.2
% (Speed, Level, Alpha, Sigma)
sdemrd
objects display the familiar Speed
and Level
parameters
instead of A
and B
.
The Cox-Ingersoll-Ross (CIR) short-rate object, cir
, derives directly from the SDE
with mean-reverting drift (sdemrd
) class:
where D is a diagonal matrix whose elements are the square root of the corresponding element of the state vector.
Create a cir
object using cir
to represent the same model
as in Example: SDEMRD Models:
obj = cir(0.2, 0.1, 0.05) % (Speed, Level, Sigma)
obj = Class CIR: Cox-Ingersoll-Ross ---------------------------------------- Dimensions: State = 1, Brownian = 1 ---------------------------------------- StartTime: 0 StartState: 1 Correlation: 1 Drift: drift rate function F(t,X(t)) Diffusion: diffusion rate function G(t,X(t)) Simulation: simulation method/function simByEuler Sigma: 0.05 Level: 0.1 Speed: 0.2
Although the last two objects are of different classes, they represent the same mathematical
model. They differ in that you create the cir
object by specifying only
three input arguments. This distinction is reinforced by the fact that the
Alpha
parameter does not display – it is defined to be
1/2
.
The Hull-White/Vasicek (HWV) short-rate object, hwv
, derives directly from SDE with
mean-reverting drift (sdemrd
) class:
Using the same parameters as in the previous example, create an hwv
object
using hwv
to represent the model:
obj = hwv(0.2, 0.1, 0.05) % (Speed, Level, Sigma)
obj = Class HWV: Hull-White/Vasicek ---------------------------------------- Dimensions: State = 1, Brownian = 1 ---------------------------------------- StartTime: 0 StartState: 1 Correlation: 1 Drift: drift rate function F(t,X(t)) Diffusion: diffusion rate function G(t,X(t)) Simulation: simulation method/function simByEuler Sigma: 0.05 Level: 0.1 Speed: 0.2
cir
and hwv
share the same interface and
display methods. The only distinction is that cir
and hwv
model objects constrain
Alpha
exponents to 1/2
and
0
, respectively. Furthermore, the hwv
object also provides an
additional method that simulates approximate analytic solutions (simBySolution
) of separable
models. This method simulates the state vector
Xt using an approximation of
the closed-form solution of diagonal drift HWV
models. Each
element of the state vector Xt is
expressed as the sum of NBrowns
correlated Gaussian random
draws added to a deterministic time-variable drift.
When evaluating expressions, all model parameters are assumed
piecewise constant over each simulation period. In general, this is not the
exact solution to this hwv
model, because the probability
distributions of the simulated and true state vectors are identical only for
piecewise constant parameters. If S(t,Xt), L(t,Xt),
and V(t,Xt) are piecewise
constant over each observation period, the state vector Xt is
normally distributed, and the simulated process is exact for the observation
times at which Xt is sampled.
Many references differentiate between Vasicek models and Hull-White models. Where such
distinctions are made, Vasicek parameters are constrained to be constants, while
Hull-White parameters vary deterministically with time. Think of Vasicek models
in this context as constant-coefficient Hull-White models and equivalently,
Hull-White models as time-varying Vasicek models. However, from an architectural
perspective, the distinction between static and dynamic parameters is trivial.
Since both models share the same general parametric specification as previously
described, a single hwv
object encompasses the
models.
The Heston (heston
) object derives directly from
SDE from the Drift and Diffusion (sdeddo
) class. Each Heston model is a
bivariate composite model, consisting of two coupled univariate models:
(1) |
(2) |
heston
are typically used to price
equity options.Create a heston
object using heston
to represent the model:
obj = heston (0.1, 0.2, 0.1, 0.05)
obj = Class HESTON: Heston Bivariate Stochastic Volatility ---------------------------------------------------- Dimensions: State = 2, Brownian = 2 ---------------------------------------------------- StartTime: 0 StartState: 1 (2x1 double array) Correlation: 2x2 diagonal double array Drift: drift rate function F(t,X(t)) Diffusion: diffusion rate function G(t,X(t)) Simulation: simulation method/function simByEuler Return: 0.1 Speed: 0.2 Level: 0.1 Volatility: 0.05
bates
| bm
| cev
| cir
| diffusion
| drift
| gbm
| heston
| hwv
| interpolate
| merton
| sde
| sdeddo
| sdeld
| sdemrd
| simByEuler
| simByQuadExp
| simBySolution
| simBySolution
| simulate
| ts2func