Usage - s-ilic/ECLAIR GitHub Wiki

Usage

Monte Carlo Markov chains

To start a Monte Carlo Markov chain, ECLAIR only requires the user to prepare an .ini file with all the required settings, and then use the command (while in the ECLAIR folder):

python ECLAIR_mcmc.py /path/to/input_file.ini

The inputs folder contains an extensively commented .ini file, template.ini, detailing all the capabilities and possible settings of ECLAIR. Users are strongly advised to keep this file pristine and use copies of it as a basis for their runs. Additionally, a second reference file named params_reference.ini is provided, containing easy-to-copy/paste parameter presets for many models and likelihoods.

A short example .ini file stripped of comments, example_short.ini, is also provided for users wanting to quickly try out the code. One can run it with the commands (while in the ECLAIR folder):

python ECLAIR_mcmc.py inputs/example_short.ini

which will run 10 steps of a 10-walker chain on the Hubble parameter today (H0) and the physical density of cold dark matter (omega_cdm), using BAO data as constraints.

Likelihood maximizer

The ECLAIR suite contains a maximizer which uses a novel technique combining affine-invariant ensemble sampling with simulated annealing. The method works in the following way: the code runs an MCMC chain with affine-invariant ensemble sampling for a number n of steps, with an initial MCMC temperature (by definition, a factor by which the log posterior is divided) set to 1. It then divides this temperature by a factor f (> 1), and resumes the chain for another n steps. It repeats this pattern for a number N of iterations. The combination of this simulated annealing (slowly "cooling" the chain) with the presence of many "walkers" in the ensemble sampling scheme allows the code to converge more reliably towards the global maximum of the posterior.

Running a maximization is very simple and uses the exact same type of .ini file as a regular MCMC run with ECLAIR, and can be done typically via the command:

python ECLAIR_maximizer.py /path/to/input_file.ini N n f

where N, n and f are the aforementioned quantities, to be chosen by the user. Large values of N and n combined with f value close to (but different than) 1 yield better results, though a compromise often needs to be found in order to reach an estimate of the maximum likelihood in a reasonable amount of time.