Steven R. Dunbar
Department of Mathematics
203 Avery Hall
University of Nebraska-Lincoln
Lincoln, NE 68588-0130
Stochastic Processes and
Advanced Mathematical Finance
Stochastic Diﬀerential Equations and the Euler-Maruyama Method
Mathematically Mature: may contain mathematics beyond calculus with proofs.
Explain how to use a slope-ﬁeld diagram to solve the ordinary diﬀerential equation
How would you turn that process into an algorithm to numerically compute an approximate solution without a diagram?
and a step size , we approximate and simulate with
The straight line segment is the building block of diﬀerential calculus. The basic idea behind diﬀerential calculus is that diﬀerentiable functions, no matter how diﬃcult their global behavior, are locally approximated by straight line segments. In particular, this is the idea behind Euler’s method for approximating diﬀerentiable functions deﬁned by diﬀerential equations.
We know that rescaling (“zooming in” on) Brownian motion does not produce a straight line, it produces another image of Brownian motion. This self-similarity is ideal for an inﬁnitesimal building block, for instance, we could build global Brownian motion out of lots of local “chunks” of Brownian motion. This suggests we could build other stochastic processes out of suitably scaled Brownian motion. In addition, if we include straight line segments we can overlay the behavior of diﬀerentiable functions onto the stochastic processes as well. Thus, straight line segments and “chunks” of Brownian motion are the building blocks of stochastic calculus.
With stochastic diﬀerential calculus, we can build new stochastic processes. We do this by specifying how to build the new stochastic processes locally from our base deterministic function, the straight line and our base stochastic process, standard Brownian motion. We write the local change in value of the stochastic process over a time interval of (inﬁnitesimal) length as
Note that we are not allowed to write
since standard Brownian motion is nowhere diﬀerentiable with probability 1. Actually, the informal stochastic diﬀerential equation (1) is a compact way of writing a rigorously deﬁned, equivalent implicit Itô integral equation. Since we do not have the required rigor, we will approach the stochastic diﬀerential equation intuitively.
The stochastic diﬀerential equation says the initial point is speciﬁed, perhaps with a random variable with a given distribution. A deterministic component at each point has a slope determined through at that point. In addition, some random perturbation aﬀects the evolution of the process. The random perturbation is normally distributed with mean . The variance of the random perturbation is at . This is a simple expression of a Stochastic Diﬀerential Equation (SDE) which determines a stochastic process, just as an Ordinary Diﬀerential Equation (ODE) determines a diﬀerentiable function. We extend the process with the incremental change information and repeat. This is an expression in words of the Euler-Maruyama method for numerically simulating the stochastic diﬀerential expression.
Example. A very simple stochastic diﬀerential equation is
with a constant. Take a deterministic initial condition to be . The new process is the stochastic extension of the diﬀerential equation expression of a straight line. The new stochastic process is drifting or trending at constant rate with a random variation due to Brownian motion perturbations around that trend. We will later show explicitly that the solution of this SDE is although it is seems intuitively clear that this should be the process. We will call this Brownian motion with drift.
Example. Another very simple stochastic diﬀerential equation is
This stochastic diﬀerential equation says that the process is evolving as a multiple of standard Brownian motion. The solution may be easily guessed as which has variance on increments of length . Sometimes the new process is called Brownian motion (in contrast to standard Brownian motion which has variance on increments of length ).
We combine the previous two examples to consider
which has solution , a multiple of Brownian motion with drift started at . Sometimes this extension of standard Brownian motion is called Brownian motion. Some authors consider this process directly instead of the more special case we considered in the previous chapter.
Example. The next simplest and ﬁrst non-trivial diﬀerential equation is
Here the diﬀerential equation says that process is evolving like Brownian motion with a variance which is the square of the process value. When the process is small, the variance is small, when the process is large, the variance is large. Expressing the stochastic diﬀerential equation as we may say that the relative change acts like standard Brownian motion. The resulting stochastic process is called geometric Brownian motion and it will ﬁgure extensively later as a model of security prices.
Example. The next simplest diﬀerential equation is
Here the stochastic diﬀerential equation says that the growth of the process at a point is proportional to the process value, with a random perturbation proportional to the process value. Again looking ahead, we could write the diﬀerential equation as and interpret it to say the relative rate of increase is proportional to the time observed together with a random perturbation like a Brownian increment corresponding to the length of time. We will show later that the analytic expression for the stochastic process deﬁned by this SDE is .
The sample path that the Euler-Maruyama method produces numerically is the analog of using the Euler method.
The formula for the Euler-Maruyama (EM) method is based on the deﬁnition of the Itô stochastic integral:
Note that the initial conditions and set the starting point.
In this text, we use coin-ﬂipping sequences of an appropriate length scaled to create an approximation to just as in the section Approximation to Brownian Motion.. The coin-ﬂipping sequences emphasize the discrete nature of the simulations with an easily constructed random process. This is consistent with the approach of this text which always uses coin-ﬂipping sequences to create random processes. Note that since the increments are independent and identically distributed, we will use independent coin-ﬂip sequences to generate the approximation of the increments. The EM method could use independent normal random variates directly to obtain the increments . Using independent normal random variates directly would be easier and more eﬃcient. The exercises modify the example scripts to use independent normal random variates directly.
The ﬁrst equality above is the deﬁnition of an increment, the second equality means the random variables and have the same distribution because of the deﬁnition of standard Brownian motion which speciﬁes that increments with equal length are normally distributed with variance equal to the increment length. The approximate equality occurs because of the approximation of Brownian motion by coin-ﬂipping sequences. We generate the approximations using a random number generator, but we could as well use actual coin-ﬂipping. In Table 1 the generation of the sequences is not recorded, only the summed and scaled (independently sampled) outcomes. For convenience, take , , so we need . Then to obtain the entries in the column labeled in the table we ﬂip a coin times and record . Take , , and , so we simulate the solution of
A computer program can produce such a table with the step size made much smaller, presumably resulting in better approximation properties. In fact, it is possible to consider kinds of convergence for the EM method comparable to the Strong Law of Large Numbers and the Weak Law of Large Numbers. See the Problems for examples.
The numerical approximation procedure using coin-ﬂipping makes it clear that the Euler-Maruyama method generates a random process. The value of the process depends on the time value and the coin-ﬂip sequence. Each generation of an approximation will be diﬀerent because the coin-ﬂip sequence is diﬀerent. The Euler-Maruyama method generates a stochastic process path approximation. To derive distributions and statistics about the process requires generating multiple paths, see the Problems for examples.
This shows that stochastic diﬀerential equations provide a way to deﬁne new stochastic processes. This is analogous to the notion that ordinary diﬀerential equations deﬁne new functions to study and use. In fact, one approach to developing calculus and the analysis of functions is to start with diﬀerential equations, use the Euler method to deﬁne approximations of solutions, and then to develop a theory to handle the passage to continuous variables. This approach is especially useful for a mathematical modeling viewpoint since the model often uses diﬀerential equations.
This text follows the approach of starting with stochastic diﬀerential equations to describe a situation and numerically deﬁning new stochastic processes to model the situation. At certain points, we appeal to more rigorous mathematical theory to justify the modeling and approximation. One important justiﬁcation asserts that if we write a stochastic diﬀerential equation, then solutions exist and the stochastic diﬀerential equation always yields the same process under equivalent conditions. The Existence-Uniqueness Theorem shows that under reasonable modeling conditions stochastic diﬀerential equations do indeed satisfy this requirement.
for all and .
Then the stochastic diﬀerential equation has a strong solution on that is continuous with probability and
and for each given Wiener process , the corresponding strong solutions are pathwise unique which means that if and are two strong solutions, then
See  for a precise deﬁnition of “strong solution” but essentially it means that for each given Wiener process we can generate a solution to the SDE. Note that the coeﬃcient functions here are two-variable functions of both time and location , which is more general than the functions considered in equation (1). The restrictions on the functions and , especially the continuity condition, can be considerably relaxed and the theorem will still remain true.
This section is adapted from: “An Algorithmic Introduction to the Numerical Simulation of Stochastic Diﬀerential Equations”, by Desmond J. Higham, in SIAM Review, Vol. 43, No. 3, pp. 525-546, 2001 and Financial Calculus: An introduction to derivative pricing by M. Baxter, and A. Rennie, Cambridge University Press, 1996, pages 52-62. The Existence-Uniqueness Theorem is adapted from An Introduction to Stochastic Processes with Applications to Biology, by L. J. S. Allen, Pearson Prentice-Hall, 2003, pages 342-343 and Numerical Solution of Stochastic Diﬀerential Equations, by Peter Kloeden and Eckhard Platen, Springer Verlag, 1992, pages 127-131.
The scripts apply the EM method to simulate the solution of
The parameters for the number of steps in the EM method, for the ending time, and stochastic diﬀerential equation parameters and are set. Find the time step and initialize the arrays holding the time steps and the solution simulation.
Using create a piecewise linear function using the approximation scripts in Approximation to Brownian Motion.. The parameter is chosen according to the rule of thumb in the DeMoivre-Laplace Central Limit Theorem, Central Limit Theorem.. Then each time increment will have coin ﬂips, suﬃcient according to the rule of thumb to guarantee a scaled sum which is appropriately normally distributed.
Then loop over the number of steps using the EM algorithm
and plot the resulting simulation.
R script for stochasticsdes.R .
on the interval with initial condition and step size .
on the interval with initial condition and step size . Note the diﬀerence with the previous problem, now the multiplier of the term is a function of time.
with on the interval . Apply the program to the stochastic diﬀerential equation with , , , and on the interval .
I check all the information on each page for correctness and typographical errors. Nevertheless, some errors may occur and I would be grateful if you would alert me to such errors. I make every reasonable eﬀort to present current and accurate information for public use, however I do not guarantee the accuracy or timeliness of information on this website. Your use of the information from this website is strictly voluntary and at your risk.
I have checked the links to external sites for usefulness. Links to external websites are provided as a convenience. I do not endorse, control, monitor, or guarantee the information contained in any external website. I don’t guarantee that the links are active at all times. Use the links here with the same caution as you would all information on the Internet. This website reﬂects the thoughts, interests and opinions of its author. They do not explicitly represent oﬃcial positions or policies of my employer.
Information on this website is subject to change without notice.
Steve Dunbar’s Home Page, http://www.math.unl.edu/~sdunbar1
Email to Steve Dunbar, sdunbar1 at unl dot edu
Last modiﬁed: Processed from LATEX source on August 2, 2016