Finance - Maple Programming Help

Home : Support : Online Help : Mathematics : Finance : Stochastic Processes : Finance/Drift

Finance

 Drift
 compute the drift component of an Ito process

 Calling Sequence Drift(X) Drift(f, mu, sigma, X, t)

Parameters

 X - stochastic process, expression involving stochastic variables f - algebraic expression involving stochastic variables mu - algebraic expression, drift term of the original process sigma - algebraic expression, diffusion term of the original process X - name, stochastic variable t - name, time variable

Description

 • The Drift(X) calling sequence computes the drift term of an Ito process X. That is, given a process $X\left(t\right)$ governed by the stochastic differential equation (SDE)

$\mathrm{dX}\left(t\right)=\mathrm{\mu }\left(X\left(t\right),t\right)\mathrm{dt}+\mathrm{\sigma }\left(X\left(t\right),t\right)\mathrm{dW}\left(t\right)$

the Drift command will return $\mathrm{mu}\left(X\left(t\right),t\right)$.

 • The parameter X can be either a stochastic process or an expression involving stochastic variables. In the first case a Maple procedure is applied for computing the drift term. This procedure will accept two parameters: the value of the state variable and the time, and return the corresponding value of the drift. In the second case, Ito's lemma will be applied to calculate the drift term of X. Note that the Drift command will perform formal computations; the validity of these computations for a given function f will not be verified.

Examples

 > with(Finance):

The Drift command knows how to compute the drift for all supported Ito-type processes.

 > X := OrnsteinUhlenbeckProcess(0, theta, kappa, sigma);
 ${X}{≔}{\mathrm{_X0}}$ (1)
 > Drift(X);
 $\left({x}{,}{t}\right){↦}{\mathrm{\kappa }}{\cdot }\left({\mathrm{\theta }}{-}{x}\right)$ (2)
 > Drift(X(t));
 ${\mathrm{\kappa }}{}\left({\mathrm{\theta }}{-}{\mathrm{_X0}}{}\left({t}\right)\right)$ (3)

You can also use expressions involving stochastic variables.

 > W := WienerProcess();
 ${W}{≔}{\mathrm{_W}}$ (4)
 > Drift(a*t+b*W(t));
 ${a}$ (5)
 > X := t -> exp(a*t+b*W(t));
 ${X}{≔}{t}{↦}{{ⅇ}}^{{a}{\cdot }{t}{+}{b}{\cdot }{W}{}\left({t}\right)}$ (6)
 > simplify(Drift(X(t))/X(t));
 ${a}{+}\frac{{{b}}^{{2}}}{{2}}$ (7)
 > U := WienerProcess();
 ${U}{≔}{\mathrm{_W0}}$ (8)
 > Y := t -> exp(a*t+b*W(t)+c*U(t));
 ${Y}{≔}{t}{↦}{{ⅇ}}^{{a}{\cdot }{t}{+}{b}{\cdot }{W}{}\left({t}\right){+}{c}{\cdot }{U}{}\left({t}\right)}$ (9)
 > simplify(Drift(Y(t))/Y(t));
 ${a}{+}\frac{{{b}}^{{2}}}{{2}}{+}\frac{{{c}}^{{2}}}{{2}}$ (10)
 > Drift();
 $\left[\begin{array}{c}{a}{}{{ⅇ}}^{{a}{}{t}{+}{b}{}{\mathrm{_W}}{}\left({t}\right)}{+}\frac{{{b}}^{{2}}{}{{ⅇ}}^{{a}{}{t}{+}{b}{}{\mathrm{_W}}{}\left({t}\right)}}{{2}}\\ {a}{}{{ⅇ}}^{{a}{}{t}{+}{b}{}{\mathrm{_W}}{}\left({t}\right){+}{c}{}{\mathrm{_W0}}{}\left({t}\right)}{+}\frac{{{b}}^{{2}}{}{{ⅇ}}^{{a}{}{t}{+}{b}{}{\mathrm{_W}}{}\left({t}\right){+}{c}{}{\mathrm{_W0}}{}\left({t}\right)}}{{2}}{+}\frac{{{c}}^{{2}}{}{{ⅇ}}^{{a}{}{t}{+}{b}{}{\mathrm{_W}}{}\left({t}\right){+}{c}{}{\mathrm{_W0}}{}\left({t}\right)}}{{2}}\end{array}\right]$ (11)

The following example deals with two correlated one-dimensional Wiener processes.

 > Sigma := <<1.0|0.5>,<0.5|1.0>>;
 ${\mathrm{\Sigma }}{≔}\left[\begin{array}{cc}{1.0}& {0.5}\\ {0.5}& {1.0}\end{array}\right]$ (12)
 > V := WienerProcess(Sigma);
 ${V}{≔}{\mathrm{_W1}}$ (13)
 > Z := t -> exp(a*t+b*V(t)[1]+c*V(t)[2]);
 ${Z}{≔}{t}{↦}{{ⅇ}}^{{a}{\cdot }{t}{+}{b}{\cdot }{{V}{}\left({t}\right)}_{{1}}{+}{c}{\cdot }{{V}{}\left({t}\right)}_{{2}}}$ (14)
 > simplify(Drift(Z(t))/Z(t));
 ${a}{+}{0.625000000000000}{}{{b}}^{{2}}{+}{b}{}{c}{+}{0.625000000000000}{}{{c}}^{{2}}$ (15)

References

 Glasserman, P., Monte Carlo Methods in Financial Engineering. New York: Springer-Verlag, 2004.
 Hull, J., Options, Futures, and Other Derivatives, 5th. edition. Upper Saddle River, New Jersey: Prentice Hall, 2003.
 Kloeden, P., and Platen, E., Numerical Solution of Stochastic Differential Equations, New York: Springer-Verlag, 1999.

Compatibility

 • The Finance[Drift] command was introduced in Maple 15.