DREAM1
Markov Chain Monte Carlo acceleration by Differential Evolution
DREAM1
is a C library which
is an older implementation of the DREAM algorithm for accelerating
Markov Chain Monte Carlo (MCMC) convergence using differential evolution,
by Guannan Zhang.
Using the DREAM1 library to solve a problem requires:
-
compiling a main program, for example, the DREAM1_test.C file;
-
linking the main program with the DREAM1 and RNGLIB libraries;
-
supplying two text files that define the input parameters and the
prior probability density function, such as the examples
given below.
A more recent version of the algorithm, with a simplified interface
involving 5 user functions, is available as DREAM.
Web Link:
A version of the DREAM library is available in
http://tasmanian.ornl.gov,
the TASMANIAN library, available from Oak Ridge National Laboratory.
Licensing:
The computer code and data files described and made available on this
web page are distributed under
the GNU LGPL license.
Languages:
DREAM1 is available in
a C version and
a C++ version and
a FORTRAN90 version.
Related Data and Programs:
DREAM,
a C program which
implements the DREAM algorithm for accelerating
Markov Chain Monte Carlo (MCMC)
convergence using differential evolution,
using five user functions to define the problem, by Guannan Zhang.
RANLIB,
a C library 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 C library which
implements a random number generator (RNG) with splitting facilities,
allowing multiple independent streams to be computed,
by L'Ecuyer and Cote.
Author:
Original FORTRAN90 version by Guannan Zhang;
C version by John Burkardt.
Reference:
-
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.
-
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:
Examples and Tests:
Input files:
-
input.txt,
an input file, containing parameter values, read by INPUT_READ.
-
prior.txt,
an input file, defining the prior density functions for
the parameters, read by PRIOR_READ.
Output files:
-
chain000.txt,
an output file, containing the sample values for chain 0, written by CHAIN_WRITE.
-
chain001.txt,
an output file, containing the sample values for chain 1, written by CHAIN_WRITE.
-
chain002.txt,
an output file, containing the sample values for chain 2, written by CHAIN_WRITE.
-
chain003.txt,
an output file, containing the sample values for chain 3, written by CHAIN_WRITE.
-
chain004.txt,
an output file, containing the sample values for chain 4, written by CHAIN_WRITE.
-
chain005.txt,
an output file, containing the sample values for chain 5, written by CHAIN_WRITE.
-
chain006.txt,
an output file, containing the sample values for chain 6, written by CHAIN_WRITE.
-
chain007.txt,
an output file, containing the sample values for chain 7, written by CHAIN_WRITE.
-
chain008.txt,
an output file, containing the sample values for chain 8, written by CHAIN_WRITE.
-
chain009.txt,
an output file, containing the sample values for chain 9, written by CHAIN_WRITE.
-
gr.txt,
an output file, the Gelman-Rubin statistic file, created by GR_WRITE.
-
restart_write.txt,
an output file, containing restart information, written by RESTART_WRITE.
List of Routines:
-
CHAIN_INIT starts Markov chains from a prior distribution.
-
CHAIN_INIT_PRINT prints the initial values for Markov chains.
-
CHAIN_OUTLIERS identifies and modifies outlier chains during burn-in.
-
CHAIN_WRITE writes samples of each chain to separate files.
-
CR_DIS_UPDATE updates the CR distance.
-
CR_INDEX_CHOOSE chooses a CR index.
-
CR_INIT initializes the crossover probability values.
-
CR_PROB_UPDATE updates the CR probabilities.
-
DIFF_COMPUTE computes the differential evolution.
-
DREAM_ALGM gets a candidate parameter sample.
-
FILENAME_INC increments a partially numeric file name.
-
GR_COMPUTE computes the Gelman Rubin statistics R used to check convergence.
-
GR_INIT initializes Gelman-Rubin variables.
-
GR_WRITE writes Gelman-Rubin R statistics into a file.
-
I4_BINOMIAL_SAMPLE generates a binomial random deviate.
-
I4VEC_MULTINOMIAL_SAMPLE generates a multinomial random deviate.
-
I4VEC_ZERO_NEW creates and zeroes an I4VEC.
-
INPUT_PRINT prints the data from the input file.
-
INPUT_READ reads the data from the input file.
-
INPUT_SIZE reads the parameter size variable from the input file.
-
JUMPRATE_CHOOSE chooses a jump rate from the jump rate table.
-
JUMPRATE_TABLE_INIT initializes the jump rate table.
-
JUMPRATE_TABLE_PRINT prints the jump rate table.
-
MNOR_INIT initializes information for multivariate normal prior densities.
-
MNOR_PROCESS sets data for the generation of multivariate normal deviates.
-
MNOR_READ reads a file for multivariate normal prior densities.
-
OB_READ reads observational data from a file.
-
PRIOR_DENSITY evaluates the prior density function.
-
PRIOR_PRINT prints information about the prior density.
-
PRIOR_READ reads information about the prior density.
-
PRIOR_SAMPLE samples from the prior distribution.
-
R8_BETA_PDF evaluates the PDF of a beta distribution.
-
R8_BETA_SAMPLE generates a beta random deviate.
-
R8_CHI_PDF evaluates the PDF of a chi-squared distribution.
-
R8_CHI_SAMPLE generates a Chi-Square random deviate.
-
R8_EPSILON returns the R8 round off unit.
-
R8_EXPONENTIAL_PDF evaluates the PDF of an exponential distribution.
-
R8_EXPONENTIAL_SAMPLE samples the exponential PDF.
-
R8_EXPONENTIAL_01_SAMPLE samples the standard exponential PDF.
-
R8_GAMMA_LOG evaluates the logarithm of the gamma function.
-
R8_GAMMA_PDF evaluates the PDF of a gamma distribution.
-
R8_GAMMA_SAMPLE generates a Gamma random deviate.
-
R8_GAMMA_01_SAMPLE samples the standard Gamma distribution.
-
R8_INVCHI_PDF evaluates the PDF of an inverse chi-squared distribution.
-
R8_INVGAM_PDF evaluates the PDF of an inverse gamma distribution.
-
R8_MAX returns the maximum of two R8's.
-
R8_MIN returns the minimum of two R8's.
-
R8_MNOR_PDF evaluates the PDF of a multivariate normal distribution.
-
R8_NORMAL_PDF evaluates the PDF of a normal distribution.
-
R8_NORMAL_SAMPLE generates a normal random deviate.
-
R8_NORMAL_01_SAMPLE samples the standard normal probability distribution.
-
R8_ROUND_I4 rounds an R8, returning an I4.
-
R8_SCINVCHI_PDF: PDF for a scaled inverse chi-squared distribution.
-
R8_UNIFORM_PDF evaluates the PDF of a uniform distribution.
-
R8_UNIFORM_SAMPLE generates a uniform random deviate.
-
R8_UNIFORM_01_SAMPLE generates a uniform random deviate from [0,1].
-
R8BLOCK_ZERO_NEW returns a new zeroed R8BLOCK.
-
R8MAT_POFA factors a real symmetric positive definite matrix.
-
R8MAT_ZERO_NEW returns a new zeroed R8MAT.
-
R8VEC_COPY_NEW copies an R8VEC.
-
R8VEC_HEAP_D reorders an R8VEC into a descending heap.
-
R8VEC_MNOR_SAMPLE generates a multivariate normal deviate.
-
R8VEC_SORT_HEAP_A ascending sorts an R8VEC using heap sort.
-
R8VEC_SUM returns the sum of an R8VEC.
-
R8VEC_ZERO_NEW creates and zeroes an R8VEC.
-
RESTART_READ reads parameter sample data from a restart file.
-
RESTART_WRITE writes a restart file.
-
SAMPLE_CANDIDATE generates candidate parameter samples.
-
SAMPLE_LIKELIHOOD computes the log likelihood function.
-
SAMPLE_LIMITS enforces limits on a sample variable.
-
STD_COMPUTE computes the current standard deviations, for each parameter.
-
TIMESTAMP prints the current YMDHMS date as a time stamp.
You can go up one level to
the C source codes.
Last revised on 30 April 2013.