Construct driftrate model components
DriftRate = drift(A, B)
This constructor specifies the driftrate component of continuoustime
stochastic differential equations (SDEs). The driftrate specification
supports the simulation of sample paths of NVARS
state
variables driven by NBROWNS
Brownian motion sources
of risk over NPERIODS
consecutive observation periods,
approximating continuoustime stochastic processes.
The driftrate specification can be any NVARS
by1
vectorvalued
function F of the general form:
$$F(t,{X}_{t})=A(t)+B(t){X}_{t}$$  (183) 
$$d{X}_{t}=F(t,{X}_{t})dt+G(t,{X}_{t})d{W}_{t}$$
X_{t} is
an NVARS
by1
state vector of
process variables.
dW_{t} is
an NBROWNS
by1
Brownian motion
vector.
A and B are model parameters.
The driftrate specification is flexible, and provides direct parametric support for static/linear drift models. It is also extensible, and provides indirect support for dynamic/nonlinear models via an interface. This enables you to specify virtually any driftrate specification.
Specify required input parameters as one of the following types:
A MATLAB^{®} array. Specifying an array indicates a static (nontimevarying) parametric specification. This array fully captures all implementation details, which are clearly associated with a parametric form.
A MATLAB function. Specifying a function provides indirect support for virtually any static, dynamic, linear, or nonlinear model. This parameter is supported via an interface, because all implementation details are hidden and fully encapsulated by the function.
You can specify combinations of array and function input parameters as needed.
Moreover, a parameter is identified as a deterministic function
of time if the function accepts a scalar time t
as
its only input argument. Otherwise, a parameter is assumed to be a
function of time t and state X(t) and
is invoked with both input arguments.
The required input parameters are:
A  This argument represents the parameter A.
If you specify

B  This argument represents the parameter B.
If you specify

DriftRate  Object of class

When you specify the input arguments A
and B
as MATLAB arrays,
they are associated with a linear drift parametric form. By contrast,
when you specify either A
or B
as
a function, you can customize virtually any driftrate specification.
Accessing the output driftrate parameters A
and B
with
no inputs simply returns the original input specification. Thus, when
you invoke driftrate parameters with no inputs, they behave like
simple properties and allow you to test the data type (double vs.
function, or equivalently, static vs. dynamic) of the original input
specification. This is useful for validating and designing methods.
When you invoke driftrate parameters with inputs, they behave
like functions, giving the impression of dynamic behavior. The parameters A
and B
accept
the observation time t and a state vector X_{t},
and return an array of appropriate dimension. Specifically, parameters A
and B
evaluate
the corresponding driftrate component. Even if you originally specified
an input as an array, drift
treats it as a static
function of time and state, by that means guaranteeing that all parameters
are accessible by the same interface.
AitSahalia, Y. “Testing ContinuousTime Models of the Spot Interest Rate.” The Review of Financial Studies, Spring 1996, Vol. 9, No. 2, pp. 385–426.
AitSahalia, Y. “Transition Densities for Interest Rate and Other Nonlinear Diffusions.” The Journal of Finance, Vol. 54, No. 4, August 1999.
Glasserman, P. Monte Carlo Methods in Financial Engineering. New York, SpringerVerlag, 2004.
Hull, J. C. Options, Futures, and Other Derivatives, 5th ed. Englewood Cliffs, NJ: Prentice Hall, 2002.
Johnson, N. L., S. Kotz, and N. Balakrishnan. Continuous Univariate Distributions. Vol. 2, 2nd ed. New York, John Wiley & Sons, 1995.
Shreve, S. E. Stochastic Calculus for Finance II: ContinuousTime Models. New York: SpringerVerlag, 2004.