sde, a FORTRAN90 code 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 code requires access to the QR_SOLVE library as well.

The original version of these routines is available at "".


The computer code and data files made available on this web page are distributed under the MIT license


sde is available in a C version and a C++ version and a FORTRAN90 version and a MATLAB version.

Related Data and Programs:

BLACK_SCHOLES, a FORTRAN90 code which implements some simple approaches to the Black-Scholes option valuation theory, by Desmond Higham.

COLORED_NOISE, a FORTRAN90 code which generates samples of noise obeying a 1/f^alpha power law.

CORRELATION, a FORTRAN90 code which contains examples of statistical correlation functions.

gnuplot_test, FORTRAN90 codes which write data and command files so that gnuplot() can create plots.

ORNSTEIN_UHLENBECK, a FORTRAN90 code which approximates solutions of the Ornstein-Uhlenbeck stochastic differential equation (SDE) using the Euler method and the Euler-Maruyama method.

PINK_NOISE, a FORTRAN90 code which computes a "pink noise" signal obeying a 1/f power law.

QR_SOLVE, a FORTRAN90 code which computes the least squares solution of a linear system A*x=b.



Original MATLAB version by Desmond Higham. FORTRAN90 version by John Burkardt.


  1. 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:

Last revised on 26 August 2020.