Finance - Maple Programming Help

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

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{θ},\mathrm{κ},\mathrm{σ}\right)$
 ${X}{≔}{\mathrm{_X}}$ (1)
 > $\mathrm{Diffusion}\left(X\right)$
 $\left({x}{,}{t}\right){→}{\mathrm{σ}}$ (2)
 > $\mathrm{Diffusion}\left(X\left(t\right)\right)$
 ${\mathrm{σ}}$ (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→{ⅇ}^{at+bW\left(t\right)}$
 ${X}{≔}{t}{→}{{ⅇ}}^{{a}{}{t}{+}{b}{}{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→{ⅇ}^{at+bW\left(t\right)+cU\left(t\right)}$
 ${Y}{≔}{t}{→}{{ⅇ}}^{{a}{}{t}{+}{b}{}{W}{}\left({t}\right){+}{c}{}{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{Σ}≔⟨⟨1.0|0.5⟩,⟨0.5|1.0⟩⟩$
 ${\mathrm{Σ}}{≔}\left[\begin{array}{cc}{1.0}& {0.5}\\ {0.5}& {1.0}\end{array}\right]$ (12)
 > $V≔\mathrm{WienerProcess}\left(\mathrm{Σ}\right)$
 ${V}{≔}{\mathrm{_W1}}$ (13)
 > $Z≔t→{ⅇ}^{at+b{V\left(t\right)}_{1}+c{V\left(t\right)}_{2}}$
 ${Z}{≔}{t}{→}{{ⅇ}}^{{a}{}{t}{+}{b}{}{{V}{}\left({t}\right)}_{{1}}{+}{c}{}{{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}{1.}{}{b}{+}{0.500000000000000}{}{c}& {0.500000000000000}{}{b}{+}{1.}{}{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.