Documentation 
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 NVARSby1 vectorvalued function F of the general form:
$$F(t,{X}_{t})=A(t)+B(t){X}_{t}$$  (185) 
associated with a vectorvalued SDE of the form
$$d{X}_{t}=F(t,{X}_{t})dt+G(t,{X}_{t})d{W}_{t}$$
where:
X_{t} is an NVARSby1 state vector of process variables.
dW_{t} is an NBROWNSby1 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.
Note: 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 A as an array, it must be an NVARSby1
column vector. As a deterministic function of time, when A is
called with a realvalued scalar time t as its
only input, A must produce an NVARSby1 column
vector. If you specify A as a function of time
and state, it must return an NVARSby1 column
vector when invoked with two inputs:

B  This argument represents the parameter B.
If you specify B as an array, it must be an NVARSbyNVARS 2dimensional
matrix. As a deterministic function of time, when B is
called with a realvalued scalar time t as its
only input, B must produce an NVARSbyNVARS matrix.
If you specify B as a function of time and state,
it must return an NVARSbyNVARS column
vector when invoked with two inputs:

DriftRate  Object of class drift that encapsulates
the composite driftrate specification, with the following displayed
parameters:

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.