Diffusion - Maple Help

Finance

 Diffusion
 compute the diffusion component of an Ito process

 Calling Sequence Diffusion(X) Diffusion(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 Diffusion(X) calling sequence computes the diffusion 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 Diffusion command will return $\mathrm{\sigma }\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 diffusion term. This procedure will accept two parameters: the value of the state variable and the time, and return the corresponding value of the diffusion. In the second case, Ito's lemma will be applied to calculate the diffusion term of X. Note that the Diffusion 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 Diffusion command determines how to compute the diffusion and volatility for all supported Ito-type processes.

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

You can also use expressions involving stochastic variables.

 > $W≔\mathrm{WienerProcess}\left(\right)$
 ${W}{≔}{\mathrm{_W}}$ (4)
 > $\mathrm{Diffusion}\left(at+bW\left(t\right)\right)$
 ${b}$ (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{Diffusion}\left(X\left(t\right)\right)}{X\left(t\right)}\right)$
 ${b}$ (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{Diffusion}\left(Y\left(t\right)\right)}{Y\left(t\right)}\right)$
 $\left[\begin{array}{cc}{b}& {c}\end{array}\right]$ (10)
 > $\mathrm{Diffusion}\left(⟨X\left(t\right),Y\left(t\right)⟩\right)$
 $\left[\begin{array}{cc}{b}{}{{ⅇ}}^{{a}{}{t}{+}{b}{}{\mathrm{_W}}{}\left({t}\right)}& {0}\\ {b}{}{{ⅇ}}^{{a}{}{t}{+}{b}{}{\mathrm{_W}}{}\left({t}\right){+}{c}{}{\mathrm{_W0}}{}\left({t}\right)}& {c}{}{{ⅇ}}^{{a}{}{t}{+}{b}{}{\mathrm{_W}}{}\left({t}\right){+}{c}{}{\mathrm{_W0}}{}\left({t}\right)}\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{Diffusion}\left(Z\left(t\right)\right)}{Z\left(t\right)}\right)$
 $\left[\begin{array}{cc}{b}{+}{0.500000000000000}{}{c}& {0.500000000000000}{}{b}{+}{c}\end{array}\right]$ (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[Diffusion] command was introduced in Maple 15.