**dream_test**,
a C++ program which
calls dream() to
implement the DREAM algorithm for accelerating
Markov Chain Monte Carlo (MCMC) convergence using differential evolution.

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

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.

- dream_test.sh, runs all the tests.

**PROBLEM0** is a small sample problem, in 10 dimensions, with a
density that is the maximum of two gaussians centered at (-5,-5,...,-5)
and (5,5,...,5).

- problem0.cpp, is a user written file, containing 5 functions, which define the problem data.
- problem0.sh, runs the test.
- problem0.txt, the output file.
- problem0_chain00.txt, a chain data file.
- problem0_chain01.txt, a chain data file.
- problem0_chain02.txt, a chain data file.
- problem0_chain03.txt, a chain data file.
- problem0_chain04.txt, a chain data file.
- problem0_chain05.txt, a chain data file.
- problem0_chain06.txt, a chain data file.
- problem0_chain07.txt, a chain data file.
- problem0_chain08.txt, a chain data file.
- problem0_chain09.txt, a chain data file.
- problem0_gr.txt, the Gelman-Rubin statistic file.
- problem0_restart.txt, the restart file.

**PROBLEM1** is based on the first example in the Vrugt reference.
The Vrugt version involves 100 variables, with a multidimensional
normal distribution with specified mean vector and covariance matrix.
So far, I have simply set up the user routines, with just 5 variables,
and created a small stand-alone main program to test it. An important
issue was to find a simple and efficient way of handling the covariance.
We need to evaluate the matrix, compute its Cholesky factor,
find its determinant, just one time, and then provide this information
to any function that needs it, quickly and simply. In this version
of the code, I opted to define a "Covariance" structure, making it
an "extern" variable so the main program could access it.

- problem1.cpp, is a user written file, containing the 5 functions required to define the problem data, as well as other functions to set the covariance.
- problem1.sh, runs the test.
- problem1_covariance.hpp, an include file that defines the "Covariance" structure.

- problem1_main.cpp, a stand-alone main program that calls the user functions to make some simple tests.
- problem1_main.sh, runs the test.
- problem1_main.txt, the output file from the standalone main program.

**PROBLEM1C** is a version of PROBLEM1 that uses a class to store
the covariance information, instead of a structure. I didn't like
this approach, since it seemed like, every time I needed some information,
I had to call a function and provide an array to store a copy of the
information, rather than simply accessing the information directly.

- problem1c.cpp, is a user written file, containing the 5 functions required to define the problem data, as well as other functions to set the covariance.
- problem1c_covariance.hpp, an include file that defines the Covariance class.
- problem1c_covariance.cpp, functions that implement the Covariance class.
- problem1c_main.cpp, a stand-alone main program that calls the user functions to make some simple tests.
- problem1c_main.sh, runs the test.
- problem1c_main.txt, the output file from the standalone main program.

**PROBLEM2** is based on the second example in the Vrugt reference.
The Vrugt version involves 10 variables, with a "twisted" Gaussian
density function.

- problem2.cpp, is a user written file, containing the 5 functions required to define problem 2.
- problem2.sh, runs the test.
- problem2.txt, the output file.