ORNSTEIN_UHLENBECK is a C++ library which approximates solutions of the Ornstein-Uhlenbeck stochastic differential equation (SDE) using the Euler method and the Euler-Maruyama method, and creating graphics files for processing by gnuplot.
The Ornstein-Uhlenbeck stochastic differential equation has the form:
dx(t) = theta * ( mu - x(t) ) dt + sigma dW, x(0) = x0.where
The starting value x0 represents a deviation from the mean value mu. The decay rate theta determines how fast x(t) will move back towards its mean value. The coefficient sigma determines the relative magnitude of stochastic perturbations.
In general, the solution starts at x0 and over time moves towards the value mu, but experiences random "wobbles" whose size is determined by sigma. Increasing theta makes the solution move towards the mean faster.
The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.
ORNSTEIN_UHLENBECK is available in a C version and a C++ version and a FORTRAN90 version and a MATLAB version.
BLACK_SCHOLES, a C++ library which implements some simple approaches to the Black-Scholes option valuation theory, by Desmond Higham.
BROWNIAN_MOTION_SIMULATION, a C++ program which simulates Brownian motion in an M-dimensional region.
COLORED_NOISE, a C++ library which generates samples of noise obeying a 1/f^alpha power law.
GNUPLOT, C++ programs which illustrate how a program can write data and command files so that gnuplot can create plots of the program results.
PINK_NOISE, a C++ library which computes a "pink noise" signal obeying a 1/f power law.
SDE, a C++ library which illustrates the properties of stochastic differential equations (SDE's), and common algorithms for their analysis, including the Euler method, the Euler-Maruyama method, and the Milstein method, by Desmond Higham;
STOCHASTIC_RK, a C++ library which applies a Runge Kutta (RK) scheme to a stochastic differential equation.
OU_EULER is data created by the OU_EULER routine:
OU_EULER_MARUYAMA is data created by the OU_EULER_MARUYAMA routine:
You can go up one level to the C++ source codes.