 ItoProcess - Maple Help

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{\mu },\mathrm{\sigma },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(\mathrm{exp}\left(Y\left(t\right)\right)\right)$
 ${\mathrm{\mu }}{}{{ⅇ}}^{{\mathrm{_X0}}{}\left({t}\right)}{+}\frac{{{\mathrm{\sigma }}}^{{2}}{}{{ⅇ}}^{{\mathrm{_X0}}{}\left({t}\right)}}{{2}}$ (4)
 > $\mathrm{Diffusion}\left(\mathrm{exp}\left(Y\left(t\right)\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{\mu }≔0.1$
 ${\mathrm{\mu }}{≔}{0.1}$ (6)
 > $\mathrm{\sigma }≔0.5$
 ${\mathrm{\sigma }}{≔}{0.5}$ (7)
 > $\mathrm{PathPlot}\left(\mathrm{exp}\left(Y\left(t\right)\right),t=0..3,\mathrm{timesteps}=100,\mathrm{replications}=10\right)$ Here is an example of a multi-dimensional Ito process.

 > $\mathrm{\mu }≔'\mathrm{\mu }'$
 ${\mathrm{\mu }}{≔}{\mathrm{\mu }}$ (8)
 > $\mathrm{\sigma }≔'\mathrm{\sigma }'$
 ${\mathrm{\sigma }}{≔}{\mathrm{\sigma }}$ (9)
 > $\mathrm{X0}≔⟨100.0,0.⟩$
 ${\mathrm{X0}}{≔}\left[\begin{array}{c}{100.0}\\ {0.}\end{array}\right]$ (10)
 > $\mathrm{Μ}≔⟨\mathrm{\mu }X\left[1\right],\mathrm{\kappa }\left(\mathrm{\theta }-X\left[2\right]\right)⟩$
 ${\mathrm{Μ}}{≔}\left[\begin{array}{c}{\mathrm{\mu }}{}{{X}}_{{1}}\\ {\mathrm{\kappa }}{}\left({\mathrm{\theta }}{-}{{X}}_{{2}}\right)\end{array}\right]$ (11)
 > $\mathrm{\Sigma }≔⟨⟨\mathrm{sqrt}\left(X\left[2\right]\right)X\left[1\right]|0.⟩,⟨0.|\mathrm{\sigma }X\left[2\right]⟩⟩$
 ${\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{\Sigma },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{\mu }≔0.1$
 ${\mathrm{\mu }}{≔}{0.1}$ (16)
 > $\mathrm{\sigma }≔0.5$
 ${\mathrm{\sigma }}{≔}{0.5}$ (17)
 > $\mathrm{\kappa }≔1.0$
 ${\mathrm{\kappa }}{≔}{1.0}$ (18)
 > $\mathrm{\theta }≔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)$
 ${A}{≔}\begin{array}{c}\left[\begin{array}{cc}{100.}& {100.670084719786}\\ {100.100000000000}& {101.034139425728}\\ {100.280880089808}& {101.924198818577}\\ {102.915077811759}& {99.6518477031121}\\ {103.858818858166}& {100.628185358730}\\ {104.476699657855}& {98.7691518445139}\\ {103.737362966326}& {95.0859221941374}\\ {102.574346549913}& {94.1008617878134}\\ {101.159282939668}& {92.9644135833222}\\ {100.709702216007}& {93.6061768383076}\end{array}\right]\\ \hfill {\text{slice of 10 × 2 × 101 Array}}\end{array}$ (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)\left[1\right]-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{\Sigma }≔⟨⟨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{\Sigma }\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)\left[1\right]-Z\left(1\right)\left[2\right],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.