Home   Back

Here we outline a number of examples from finance. In each case we present a graph comparing exact and numerically simulated mean volatility and variance calculated using 1000 trajectories. The results were calculated with a requested tolerance of 1 x 10-12. The cpu time on a 600 MHz Alpha processor was a few seconds in each case. In addition, to demonstrate convergence, we show plots of log base ten error vs time for mean volatility and variance for 1000, 10000 and 100000 trajectories. We also note the computation times for calculations performed on a 600 MHz Alpha processor. The fortran codes used to generate some of the tests are available elsewhere on our website (examples).

1.  Cox-Ingersoll-Ross Model

The first example is the Cox-Ingersoll-Ross model for volatility r(t)

\begin{eqnarray}
dr(t)&=&\kappa (\theta-r(t)) dt+\sigma \sqrt{r(t)} dW_t.\nonumber
\end{eqnarray}


The expectation of the volatility r(t) should obey

\begin{eqnarray}
E[r(t)]&=&r(0)e^{-\kappa t}+\theta (1-e^{-\kappa t})\nonumber
\end{eqnarray}   Mean Volatility Graph
Convergence Mean Graph


while the variance is given by

\begin{eqnarray}
Var[r(t)]&=&r(0)\frac{\sigma^2}{\kappa}(e^{-\kappa t}-e^{-2\kappa t})+\theta \frac{\sigma^2}{2\kappa} (1-e^{-\kappa t})^2.\nonumber
\end{eqnarray}   Variance Graph
Convergence Variance Graph


The parameters were set to $ \kappa$ = .29368, $ \theta$ = .07935, $ \sigma$ = .11425 and volatility was set to an initial value r(0) = .1. The convergence tests took 4 sec for 1000 trajectories, 43 sec for 10000 trajectories, and 7.1 min for 100000 trajectories.

2.  Log Ornstein-Uhlenbeck Model

The second example is the Log Ornstein-Uhlenbeck model for volatility r(t) and price s(t). In this model

\begin{eqnarray}
ds(t)&=&a s(t)dt+e^{r(t)}s(t)dW_t^1\nonumber \\
dr(t)&=&(a+b r...
...+\frac{\rho}{2} dW_t^1 +\frac{\sqrt{1-\rho^2}}{2}dW_t^2.\nonumber
\end{eqnarray}


The mean volatility satisfies

\begin{eqnarray}
E[r(t)]&=&-\frac{a}{b}+(r(0)+\frac{a}{b})e^{-\vert b\vert t}\nonumber
\end{eqnarray}  Mean Volatility Graph
Convergence Mean Graph


while the variance satisfies

\begin{eqnarray}
Var[r(t)]&=&\frac{.125}{b}(1-e^{-2\vert b\vert t}).\nonumber
\end{eqnarray}   Variance Graph
Convergence Variance Graph


Parameters were set to a = 70, b = - 100, $\rho=.2$ and initial conditions r(0) = .029 and s(0) = .5 were used. The convergence tests took 9 sec for 1000 trajectories, 1.5 min for 10000 trajectories, and 15 min for 100000 trajectories.

3.  Nelson Model

In the Nelson model the price S(t) and volatility r(t) obey

\begin{eqnarray}
ds(t)&=&a \sqrt{r(t)} dW_t^1\nonumber \\
dr(t)&=&\theta (\omega-r(t)) dt+\sqrt{2\lambda\theta}r(t)dW_t^2.\nonumber
\end{eqnarray}


where we set $ \theta$ = .035, $ \omega$ = .636, $ \lambda$ = .296, r(0) = .029 and s(0) = .5. The mean volatility satisfies

\begin{eqnarray}
E[r(t)]&=&\omega-(\omega-r(0))e^{-\theta t}\nonumber
\end{eqnarray} Mean Volatility Graph
Convergence Mean Graph

while the variance satisfies

\begin{eqnarray}
Var[r(t)]&=& r(0)^2~e^{-2\theta(1-\lambda)t}+\frac{\omega^2}{1-...
...mbda}(e^{-\theta t}-e^{2\theta(1-\lambda) t})-E[r(t)]^2.\nonumber
\end{eqnarray} Variance Graph
Convergence Variance Graph


The convergence tests took 12 sec for 1000 trajectories, 2 min for 10000 trajectories, and 19 min for 100000 trajectories.

4.  Hull-White Model

For the Hull-White model the price S(t) and volatility r(t) obey

\begin{eqnarray}
ds(t)&=&a \sqrt{r(t)} dW_t^1\nonumber \\
dr(t)&=&(\theta-\lambda r(t)) dt+\gamma dW_t^2.\nonumber
\end{eqnarray}

where we set $ \theta$ = .03, $ \lambda$ = .035, $ \gamma$ = .0068, r(0) = .029 and s(0) = .5. The mean volatility satisfies

\begin{eqnarray}
E[r(t)]&=&r(0)e^{-\lambda t}+\frac{\theta}{\lambda}(1-e^{-\lambda t})\nonumber
\end{eqnarray}  Mean Volatility Graph
Convergence Mean Graph


while the variance satisfies

\begin{eqnarray}
Var[r(t)]&=&(\frac{2\theta r(0)}{\lambda}-\frac{2\theta^2}{\lam...
...a})(1-e^{-2\lambda t})+r(0)^2e^{-2\lambda t} -E[r(t)]^2.\nonumber
\end{eqnarray}  Variance Graph
Convergence Variance Graph


The convergence tests took 9 sec for 1000 trajectories, 1.5 min for 10000 trajectories, and 16 min for 100000 trajectories.

* Innovative Stochastic Algorithms *

 Top