HestonProcess - Maple Help

Finance

 HestonProcess
 create new Heston process

 Calling Sequence HestonProcess(${x}_{0}$, ${v}_{0}$, mu, theta, kappa, sigma, rho)

Parameters

 ${x}_{0}$ - algebraic expression; initial value of the state variable ${v}_{0}$ - algebraic expression; initial value of the variance mu - algebraic expression; risk-neutral drift theta - algebraic expression; long-run mean of the variance process kappa - algebraic expression; speed of mean reversion of the variance process sigma - algebraic expression; volatility of the variance process rho - algebraic expression; instantaneous correlation between the return process and the volatility process

Description

 • The HestonProcess command creates a new stochastic process $S\left(t\right)$ governed by the following stochastic differential equation (SDE)

$\mathrm{dS}\left(t\right)=\mathrm{\mu }S\left(t\right)\mathrm{dt}+\sqrt{V\left(t\right)}S\left(t\right){\mathrm{dW}\left(t\right)}_{1}$

$\mathrm{dV}\left(t\right)=\mathrm{\kappa }\left(\mathrm{\theta }-V\left(t\right)\right)\mathrm{dt}+\mathrm{\sigma }\sqrt{V\left(t\right)}{\mathrm{dW}\left(t\right)}_{2}$

 where
 – $\mathrm{\mu }$ is the drift parameter
 – $\mathrm{\theta }$ is the long-run mean
 – $\mathrm{\kappa }$ is the speed of mean reversion
 – $\mathrm{\sigma }$ is the volatility of the variance process
 and
 – $W\left(t\right)$ is the two-dimensional Wiener process with instantaneous correlation $\mathrm{\rho }$.
 • This is a stochastic volatility process that was introduced by Heston in A Closed-Form Solution for Options with Stochastic Volatility with Applications to Bond and Currency Options.
 • The parameter ${X}_{0}$ defines the initial value of the underlying stochastic process.
 • The parameter mu is the drift parameter of state process.
 • The volatility of this process evolves as a SquareRootDiffusion.
 • The parameter kappa is the speed of mean-reversion of the variance process. The parameter theta is the long-term running mean of the variance process. The parameter sigma is the volatility of the variance process. In general, kappa, theta, and sigma can be any algebraic expressions. However, if the process is to be simulated, these parameters must be assigned numeric values.
 • The parameter rho is the instantaneous correlation between the state process and the volatility process.

Examples

 > $\mathrm{with}\left(\mathrm{Finance}\right):$
 > $S≔\mathrm{HestonProcess}\left(\mathrm{S0},\mathrm{V0},\mathrm{\mu },\mathrm{\theta },\mathrm{\kappa },\mathrm{\sigma },\mathrm{\rho }\right):$
 > $\mathrm{Drift}\left(S\left(t\right)\right)$
 $\left[\begin{array}{c}{\mathrm{\mu }}{}{{\mathrm{_X0}}{}\left({t}\right)}_{{1}}\\ {\mathrm{\kappa }}{}\left({t}{-}{{\mathrm{_X0}}{}\left({t}\right)}_{{2}}\right)\end{array}\right]$ (1)
 > $\mathrm{Diffusion}\left(S\left(t\right)\right)$
 $\left[\begin{array}{cc}\sqrt{{{\mathrm{_X0}}{}\left({t}\right)}_{{2}}}{}{\mathrm{\rho }}{}{{\mathrm{_X0}}{}\left({t}\right)}_{{1}}& \sqrt{{{\mathrm{_X0}}{}\left({t}\right)}_{{2}}}{}{{\mathrm{_X0}}{}\left({t}\right)}_{{1}}{}\sqrt{{-}{{\mathrm{\rho }}}^{{2}}{+}{1}}\\ \sqrt{{{\mathrm{_X0}}{}\left({t}\right)}_{{2}}}{}{\mathrm{\sigma }}& {0}\end{array}\right]$ (2)

You can now simulate the Heston process.

 > $\mathrm{S0}≔700$
 ${\mathrm{S0}}{≔}{700}$ (3)
 > $\mathrm{V0}≔0.1$
 ${\mathrm{V0}}{≔}{0.1}$ (4)
 > $\mathrm{\kappa }≔1.0$
 ${\mathrm{\kappa }}{≔}{1.0}$ (5)
 > $\mathrm{\theta }≔0.1$
 ${\mathrm{\theta }}{≔}{0.1}$ (6)
 > $\mathrm{\mu }≔0.05$
 ${\mathrm{\mu }}{≔}{0.05}$ (7)
 > $\mathrm{\sigma }≔0.1$
 ${\mathrm{\sigma }}{≔}{0.1}$ (8)
 > $\mathrm{\rho }≔0.5$
 ${\mathrm{\rho }}{≔}{0.5}$ (9)
 > $S≔\mathrm{HestonProcess}\left(\mathrm{S0},\mathrm{V0},\mathrm{\mu },\mathrm{\theta },\mathrm{\kappa },\mathrm{\sigma },\mathrm{\rho }\right):$
 > $A≔\mathrm{SamplePath}\left(S\left(t\right),t=0..3,\mathrm{timesteps}=100,\mathrm{replications}=5\right)$
 ${A}{≔}\begin{array}{c}\left[\begin{array}{cc}{700.}& {716.042015407260}\\ {717.052916221758}& {696.038563787411}\\ {691.372651432949}& {726.547233114076}\\ {691.078259251487}& {703.419839285752}\\ {724.868723830124}& {699.088992702753}\end{array}\right]\\ \hfill {\text{slice of 5 × 2 × 101 Array}}\end{array}$ (10)

These are sample paths for the state variables.

 > $\mathrm{PathPlot}\left(A,\mathrm{timegrid}=0..3,1,\mathrm{thickness}=3,\mathrm{color}=\mathrm{red}..\mathrm{blue},\mathrm{axes}=\mathrm{BOXED},\mathrm{gridlines}=\mathrm{true}\right)$

And these are the corresponding sample paths for the volatility.

 > $\mathrm{PathPlot}\left(A,\mathrm{timegrid}=0..3,2,\mathrm{thickness}=3,\mathrm{color}=\mathrm{red}..\mathrm{blue},\mathrm{axes}=\mathrm{BOXED},\mathrm{gridlines}=\mathrm{true}\right)$

References

 Brigo, D., Mercurio, F., Interest Rate Models: Theory and Practice. New York: Springer-Verlag, 2001.
 Gatheral, J., The Volatility Surface: A Practitioner's Guide, (with foreword by Nassim Taleb), Wiley, 2006.
 Glasserman, P., Monte Carlo Methods in Financial Engineering. New York: Springer-Verlag, 2004.
 Heston, Steven L., A Closed-Form Solution for Options with Stochastic Volatility with Applications to Bond and Currency Options, The review of Financial Studies, Volume 6, Issue 2, 327-343, 1993.
 Hull, J., Options, Futures, and Other Derivatives, 5th. edition. Upper Saddle River, New Jersey: Prentice Hall, 2003.

Compatibility

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