Finance - Maple Programming Help

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

Finance

 ItoProcess
 create new Ito process

 Calling Sequence ItoProcess(${x}_{0}$, mu, sigma) ItoProcess(${x}_{0}$, mu, sigma, x, t) ItoProcess(X, Sigma)

Parameters

 ${x}_{0}$ - the initial value mu - the drift parameter sigma - volatility parameter X - Vector of one-dimensional Ito processes Sigma - matrix

Description

 • The ItoProcess command creates a new one- or multi-dimensional Ito process, which is a stochastic 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)$

where

 – $\mathrm{\mu }\left(X\left(t\right),t\right)$ is the drift parameter
 – $\mathrm{\sigma }\left(X\left(t\right),t\right)$ is the diffusion parameter

and

 – $W\left(t\right)$ is the standard Wiener process.
 • The parameter ${x}_{0}$ defines the initial value of the underlying stochastic process. It must be a real constant.
 • The parameter mu is the drift. In the simplest case of a constant drift mu is real number (that is, any expression of type realcons). Time-dependent drift can be given either as an algebraic expression or as a Maple procedure. If mu is given as an algebraic expression, then the parameter t must be passed to specify which variable in mu should be used as a time variable. A Maple procedure defining a time-dependent drift must accept one parameter (the time) and return the corresponding value for the drift.
 • The parameter sigma is the diffusion. Similar to the drift parameter, the volatility can be constant or time-dependent.
 • One can use the ItoProcess command to construct a multi-dimensional Ito process with the given correlation structure. To be more precise, assume that $X$ is an $n$-dimensional vector whose components ${X}_{1}$, ..., ${X}_{n}$ are one-dimensional Ito processes. Let ${\mathrm{\mu }}_{1}$,...,${\mathrm{\mu }}_{n}$, and ${\mathrm{\sigma }}_{1}$,...,${\mathrm{\sigma }}_{n}$ be the corresponding drift and diffusion terms. The ItoProcess(X, Sigma) command will create an $n$-dimensional Ito process $Y$ such that

${\mathrm{dY}\left(t\right)}_{i}={\mathrm{\mu }}_{i}\left({Y\left(t\right)}_{i},t\right)+{\mathrm{\sigma }}_{i}\left({Y\left(t\right)}_{i},t\right){\mathrm{dW}\left(t\right)}_{i}$

where $W\left(t\right)$ is an $n$-dimensional Wiener process whose covariance matrix is Sigma. Note that the matrix Sigma must have numeric coefficients.

Examples

 > $\mathrm{with}\left(\mathrm{Finance}\right):$
 > $Y≔\mathrm{ItoProcess}\left(1.0,\mathrm{μ},\mathrm{σ},x,t\right)$
 ${Y}{≔}{\mathrm{_X0}}$ (1)
 > $\mathrm{Drift}\left(Y\left(t\right)\right)$
 ${\mathrm{\mu }}$ (2)
 > $\mathrm{Diffusion}\left(Y\left(t\right)\right)$
 ${\mathrm{\sigma }}$ (3)
 > $\mathrm{Drift}\left({ⅇ}^{Y\left(t\right)}\right)$
 ${\mathrm{\mu }}{}{{ⅇ}}^{{\mathrm{_X0}}{}\left({t}\right)}{+}\frac{{{\mathrm{\sigma }}}^{{2}}{}{{ⅇ}}^{{\mathrm{_X0}}{}\left({t}\right)}}{{2}}$ (4)
 > $\mathrm{Diffusion}\left({ⅇ}^{Y\left(t\right)}\right)$
 ${\mathrm{\sigma }}{}{{ⅇ}}^{{\mathrm{_X0}}{}\left({t}\right)}$ (5)

You can generate sample paths for this stochastic process (in order to do this, we must assign numeric values to mu and sigma).

 > $\mathrm{μ}≔0.1$
 ${\mathrm{\mu }}{≔}{0.1}$ (6)
 > $\mathrm{σ}≔0.5$
 ${\mathrm{\sigma }}{≔}{0.5}$ (7)
 > $\mathrm{PathPlot}\left({ⅇ}^{Y\left(t\right)},t=0..3,\mathrm{timesteps}=100,\mathrm{replications}=10\right)$ Here is an example of a multi-dimensional Ito process.

 > $\mathrm{μ}≔'\mathrm{μ}'$
 ${\mathrm{\mu }}{≔}{\mathrm{\mu }}$ (8)
 > $\mathrm{σ}≔'\mathrm{σ}'$
 ${\mathrm{\sigma }}{≔}{\mathrm{\sigma }}$ (9)
 > $\mathrm{X0}≔⟨100.0,0.0⟩$
 ${\mathrm{X0}}{≔}\left[\begin{array}{c}{100.0}\\ {0.}\end{array}\right]$ (10)
 > $\mathrm{Μ}≔⟨\mathrm{μ}{X}_{1},\mathrm{κ}\left(\mathrm{θ}-{X}_{2}\right)⟩$
 ${\mathrm{Μ}}{≔}\left[\begin{array}{c}{\mathrm{\mu }}{}{{X}}_{{1}}\\ {\mathrm{\kappa }}{}\left({\mathrm{\theta }}{-}{{X}}_{{2}}\right)\end{array}\right]$ (11)
 > $\mathrm{Σ}≔⟨⟨\sqrt{{X}_{2}}{X}_{1}|0.0⟩,⟨0.0|\mathrm{σ}{X}_{2}⟩⟩$
 ${\mathrm{\Sigma }}{≔}\left[\begin{array}{cc}\sqrt{{{X}}_{{2}}}{}{{X}}_{{1}}& {0.}\\ {0.}& {\mathrm{\sigma }}{}{{X}}_{{2}}\end{array}\right]$ (12)
 > $S≔\mathrm{ItoProcess}\left(\mathrm{X0},\mathrm{Μ},\mathrm{Σ},X,t\right)$
 ${S}{≔}{\mathrm{_X2}}$ (13)
 > $\mathrm{Drift}\left(S\left(t\right)\right)$
 $\left[\begin{array}{c}{\mathrm{\mu }}{}{{\mathrm{_X2}}{}\left({t}\right)}_{{1}}\\ {\mathrm{\kappa }}{}\left({\mathrm{\theta }}{-}{{\mathrm{_X2}}{}\left({t}\right)}_{{2}}\right)\end{array}\right]$ (14)
 > $\mathrm{Diffusion}\left(S\left(t\right)\right)$
 $\left[\begin{array}{cc}\sqrt{{{\mathrm{_X2}}{}\left({t}\right)}_{{2}}}{}{{\mathrm{_X2}}{}\left({t}\right)}_{{1}}& {0}\\ {0}& {\mathrm{\sigma }}{}{{\mathrm{_X2}}{}\left({t}\right)}_{{2}}\end{array}\right]$ (15)
 > $\mathrm{μ}≔0.1$
 ${\mathrm{\mu }}{≔}{0.1}$ (16)
 > $\mathrm{σ}≔0.5$
 ${\mathrm{\sigma }}{≔}{0.5}$ (17)
 > $\mathrm{κ}≔1.0$
 ${\mathrm{\kappa }}{≔}{1.0}$ (18)
 > $\mathrm{θ}≔0.4$
 ${\mathrm{\theta }}{≔}{0.4}$ (19)
 > $A≔\mathrm{SamplePath}\left(S\left(t\right),t=0..1,\mathrm{timesteps}=100,\mathrm{replications}=10\right)$
  (20)
 > $\mathrm{PathPlot}\left(A,1,\mathrm{thickness}=3,\mathrm{markers}=\mathrm{false},\mathrm{color}=\mathrm{red}..\mathrm{blue},\mathrm{axes}=\mathrm{BOXED},\mathrm{gridlines}=\mathrm{true}\right)$ > $\mathrm{PathPlot}\left(A,2,\mathrm{thickness}=3,\mathrm{markers}=\mathrm{false},\mathrm{color}=\mathrm{red}..\mathrm{blue},\mathrm{axes}=\mathrm{BOXED},\mathrm{gridlines}=\mathrm{true}\right)$ > $\mathrm{ExpectedValue}\left(\mathrm{max}\left({S\left(1\right)}_{1}-100,0\right),\mathrm{timesteps}=100,\mathrm{replications}={10}^{4}\right)$
 $\left[{\mathrm{value}}{=}{21.41114565}{,}{\mathrm{standarderror}}{=}{0.3390630872}\right]$ (21)

In this example, construct a two-dimensional Ito process using two one-dimensional projections and a given covariance matrix.

 > $X≔\mathrm{GeometricBrownianMotion}\left(100.0,0.05,0.3,t\right)$
 ${X}{≔}{\mathrm{_X4}}$ (22)
 > $Y≔\mathrm{GeometricBrownianMotion}\left(100.0,0.07,0.2,t\right)$
 ${Y}{≔}{\mathrm{_X5}}$ (23)
 > $\mathrm{Σ}≔⟨⟨1|0.5⟩,⟨0.5|1⟩⟩$
 ${\mathrm{\Sigma }}{≔}\left[\begin{array}{cc}{1}& {0.5}\\ {0.5}& {1}\end{array}\right]$ (24)
 > $Z≔\mathrm{ItoProcess}\left(⟨X,Y⟩,\mathrm{Σ}\right)$
 ${Z}{≔}{\mathrm{_X6}}$ (25)
 > $\mathrm{Drift}\left(Z\left(t\right)\right)$
 $\left[\begin{array}{c}{0.05}{}{{\mathrm{_X6}}{}\left({t}\right)}_{{1}}\\ {0.07}{}{{\mathrm{_X6}}{}\left({t}\right)}_{{2}}\end{array}\right]$ (26)
 > $\mathrm{Diffusion}\left(Z\left(t\right)\right)$
 $\left[\begin{array}{cc}{0.3}{}{{\mathrm{_X6}}{}\left({t}\right)}_{{1}}& {0.15}{}{{\mathrm{_X6}}{}\left({t}\right)}_{{1}}\\ {0.10}{}{{\mathrm{_X6}}{}\left({t}\right)}_{{2}}& {0.2}{}{{\mathrm{_X6}}{}\left({t}\right)}_{{2}}\end{array}\right]$ (27)
 > $\mathrm{ExpectedValue}\left(\mathrm{max}\left(X\left(1\right)-Y\left(1\right),0\right),\mathrm{timesteps}=100,\mathrm{replications}={10}^{4}\right)$
 $\left[{\mathrm{value}}{=}{14.32896059}{,}{\mathrm{standarderror}}{=}{0.2447103632}\right]$ (28)
 > $\mathrm{ExpectedValue}\left(\mathrm{max}\left({Z\left(1\right)}_{1}-{Z\left(1\right)}_{2},0\right),\mathrm{timesteps}=100,\mathrm{replications}={10}^{4}\right)$
 $\left[{\mathrm{value}}{=}{8.103315185}{,}{\mathrm{standarderror}}{=}{0.1520913055}\right]$ (29)

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.

Compatibility

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