 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

 > with(Finance):
 > Y := ItoProcess(1.0, mu, sigma, x, t);
 ${Y}{≔}{\mathrm{_X0}}$ (1)
 > Drift(Y(t));
 ${\mathrm{\mu }}$ (2)
 > Diffusion(Y(t));
 ${\mathrm{\sigma }}$ (3)
 > Drift(exp(Y(t)));
 ${\mathrm{\mu }}{}{{ⅇ}}^{{\mathrm{_X0}}{}\left({t}\right)}{+}\frac{{{\mathrm{\sigma }}}^{{2}}{}{{ⅇ}}^{{\mathrm{_X0}}{}\left({t}\right)}}{{2}}$ (4)
 > Diffusion(exp(Y(t)));
 ${\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).

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

 > mu := 'mu';
 ${\mathrm{\mu }}{≔}{\mathrm{\mu }}$ (8)
 > sigma := 'sigma';
 ${\mathrm{\sigma }}{≔}{\mathrm{\sigma }}$ (9)
 > X0 := <100.0, 0.0>;
 ${\mathrm{X0}}{≔}\left[\begin{array}{c}{100.0}\\ {0.}\end{array}\right]$ (10)
 > Mu := ;
 ${\mathrm{Μ}}{≔}\left[\begin{array}{c}{\mathrm{\mu }}{}{{X}}_{{1}}\\ {\mathrm{\kappa }}{}\left({\mathrm{\theta }}{-}{{X}}_{{2}}\right)\end{array}\right]$ (11)
 > Sigma := <,<0.0|sigma*X>>;
 ${\mathrm{\Sigma }}{≔}\left[\begin{array}{cc}\sqrt{{{X}}_{{2}}}{}{{X}}_{{1}}& {0.}\\ {0.}& {\mathrm{\sigma }}{}{{X}}_{{2}}\end{array}\right]$ (12)
 > S := ItoProcess(X0, Mu, Sigma, X, t);
 ${S}{≔}{\mathrm{_X2}}$ (13)
 > Drift(S(t));
 $\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)
 > Diffusion(S(t));
 $\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)
 > mu := 0.1;
 ${\mathrm{\mu }}{≔}{0.1}$ (16)
 > sigma := 0.5;
 ${\mathrm{\sigma }}{≔}{0.5}$ (17)
 > kappa := 1.0;
 ${\mathrm{\kappa }}{≔}{1.0}$ (18)
 > theta := 0.4;
 ${\mathrm{\theta }}{≔}{0.4}$ (19)
 > A := SamplePath(S(t), t = 0..1, timesteps = 100, replications = 10);
  (20)
 > PathPlot(A, 1, thickness = 3, markers = false, color = red..blue, axes = BOXED, gridlines = true); > PathPlot(A, 2, thickness = 3, markers = false, color = red..blue, axes = BOXED, gridlines = true); > ExpectedValue(max(S(1)-100, 0), timesteps = 100, replications = 10^4);
 $\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 := GeometricBrownianMotion(100.0, 0.05, 0.3, t);
 ${X}{≔}{\mathrm{_X4}}$ (22)
 > Y := GeometricBrownianMotion(100.0, 0.07, 0.2, t);
 ${Y}{≔}{\mathrm{_X5}}$ (23)
 > Sigma := <<1|0.5>,<0.5|1>>;
 ${\mathrm{\Sigma }}{≔}\left[\begin{array}{cc}{1}& {0.5}\\ {0.5}& {1}\end{array}\right]$ (24)
 > Z := ItoProcess(, Sigma);
 ${Z}{≔}{\mathrm{_X6}}$ (25)
 > Drift(Z(t));
 $\left[\begin{array}{c}{0.05}{}{{\mathrm{_X6}}{}\left({t}\right)}_{{1}}\\ {0.07}{}{{\mathrm{_X6}}{}\left({t}\right)}_{{2}}\end{array}\right]$ (26)
 > Diffusion(Z(t));
 $\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)
 > ExpectedValue(max(X(1)-Y(1), 0), timesteps = 100, replications = 10^4);
 $\left[{\mathrm{value}}{=}{14.32896059}{,}{\mathrm{standarderror}}{=}{0.2447103632}\right]$ (28)
 > ExpectedValue(max(Z(1)-Z(1), 0), timesteps = 100, replications = 10^4);
 $\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.