Finance - Maple Programming Help

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

Finance

 GaussMarkovProcess
 create new Gauss-Markov short-rate process

 Calling Sequence GaussMarkovProcess(${r}_{0}$, g, h, sigma, t, opts)

Parameters

 ${r}_{0}$ - algebraic expression; initial value g - algebraic expression, procedure, or yield term structure; coefficient in the SDE h - algebraic expression, procedure, or yield term structure; coefficient in the SDE sigma - algebraic expression, procedure, or yield term structure; the non-negative volatility t - (optional) name; time variable opts - (optional) equation(s) of the form option = value where option is scheme; specify options for the GaussMarkovProcess command

Options

 • scheme = unbiased or Euler -- This option specifies which discretization scheme should be used for simulating the process. By default the standard Euler scheme is used. When scheme is set to unbiased the transition density will be used to simulate a value $X\left(t+\mathrm{dt}\right)$ given $X\left(t\right)$.

Description

 • The GaussMarkovProcess command creates a linear Gauss-Markov stochastic process $X\left(t\right)$, which is governed by the stochastic differential equation (SDE)

$\mathrm{dX}\left(t\right)=\left(g\left(t\right)+h\left(t\right)X\left(t\right)\right)\mathrm{dt}+\mathrm{\sigma }\left(t\right)\mathrm{dW}\left(t\right)$

 The function $g\left(t\right)$ is selected so that the model fits the initial term structure. The functions $h\left(t\right)$ and $\mathrm{\sigma }\left(t\right)$ are volatility parameters that are chosen to fit the market prices of a set of actively traded interest rate options.
 • This process can be used to model short-term interest rates. This model - introduced by Hull and White (1990) - contains many popular term structure models as special cases.

 Vasicek model: $g\left(t\right)$, $h\left(t\right)$ and $\mathrm{\sigma }\left(t\right)$ are constant. Ho-Lee model: $h\left(t\right)=0$ and $\mathrm{\sigma }\left(t\right)$ is constant. Hull-White model: $h\left(t\right)$ and $\mathrm{\sigma }\left(t\right)$ are constant.

 • The parameter ${r}_{0}$ defines the initial value of the underlying stochastic process.
 • The parameters g, h, and sigma can each be either an algebraic expression, a procedure, or a yield term structure. If the process is to be simulated, it must be possible to evaluate these parameters to numeric values.

Examples

 > $\mathrm{with}\left(\mathrm{Finance}\right):$
 > $V≔\mathrm{GaussMarkovProcess}\left(0.5,0.2,-1.0,0.3\right):$
 > $\mathrm{PathPlot}\left(V\left(t\right),t=0..30,\mathrm{timesteps}=100,\mathrm{replications}=5,\mathrm{color}=\mathrm{red}..\mathrm{blue},\mathrm{thickness}=3,\mathrm{axes}=\mathrm{BOXED},\mathrm{gridlines}=\mathrm{true}\right)$
 > $T≔\left[2.0,5.0,10.0,30.0\right]$
 ${T}{:=}\left[{2.0}{,}{5.0}{,}{10.0}{,}{30.0}\right]$ (1)
 > $R≔\left[0.04976,0.04970,0.05064,0.05143\right]$
 ${R}{:=}\left[{0.04976}{,}{0.04970}{,}{0.05064}{,}{0.05143}\right]$ (2)
 > $g≔\mathrm{CurveFitting}:-\mathrm{Spline}\left(T,R,t,\mathrm{degree}=1\right)$
 ${g}{:=}{{}\begin{array}{cc}{0.04980000000}{-}{0.00002000000000}{}{t}& {t}{<}{5.0}\\ {0.04876000000}{+}{0.0001880000000}{}{t}& {t}{<}{10.0}\\ {0.05024500000}{+}{0.00003950000000}{}{t}& {\mathrm{otherwise}}\end{array}$ (3)
 > $R≔\mathrm{GaussMarkovProcess}\left(0.1,g,-1.0,0.3,t\right)$
 ${R}{:=}{\mathrm{_X0}}$ (4)
 > $\mathrm{PathPlot}\left(R\left(t\right),t=0..30,\mathrm{timesteps}=100,\mathrm{replications}=5,\mathrm{color}=\mathrm{red}..\mathrm{blue},\mathrm{thickness}=3,\mathrm{axes}=\mathrm{BOXED},\mathrm{gridlines}=\mathrm{true}\right)$
 > $\mathrm{rates}≔\left[0.02,0.01,0.04,0.06,0.07\right]:$
 > $\mathrm{times}≔\left[0.0,0.5,1.0,1.5,2.0\right]:$
 > $R≔\mathrm{ZeroCurve}\left(\mathrm{times},\mathrm{rates}\right)$
 ${R}{:=}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}$ (5)
 > $X≔\mathrm{GaussMarkovProcess}\left(0.02,R,1.0,0.1\right)$
 ${X}{:=}{\mathrm{_X1}}$ (6)
 > $\mathrm{PathPlot}\left(X\left(t\right),t=0..2,\mathrm{timesteps}=100,\mathrm{replications}=10,\mathrm{axes}=\mathrm{BOXED},\mathrm{gridlines}=\mathrm{true}\right)$
 > $\mathrm{rates}≔\left[0.02,0.01,0.04,0.06,0.07\right]:$
 > $\mathrm{times}≔\left[0.0,0.5,1.0,1.5,2.0\right]:$
 > $R≔\mathrm{ZeroCurve}\left(\mathrm{times},\mathrm{rates}\right)$
 ${R}{:=}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}$ (7)
 > $Y≔\mathrm{GaussMarkovProcess}\left(0.02,R,1.0,0.1,t,\mathrm{scheme}=\mathrm{unbiased}\right)$
 ${Y}{:=}{\mathrm{_X2}}$ (8)
 > $\mathrm{PathPlot}\left(Y\left(t\right),t=0..2,\mathrm{timesteps}=100,\mathrm{replications}=10,\mathrm{axes}=\mathrm{BOXED},\mathrm{gridlines}=\mathrm{true}\right)$
 > $\mathrm{ExpectedValue}\left(Y\left(1\right),\mathrm{replications}={10}^{4}\right)$
 $\left[{\mathrm{value}}{=}{0.08445415108}{,}{\mathrm{standarderror}}{=}{0.001785016918}\right]$ (9)
 > $\mathrm{SampleValues}\left(Y\left(1\right),\mathrm{replications}={10}^{4}\right)$
 $\left[\begin{array}{c}{\mathrm{1 .. 10000}}{\mathrm{Array}}\\ {\mathrm{Data Type:}}{{\mathrm{float}}}_{{8}}\\ {\mathrm{Storage:}}{\mathrm{rectangular}}\\ {\mathrm{Order:}}{\mathrm{C_order}}\end{array}\right]$ (10)

Note that the overhead of computing the transition densities does not depend on the number of replications.

 > $\mathrm{time}\left(\mathrm{SamplePath}\left(Y\left(t\right),t=0..2,\mathrm{timesteps}=100,\mathrm{replications}=10\right)\right)$
 ${1.280}$ (11)
 > $\mathrm{time}\left(\mathrm{SamplePath}\left(Y\left(t\right),t=0..2,\mathrm{timesteps}=100,\mathrm{replications}={10}^{4}\right)\right)$
 ${1.353}$ (12)

References

 Brigo, D., Mercurio, F., Interest Rate Models: Theory and Practice. New York: Springer-Verlag, 2001.
 Glasserman, P., Monte Carlo Methods in Financial Engineering. New York: Springer-Verlag, 2004.
 Ho, T.S.Y, and Loo, S.-B., Term Structure Movements and Pricing Interest Rate Contingent Claims, Journal of Finance, 41 (1986), pp. 1011-29.
 Hull, J., Options, Futures, and Other Derivatives, 5th. edition. Upper Saddle River, New Jersey: Prentice Hall, 2003.
 Hull, J., and White, A., Pricing Interest Rate Derivative Securities, Review of Financial Studies, 3 (1990), pp. 573-92.
 Vasicek, O.A., An Equilibrium Characterization of the Term Structure, Journal of Financial Economics, 5 (1977), pp. 177-88.

Compatibility

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