dream, a FORTRAN90 code which implements the DREAM algorithm for accelerating Markov Chain Monte Carlo (MCMC) convergence using differential evolution, by Guannan Zhang.

The code requires user input in the form of five FORTRAN90 subroutines:

Examples of such user input are listed below.

The code requires access to a compiled version of the pdflib() code, which can evaluate a variety of Probability Density Functions (PDF's) and produce samples from them. The user may wish to invoke this code when constructing some of the user functions.

The code requires access to a compiled version of the rnglib code, in order to generate random numbers.

The code was originally developed by Guannan Zhang, of Oak Ridge National Laboratory (ORNL); it has been incorporated into the DAKOTA package of Sandia National Laboratory, and forms part of the ORNL package known as TASMANIAN.

Web Link:

A version of the code is available in https://tasmanian.ornl.gov, the TASMANIAN code, available from Oak Ridge National Laboratory.


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


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

Related Data and codes:


PDFLIB, a FORTRAN90 code which evaluates Probability Density Functions (PDF's) and produces random samples from them, including beta, binomial, chi, exponential, gamma, inverse chi, inverse gamma, multinomial, normal, scaled inverse chi, and uniform.

RANLIB, a FORTRAN90 code which produces random samples from Probability Density Functions (PDF's), including Beta, Chi-square Exponential, F, Gamma, Multivariate normal, Noncentral chi-square, Noncentral F, Univariate normal, random permutations, Real uniform, Binomial, Negative Binomial, Multinomial, Poisson and Integer uniform, by Barry Brown and James Lovato.

RNGLIB, a FORTRAN90 code which implements a random number generator (RNG) with splitting facilities, allowing multiple independent streams to be computed, by L'Ecuyer and Cote.


Original FORTRAN90 version by Guannan Zhang; This FORTRAN90 version by John Burkardt.


  1. Pierre LEcuyer, Serge Cote,
    Implementing a Random Number Package with Splitting Facilities,
    ACM Transactions on Mathematical Software,
    Volume 17, Number 1, March 1991, pages 98-111.
  2. Jasper Vrugt, CJF ter Braak, CGH Diks, Bruce Robinson, James Hyman, Dave Higdon,
    Accelerating Markov Chain Monte Carlo Simulation by Differential Evolution with Self-Adaptive Randomized Subspace Sampling,
    International Journal of Nonlinear Sciences and Numerical Simulation,
    Volume 10, Number 3, March 2009, pages 271-288.

Source Code:

Last revised on 18 June 2020.