SDE\
Stochastic Differential Equations {#sde-stochastic-differential-equations align=”center”}
=================================
SDE is a C++ library which illustrates the properties of stochastic
differential equations and some algorithms for handling them, making
graphics files for processing and display by gnuplot, by Desmond Higham.
The library requires access to the QR_SOLVE library as well.
The original version of these routines is available at
“http://www.maths.strath.ac.uk/~aas96106/algfiles.md”.
Licensing: {#licensing align=”center”}
The computer code and data files made available on this web page are
distributed under the GNU LGPL license.
Languages: {#languages align=”center”}
SDE is available in a C version and a
C++ version and a FORTRAN77
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 MATLAB program which simulates Brownian motion in an M-dimensional
region.
CNOISE, a C library which generates
samples of noise obeying a 1/f\^alpha power law, by Miroslav Stoyanov.
COLORED_NOISE, a C++
library which generates samples of noise obeying a 1/f\^alpha power law.
CORRELATION, a C++ library
which contains examples of statistical correlation functions.
GNUPLOT, C++ programs which
illustrate how a program can write data and command files so that
gnuplot can create plots of the program results.
ORNSTEIN_UHLENBECK,
a C++ library which approximates solutions of the Ornstein-Uhlenbeck
stochastic differential equation (SDE) using the Euler method and the
Euler-Maruyama method.
PCE_BURGERS, a C++
program which defines and solves a version of the time-dependent viscous
Burgers equation, with uncertain viscosity, using a polynomial chaos
expansion in terms of Hermite polynomials, by Gianluca Iaccarino.
PCE_ODE_HERMITE,
a C++ program which sets up a simple scalar ODE for exponential decay
with an uncertain decay rate, using a polynomial chaos expansion in
terms of Hermite polynomials.
PINK_NOISE, a C++ library
which computes a “pink noise” signal obeying a 1/f power law.
QR_SOLVE, a C++ library which
computes the least squares solution of a linear system A*x=b.
STOCHASTIC_DIFFUSION,
a C++ library which implements several versions of a stochastic
diffusivity coefficient.
STOCHASTIC_GRADIENT_ND_NOISE,
a MATLAB program which solves an optimization problem involving a
functional over a system with stochastic noise.
STOCHASTIC_RK, a C++
library which applies a Runge Kutta (RK) scheme to a stochastic
differential equation.
Author: {#author align=”center”}
Original MATLAB version by Desmond Higham. C++ version by John Burkardt.
Reference: {#reference align=”center”}
- Desmond Higham,\
An Algorithmic Introduction to Numerical Simulation of Stochastic
Differential Equations,\
SIAM Review,\
Volume 43, Number 3, September 2001, pages 525-546.
Source Code: {#source-code align=”center”}
Examples and Tests: {#examples-and-tests align=”center”}
The calling program creates various data and command files which can be
used with GNUPLOT to create images.
- bpath_commands.txt, commands to plot the data
from BPATH.
- bpath_data.txt, data from BPATH.
- bpath.png, a plot of the BPATH data.
- bpath_average_commands.txt, commands
to plot the data from BPATH_AVERAGE.
- bpath_average_data.txt, data from
BPATH_AVERAGE.
- bpath_average.png, a plot of the
BPATH_AVERAGE data.
- chain_commands.txt, commands to plot the data
from CHAIN.
- chain_data.txt, data from CHAIN.
- chain.png, a plot of the CHAIN data.
- em_commands.txt, commands to plot the data from
EM.
- em1_data.txt, data from EM.
- em2_data.txt, data from EM.
- em.png, a plot of the EM data.
- emstrong_commands.txt, commands to plot
the data from EMSTRONG.
- emstrong_data.txt, data from EMSTRONG.
- emstrong.png, a plot of the EMSTRONG data.
- emweak0_commands.txt, commands to plot the
data from EMWEAK with the standard EM method.
- emweak0_data.txt, data from EMWEAK with the
standard EM method.
- emweak0.png, a plot of the data from EMWEAK with the
standard EM method.
- emweak1_commands.txt, commands to plot the
data from EMWEAK with the weak EM method.
- emweak1_data.txt, data from EMWEAK with the
weak EM method.
- emweak1.png, a plot of the data from EMWEAK with the
weak EM method.
- milstrong_commands.txt, commands to plot
the MILSTRONG data.
- milstrong_data.txt, data from MILSTRONG.
- milstrong.png, a plot of the strong convergence
data from MILSTRONG.
- stab_asymptotic_commands.txt,
commands to plot the STAB_ASYMPTOTIC data.
- stab_asymptotic_data1.txt, data from
STAB_ASYMPTOTIC.
- stab_asymptotic_data2.txt, data from
STAB_ASYMPTOTIC.
- stab_asymptotic_data3.txt, data from
STAB_ASYMPTOTIC.
- stab_asymptotic.png, a plot of the
asymptotic stability results from STAB_ASYMPTOTIC.
- stab_meansquare_commands.txt,
commands to plot the STAB_MEANSQUARE data.
- stab_meansquare_data1.txt, data from
STAB_MEANSQUARE.
- stab_meansquare_data2.txt, data from
STAB_MEANSQUARE.
- stab_meansquare_data3.txt, data from
STAB_MEANSQUARE.
- stab_meansquare.png, a plot of the
meansquare stability results from STAB_MEANSQUARE.
List of Routines: {#list-of-routines align=”center”}
- BPATH performs a Brownian path simulation.
- BPATH_AVERAGE: displays the average of 1000 Brownian paths.
- BPATH_AVERAGE_GNUPLOT writes a GNUPLOT input file to plot
BPATH_AVERAGE data.
- BPATH_GNUPLOT writes a GNUPLOT input file to plot BPATH data.
- CHAIN tests the stochastic Chain Rule.
- CHAIN_GNUPLOT writes a GNUPLOT input file to plot CHAIN data.
- EM applies the Euler-Maruyama method to a linear SDE.
- EM_GNUPLOT writes a GNUPLOT input file to plot EM data.
- EMSTRONG tests the strong convergence of the EM method.
- EMSTRONG_GNUPLOT writes a GNUPLOT input file to plot EMSTRONG
data.
- EMWEAK tests the weak convergence of the Euler-Maruyama method.
- EMWEAK_GNUPLOT writes a GNUPLOT input file to plot EMWEAK data.
- FILENAME_INC increments a partially numeric filename.
- GET_UNIT returns a free FORTRAN unit number.
- MILSTRONG tests the strong convergence of the Milstein method.
- MILSTRONG_GNUPLOT writes a GNUPLOT input file to plot MILSTRONG
data.
- R8_NORMAL_01 returns a unit pseudonormal R8.
- R8_SIGN returns the sign of an R8.
- R8_UNIFORM_01 returns a unit pseudorandom R8.
- R8MAT_NORMAL_01 returns a unit pseudonormal R8MAT.
- R8VEC_MEAN returns the mean of an R8VEC.
- R8VEC_NORMAL_01 returns a unit pseudonormal R8VEC.
- R8VEC_UNIFORM_01 returns a unit pseudorandom R8VEC.
- STAB_ASYMPTOTIC examines asymptotic stability.
- STAB_MEANSQUARE examines mean-square stability.
- STOCHASTIC_INTEGRAL_ITO approximates the Ito integral of W(t)
dW.
- STOCHASTIC_INTEGRAL_STRAT approximates the Stratonovich
integral of W(t) dW.
- TIMESTAMP prints the current YMDHMS date as a time stamp.
You can go up one level to the C++ source codes.
Last revised on 28 September 2012.