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

 > $\mathrm{with}\left(\mathrm{Finance}\right):$

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

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

You can also use expressions involving stochastic variables.

 > $W≔\mathrm{WienerProcess}\left(\right)$
 ${W}{≔}{\mathrm{_W}}$ (4)
 > $\mathrm{Drift}\left(at+bW\left(t\right)\right)$
 ${a}$ (5)
 > $X≔t↦\mathrm{exp}\left(a\cdot t+b\cdot W\left(t\right)\right)$
 ${X}{≔}{t}{↦}{{ⅇ}}^{{a}{\cdot }{t}{+}{b}{\cdot }{W}{}\left({t}\right)}$ (6)
 > $\mathrm{simplify}\left(\frac{\mathrm{Drift}\left(X\left(t\right)\right)}{X\left(t\right)}\right)$
 ${a}{+}\frac{{{b}}^{{2}}}{{2}}$ (7)
 > $U≔\mathrm{WienerProcess}\left(\right)$
 ${U}{≔}{\mathrm{_W0}}$ (8)
 > $Y≔t↦\mathrm{exp}\left(a\cdot t+b\cdot W\left(t\right)+c\cdot U\left(t\right)\right)$
 ${Y}{≔}{t}{↦}{{ⅇ}}^{{a}{\cdot }{t}{+}{b}{\cdot }{W}{}\left({t}\right){+}{c}{\cdot }{U}{}\left({t}\right)}$ (9)
 > $\mathrm{simplify}\left(\frac{\mathrm{Drift}\left(Y\left(t\right)\right)}{Y\left(t\right)}\right)$
 ${a}{+}\frac{{{b}}^{{2}}}{{2}}{+}\frac{{{c}}^{{2}}}{{2}}$ (10)
 > $\mathrm{Drift}\left(⟨X\left(t\right),Y\left(t\right)⟩\right)$
 $\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.

 > $\mathrm{\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≔\mathrm{WienerProcess}\left(\mathrm{\Sigma }\right)$
 ${V}{≔}{\mathrm{_W1}}$ (13)
 > $Z≔t↦\mathrm{exp}\left(a\cdot t+b\cdot V\left(t\right)\left[1\right]+c\cdot V\left(t\right)\left[2\right]\right)$
 ${Z}{≔}{t}{↦}{{ⅇ}}^{{a}{\cdot }{t}{+}{b}{\cdot }{{V}{}\left({t}\right)}_{{1}}{+}{c}{\cdot }{{V}{}\left({t}\right)}_{{2}}}$ (14)
 > $\mathrm{simplify}\left(\frac{\mathrm{Drift}\left(Z\left(t\right)\right)}{Z\left(t\right)}\right)$
 ${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.