CosmoMC Readme
July 2014. Check the web
page for the latest version.
Contents
Introduction
CosmoMC is a Fortran 2003/2008 MarkovChain MonteCarlo (MCMC) engine for exploring cosmological
parameter space, together with code for analysing MonteCarlo samples and importance sampling (plus a suite of python scripts for building grids of runs and plotting and presenting results).
The code does brute force (but accurate) theoretical matter power spectrum and C_{l} calculations with
CAMB. See the paper
for an introduction, descriptions, and typical results from some preWMAP data. It can also be compiled as a generic sampler without using any cosmology codes.
On a multiprocessor machine you can start to get good results in a few of hours. On single processors
you'll need to set aside rather longer. You can also run on a cluster.
By default CosmoMC uses a simple Metropolis algorithm or an optimized fastslow sampling method (which works for likelihood with many fast nuisance parameters like Planck).
The program takes as inputs estimates of central values and posterior uncertainties of the various parameters. The proposal density can use information about parameter correlations from a supplied covariance matrix: use one if possible as it will significantly improve performance. Covariance matrices are supplied for common sets of default base parameters. If you compile and run with MPI (to run across nodes in a cluster), there is an option to dynamically
learn the proposal matrix from the covariance of the postburnin samples so far. The MPI option also allows you to terminate the computation automatically when a particular convergence criterion is matched. MPI is strongly recommended.
There are two fortran programs supplied cosmomc and getdist. The first
does the actual MonteCarlo and produces sets of .txt chain files and (optionally) .data output
files (the binary .data files include the theoretical CMB power spectra
etc.). The "getdist" program analyses the .txt files calculating statistics
and outputs files for the requested 1D, 2D and 3D plots (and could be used independently of the main cosmomc program).
The "cosmomc" program also does post processing on .data files, for example doing importance
sampling with new data.
Please email details of any bugs or enhancements to Antony Lewis. If you have any questions please ask in the CosmoCoffee computers and software forum. You can also read answers to other people's questions there.
You will need a Fortran 2003 (or higher) compiler  Intel Fortran 14 or higher works (earlier versions probably will not). Others may, but gfortran does not support Fortran 2003 well enough at the moment (see gfortran bug list if you'd like to help; bugs are being worked on and hope to have gfortran support in a few months).

Get the download
and unzip and untar it (run "gunzip cosmomc.tar.gz", then "tar xf cosmomc.tar")
 To use Planck you need to download and install the Planck likelihood code first. See the Planck readme before continuing.
 If necessary edit the relevant top parts of the Makefile in the source directory depending on what system you are using
Using MPI simplifies running several chains and proposal optimization. MPI can be used with OpenMP: generally you want to use OpenMP to use all the sharedmemory processors on each node of a cluster, and MPI to run multiple chains on different nodes (the program can also just be run on a single CPU).

Run "make" (try "gmake" if you get an error)
 To output chains you might want to make a chains subdirectory, or (perhaps better) symlink to somewhere on your data disk.
If not using Intel also need to link to LAPACK (for doing matrix diagonalization, etc)  you may need to edit the Makefile to specify where this on your system (Intel compilers use MPL).
Using Visual Fortran there's no need to use the Makefile, just open the project file in the source folder, and set params.ini as the program argument. This is not set up to compile with MPI, so mainly useful for development.
See BibTex file for relevant citations.
See the supplied params.ini file for a fairly selfexplanatory list of
input parameters and options. The file_root entry gives the root name for all files produced. Running using MPI on a cluster is recommended if possible as you can automatically handle convergence testing and stopping.
MPI runs on a cluster
When you run with MPI (compiled with DMPI, the default), a number of chains will be run according to the number of processes assigned by MPI when you run the program. Output file names will have "_1","_2" appended to the root name automatically. You may be able to run over 4 nodes using e.g.
mpirun np 4 ./cosmomc params.ini
There is also a supplied script python/runMPI.py that you may be able to adapt for submitting jobs to a job queue, e.g.
python python/runMPI.py params
to run using the params.ini parameters file. Run runMPI.py without arguments to see a list of options (number of chains, cores, wall time, etc).
If necessary edit the job_script file as appropriate for your machine, and also if necessary the submitJob function in python/jobQueue.py.
In the parameters file you can set MPI_Converge_Stop to a convergence criterion (see Convergence Diagnostics. Small numbers are better convergence; generally need R1 < 0.1, but may want much smaller especially for importance sampling or accurate confidence limits. You can also directly impose an error limit on confidence values  see the parameter input file for details). If you set MPI_LearnPropose = T, the proposal density will be updated using the covariance matrix of the last half of all samples (across chains) so far.
Using MPI_LearnPropose will significantly improve performance if you are adding new parameters for which you don't have a precomputed covariance matrix. However adjusting the proposal density is not strictly Markovian, though asymptotically it is as the covariance will converge. The burn in period should therefore be taken to be larger when learning the proposal density to allow for the time it takes the covariance matrix to converge sufficiently (though in practice it probably doesn't matter much in most cases). Note also that as the proposal density changes the number of steps between independent samples is not constant (i.e. the correlation length should decrease along the chain until the covariance has converged). The stopping criterion uses the last half of the samples in each chain, minus a (shortish) initial burn in period. If you don't have a starting covariance matrix a fairly safe thing to do is set ignore_rows=0.3 in the GetDist parameter file to skip the first chunk of each chain.
You can also set the MPI_R_StopProposeUpdate parameter to stop updating the proposal density after it has converged to R1 smaller than a specified number. After this point the chain will be strictly Markovian. The number of burn in rows can be calculated by looking at the params.log file for the number of output lines at which R1 has reached the required value.
If things go wrong check the .log and any error files in your cosmomc/scripts directory.
Input Parameters
The input .ini files contain sets of namevalue pairs, in the form key = value.
Keys setting input values for specific parameters can be set using numbered key values, param[omegabh2]=xxx yy... for omegabh2. The names of the various parameters are set in .paramnames files: for cosmology parameters see params_CMB.paramnames. Likelihoods may also have nuisance parameters that need to be varied: see the .paramnames files in the ./data/ directory.
.ini files can include other ini files using DEFAULT(xx.ini) or INCLUDE(yy.ini), so there's no need to repeat lots of settings when you do different similar runs. The sample test.ini file includes .ini files in the batch1/ directory, set up for Planck/BICEP analysis runs. The action=4 setting just calculates test likelihoods for one model (the central value of your parameter ranges) and writes out the result. Set action=0 to run a test chain. Using DEFAULT in a .ini files means you can include default settings, but override ones of interest for a particular run.
Output files
 The program produces a file_root.txt file listing each accepted set of
parameters; the first column gives the number of iterations staying at
that parameter set (more generally, the sample weight), and the second the likelihood.
 If indep_sample is nonzero, a file_root.data file is produced containing full computed
model information at the independent sample points. These can be used for quick importance sampling using action=1.
 A file_root.paramnames file lists the names and labels of the parameters corresponding to the columns 3+ of the output chain files. By default this is just a copy of the params_CMB.paramnames file read in by the default parameterization specified in params_CMB.f90. Parameter names are strings of numbers and letters without spaces, used reference parameters in input files; the labels are used when making plot axes labels and various output files.
 A file_root.log file
contains some info which may be useful to assess performance.
 For postprocessing (action=1), the program reads in an existing .data file and processes
according to the redo_xxx parameters. At this point the acceptance multiplicities
are noninteger, and the output is already thinned by whatever the original
indep_sample
parameter was. The postprocessed file are output to files with root redo_outroot.
Analysing samples and plotting
The getdist program analyses text files produced by the cosmomc program. These are in the format
weight like param1 param2 param3 ...
The weight gives the number of samples (or importance weight)
with these parameters. like gives log(likelihood). The getdist
program could be used completely independently of the cosmomc program.
Run getdist distparams.ini to process the chains specified in the
parameter input file distparams.ini. This should be fairly selfexplanatory,
in the same format as the cosmomc parameter input file.
GetDist Parameters
 GetDist processes the file_root.txt file (or, if there are multiple chains,
set the chain_num parameter), and outputs statistics, marginalized
plots, samples plots, and performs PCA (principle component analysis).
 Set the parameter_names parameter to specify a .paramnames file with the names and labels for parameters corresponding to the various columns in the chain files (see the supplied examples). If this parameter is empty getdist reads the parameters from the file_root.paramnames file that is output when generating the chains. If neither exist parameters are referenced by number, so parameter labels have to be specified in the .ini file (lab1=\Omega_b h^2, etc.).
 Set ignore_rows to a positive integer to ignore that number of output rows as burnin, or to a fraction <1 to skip that fraction of each chain's rows.

Set the thin_factor parameter to produce a file_root_thin.txt file containing
every thin_factorth sample.

Set adjust_priors to adjust the
sample multiplicities for a new prior (write the corresponding code in GetDist.f90).

If you have a derived parameter which has a prior which cuts off when the posterior is nonnegligible
you need to set the limits[paramname] variables to the corresponding limits
 for example r02 for the tensor ratio. Otherwise
limits are computed automatically. DO NOT use limits[paramname] to change
the bounds on other plots  the program uses the limits information when
it is estimating the posteriors from the samples. Limits for base MCMC parameters are set automatically from the .ranges file.
When limits[paramname] are used the .margestats file
contains one tail statistics  i.e. the lower bound is where 1x of points are lower and x of the points higher, the upper bound is where 1x of the points are higher and x lower (usually only one of the limits would be used). If only one end is fixed you can use N the floating end, e.g. "limitsxx = 0 N" for the tensor amplitude which has a greater than zero prior.
Example: Since many people get this wrong, here is an illustration of what happens when generating plots from a tensor run set of chains (with prior r>0):
Incorrect result when limits[r02] is not set.  Correct result when setting limits[r02]=0 N. 
If you are not using parameter names you can set numbered limit parameters, e.g. limits12=0 N for parameter 12.
 You should check that you have set num_bins large enough and that your plots are stable to increasing it.
The smooth_scale_1D and smooth_scale_2D parameters can be set to change the smoothing scale with respect to the bin size (or in the 1D case with respect to the posterior width).
For smooth_scale_1D:
 if smooth_scale_1D >= 1 smooth by smooth_scale_1D bin widths
 if smooth_scale_1D> 0 and <1 smooth by Gaussian of smooth_scale_1D standard deviations in each parameter (around 0.20.3 is often good); this gets flat distributions nice and smooth without overly broadening well determined parameters
 if smooth_scale_1D< 0 uses automatic smoothing length (changes with parameter)the overall smoothing length is scaled by abs(smooth_scale_1D) from very crude guess at best overall scale
For 2D plots smooth_scale_2D is the smoothing scale relative to the bin size
The .ini file comments should explain the other options.
Output Text Files
Plotting
If GetDist produces scripts files to make simple 1D, 2D and 3D plots. These can be either python or matlab, set plot_ext=py or plot_ext=m for which you prefer. The script files produced are called
To compare two different sets of chains set compare_num=1 in the .ini file, and compare1 to the root name of some chains you have previously run GetDist on.
 Python plots
If plot_ext=py GetDist produces python '.py' files.
GetDist also produces a set of files in the plot_data directory that can be used by custom python scripts for plotting, independently of the plot_ext scripts described above.
See the CosmoMC python readme for details of how to use the plotting library.
 Matlab plots
If plot_ext=m GetDist produces Matlab '.m' files. Matlab support is not likely to be developed further, but maintained from
the previous version for convenience. Type file_root into a Matlab
window set to the directory containing the .m files to produce 1D marginalized plots.
You can use the blue Matlab script (in the mscripts) directory to change to a B&Wfriendly colourmap (see also other colormaps in that directory).
Custom Matlab plots
Some Matlab scripts are also supplied for making custom Matlab plots using the files produced by GetDist (see also CosmoloGui). The scripts are in the mscripts directory  you will probably want to add this to your Matlab path using e.g. addpath('mscripts'). confid2D makes marginalized contour plots like this.
But now the python scripts do this much better and more easily.
Parameter labels are set in distparams.ini  if any are blank the parameter is ignored. You can also specify which parameters to plot, or if parameters are not specified for
the 2D plots or the colour of the 3D plots getdist automatically works out
the most correlated variables and uses them.
The data files used by python and Matlab are output to the plot_data directory.
The getdist program will output convergence diagnostics, both short summary information when getdist is run, and also more detailed information in the file_root.converge file. When running with MPI the first two of the parameters below can also be calculated when running the chains for comparison with a stopping criterion (see the .ini input file).
 For multiple chains the code computes the Gelman and Rubin "variance of chain means"/"mean of chain variances" R statistic for each parameter using the second half of each chain (reference). The .converge file produced by getdist contains the numbers for each parameter individually. The program also writes out the value for the worst eigenvalue of the covariance of the means, which should be a worst case (catching poor chain coverage in directions not aligned with the base parameters). This "R1" statistic is also used for the stopping criterion when generating chains with MPI.
If the numbers are much less than one then the second half of each chain probably provides an accurate estimate of the means and variances. If the distribution is bimodal and no chains find the second mode low values can be misleading. Typically you want the value to be less than 0.2. Low values do not guarantee that small percentiles will be measured accurately (though it certainly helps), or that the value won't increase as you run longer and probe further into the tails.

For MPI runs, in addition to specifying a stopping criterion as above, you can also give a convergence criterion for a confidence limit. In general it is much harder to get an accurate value for a small confidence value than for the mean, so imposing a tight limit may make your chains run for a very long time (though you can then be pretty confident in your confidence). The value computed is the variance of the chain percentiles from the last half of the different chains, in units of the standard deviation of each parameter. You can either specify a particular parameter to check, or do all of them. Any parameter with a slowly explored tail will only converge very slowly, in which case you may be able to improve things by generating chains at a higher temperature (so the tails are explored more readily; GetDist can adjust for the temperature automatically), or reparameterizing.

For individual chains (before importance sampling) getdist computes the Raftery and Lewis convergence diagnostics. This uses a binary chain derived from each parameter depending on whether the parameter is above or below a given percentile of its distribution (specified by the converge_test_limit input parameter). The code works out how much the binary chain needs to be thinned to approximate a Markov process better than a second order process, and then uses analytical results for the convergence of binary Markov chains to assess the burn in period. It also assesses the thin factor needed for the binary chain to approximate an independence chain, which gives an idea of how much you need to thin the chain to obtain independent samples (i.e. how much you can get away with thinning it for importance sampling, though thinning isn't entirely lossless). The .converge file contains the numbers for each chain used, getdist writes out the worst case. See this reference for details.

A simpler way to assess the error on quantile limits is by computing them using subsets of the samples. GetDist produces the file_root.converge contains the 'splittest' rms change on the parameter quantiles in units of the standard deviation when the samples are split into 2,3 or 4 parts. Small numbers are clearly better. A number of 0.5 for a 2way split indicates that the 95% confidence limit may in fact be off by the order of half a standard deviation (though probably better, as the limit is computed using all the samples). Large values in a particular parameter may indicate that there is a long tail that is only being explored slowly (in which case generating the chain at a higher temperature or changing parameters to the log might help).
 The file_root.converge file also outputs the parameter autocorrelations as a function of step separation (see e.g. astroph/0310723). The correlation length is similar to the Raftery&Lewis statistics in giving a measure (though harder to quantify) of how far apart independent samples are, though it is less sensitive to how well the tails are explored (see bad case example in the notes).
Differences between GetDist and MPI runtime statistics
GetDist will cut out ignore_rows from the beginning of each chain, then compute the R statistic using all of the remaining samples. The MPI runtime statistic uses the last half of all of the samples. In addition, GetDist will use all the parameters, including derived parameters. If a derived parameter has poor convergence this may show up when running GetDist but not when running the chain (however the eigenvalues of covariance of means is computed using only base parameters). The runtime values also use thinned samples (by default every one in ten), whereas GetDist will use all of them. GetDist will allow you to use only subsets of the chains.
Parameterizations
Performance of the MCMC can be improved by using parameters which have a close to Gaussian posterior distribution. The default parameters (which get implicit flat priors) are
 omegabh2  the physical baryon density
 omegach2  the physical dark matter density
 theta  100*(the ratio of the [approx] sound horizon to the angular diameter distance)
 tau  the reionization optical depth
 omegak  omega_K
 mnu  the sum of the neutrino masses (in eV)
 nnu  the effective density parameter for neutrinos N_{eff}
 w  the (assumed constant) equation of state of the dark energy (taken to be quintessence)
 ns  the scale spectral index
 nt  the tensor spectral index
 nrun  the running of the scalar spectral index
 logA  ln[10^10 A_s] where A_s is the primordial superhorizon power in the curvature perturbation on 0.05Mpc^{1} scales (i.e. in this is an amplitude parameter)
 r  the ratio A_t/A_s, where A_t is the primordial power in the transverse traceless part of the metric tensor
Parameters like H0 and omegal (Ω_{Λ}) are derived from the above. Using theta rather than H0 is more efficient as it is much less correlated with other parameters. There is an implicit prior 40 < H0 < 100 (which can be changed).
The .txt chain files list derived parameters after the base parameters.
The list of parameter names and labels used in the default parameterization is listed in the supplied params_CMB.paramnames file.
Since the program uses a covariance matrix for the parameters, it knows about (or will learn about) linear combination degeneracies. In particular ln[10^10 A_s]  2*tau is well constrained, since exp(2tau)A_s determines the overall amplitude of the observed CMB anisotropy (thus the above parameterization explores the tauA degeneracy efficiently). The supplied covariance matrix will do this even if you add new parameters.
Changing parameters does in principle change the results as each base parameter has a flat prior. However for well constrained parameters this effect is very small. In particular using theta rather than H_0 has a small effect on marginalized results.
The above parameterization does make use of some knowledge about the physics, in particular the (approximate) formula for the sound horizon.
To change parameterization make a new .paramnames file, then change sources/params_CMB.f90 to change the mapping of physical parameters to MCMC array indices, and also to read in your new .paramnames file.
Likelihoods that you use may also have their own nuisance parameters.
You can use CosmoMC to sample any custom function that you want to provide. To do this
 Write your own likelihood in GenericLikelihoodFunction in calclike.f90
 Adapt params_generic.ini appropriately for your parameter numbers and settings (see comments there)
 Run using your .ini file as normal
You can use named or unnamed parameters. Making your own .paramnames file to name your parameters usually makes things easier (except possibly if you have a very large number of parameters where number labels make sense).
Programming
The code makes use of Fortran 2003 features and structures. There is automated code documentation, which includes modules, classes and subroutines. File and class documentation gives inheritance trees to help understand the structure, for example GeneralTypes.f90 contains the key base classes that other things are inherited from.
You are encouraged to examine what the code is doing and consider carefully
changes you may wish to make. For example, the results can depend on the
parameterization. You may also want to use different CAMB modules, e.g.
slowroll parameters for inflation, or use a fast approximator. The main
source code files you may want to modify are

settings.f90
This defines the maximum number of parameters and their types.


Calculator_Cosmology.f90 and Calculator_CAMB.f90
Routines for generating Cls, matter power spectra and sigma8 from CAMB.
Override the calcualtor class in Calculator_Cosmology.f90 to implement cosmology using other calculatorse.g. a fast approximator like PICO,
or other Boltzmann code.
etc.

DataLikelihoods.f90
This is where you can add in new likelihood functions

driver.F90
Main program that reads in parameters and calls MCMC or postprocessing.

propose.f90
This is the proposal density and related constants and subroutines. The efficiency
of MCMC is quite dependent on the proposal. Fast+slow and fast parameter subspaces are proposed separately. See the paper for a discussion of the proposal density and use of fast and slow parameters.
GetDist.f90
The "getdist" program for analysing chains. Write your own importance
weighting function or parameter mapping.
Addons and extra datasets
Various extended data sets require some code modifications. After testing these may be included as part of the public program, but meanwhile can be
installed manually or obtained from the cosmomc git repository (access available on request).
 fgas (Relaxed Galaxy Clusters, available as clusters_fgas branch in git repository)
Version History
 July 2014
 Python job submission and queue scripts generalized for better portability and speed; can use environment variables and job script tokens to specify job submission defaults (job templates for specific machines may need to be updated; new sample template provided for MOAB scheduler)
 makeTables.py: new options including showing parameter shifts to a reference in sigma units
 makePlots.py: several new options for different crossgrid data comparisons and triangle plots
 makeGrid.py: various small new options and functions (make need to rerun makeGrid on existing grids to update)
 runbatch.py: option for combining several runs into one job (runsPerJob)
 copyGridFiles.py: new script to easily copy chains or getdist results from part of a grid (copy to directory or directly into zip file)
 Fixed default ranges for JLA alpha parameter in batch1/JLA.ini. Updated JLA likelihood to allow JLA_marginalize=T for importance sampling with internal grid integration (as SNLS, but now nonsquare grid).
 Added DR8 BAO likelihood for completeness (thanks HeeJong Seo)
 Fixed bug in underlying bicubic interpolation (Interpolation.f90); caused crashes with simple mpk runs and possibly more general issues
 Fixed bug in production of .data files by importance sampling
 Added more helpful "h" help info for some python scripts
 May 2014
 HST module updated to read H0 value and error from .ini file (allowing easier modification/variation testing)
 Fixed bugs in writing out likelihoods for importance sampled chains, setting grid run importance sampling output directories, and writing 'derived' likelihoods for each chain position; other minor fixes
 python/makeTables.py has new option changes_adding_data to give shifts in parameter means (in sigma) between runs with and without given data
 python/makePlots.py has new option compare_alldata to make plots comparing all data combinations for each parameter combination
 April 2014
 CAMB update to April 2014 version; cosmomc support added for running of running (nrunrun) and running tensor tilt (ntrun). Using inflation_consistency now uses second order consistency relations for nt and ntrun.
 Added tensor pivot parameter tensor_pivot_k to specify pivot scale for r independently of the scalar pivot scale. This uses the new CAMB tensor parameterization (tensor_parameterization=2) so that A_{t} = P_{t}(tensor_pivot_k) = r P_{s}(tensor_pivot_k) for any scalar pivot, tilt and running.
 Reordered derived parameters, and added new tensor derived parameters r_{0.01} (rBB), log(10^{10}A_{t}) (logAT), and 10^{9}A_{t} (AT), 10^{9} A_{t} e^{2τ} (ctlamp)
 Chains include "derived parameters" giving the χ^{2} [2Ln(Likelihood)] for each likelihood used, and where more than one of a given type, the sum for each type (e.g. CMB, BAO).
 Added partial support for PICO calculator (cosmology_calculator = PICO in .ini file, test_pico.ini example provided); only CL and some parameters supported currently
 action=4 now outputs timings for each likelihood (only for first time run, so does not account for any caching); new test_output_root puts out the theory CL (+ any derived likelihood data) at the test point
 action = 1 (importance sampling) will now by default (redo_auto_likescale=T) automatically rescale likelihoods to give O(1) weights if needed
 action = 1 (importance sampling) new has options redo_output_txt_theory, redo_output_txt_dir to output text files with theory CL and data point values for all points in the chain
 Parameter lmin_store_all_cmb to force output of all cl up to lmin_store_all_cmb even if not used by likelihoods
 Output derived parameter H(z) is now in standard km/s/Mpc units
 Bug fixes, including MPK fix for when only one redshift
 GetDist has new optional second parameter to specify file_root, e,g getdist distparams.ini chains/test
 GetDist chain_num can now either be unspecified or 1 in order to read as many chains as exist
 python/makeTables.py has new options delta_chisq_paramtag to specify reference parameter model for quoting Δχ^{2} to (default is baseline model), changes_from_datatag to give shifts in parameter means (in sigma) relative to the specified data tag at the same parameter combination, and changes_from_paramtag to give shifts relative to some baseline parameter combination
 python/batchJob.py has new convenience jobGroup class for optional use in grid setting files; dataSet class has add method to modifying existing content
 Python 3d plots now set hard bounds automatically (as 2d)
 March 2014
 Major restructuring of main code using Fortran 2008: structure supports additional cosmology calculator codes, etc. Use ifort 14+.
 Rewritten CMB likelihoods; new CMBlikes module replaces the (misnamed) Planck_like, with support for exact forecasting and binned HL likelihoods (e.g. BICEP2); runtime determination of Lranges and fields needed. (.data format changed); old CMB data format support removed for now.
 Added BICEP2 data likelihood files (in ./data/BICEP/)
 New JLA supernovae likelihood module (arXiv:1401.4064)
 Added DR11 BAO module changes and data from SDSS
 Mpk functions now use 2D bicupic interpolation (thanks Jason Dossett)
 Added sterile_mphys_max parameter to set prior on maximum physical mass (in eV) of a thermal massive sterile neutrino, 10eV by default.
 MatterPowerAt_Z interpolation bug fix
 .likestats files include mean likelihood numbers; python tables updated accordingly
 python/runMPI.py added to replace perl scripts; based on a templated queue submission script, e.g. provided job_script.
 python makeGrid settings: lists of .ini files can now be, or include, python dictionaries of parameters rather than .ini files; job data_set can be a dataSet() item
 CAMB update: updated halofit fitting parameters for neutrino models (thanks Simeon Bird); DoTensorNeutrinos is now on by default.
 December 2013
 Updated BBN module, using interpolation table (from AlterBBN) with updated neutron decay constant and converting from BBN to total mass conventions for Y_{P}. Uses new Interpolation module with reusable 2D bicubic interpolation class. Changes in Y_{P} are O(1%) and hence have only tiny effect on other parameters.
 Fixed bugs when using LSS, including one giving wrong sigma8 (thanks Matteo Costanzi)
 CAMB updated to December 2013 version (minor changes)
 November 2013
 CAMB updated to November 2013 version (fixes problem with e.g. tensor runs)
 Python grid scripts bug fixes and minor new options
 October 2013
 CAMB updated to October 2013 version (inc. Jason Dossett changes to support nonlinear lensing and nonlinear MPK, changing numerical results slightly; fix for ppf bug that significantly changes results at low L for w>>0.8, thanks David Rapetti and Matteo Cataneo)
 Added WiggleZ and MPK modules, and corresponding general changes for likelihoods using the linear or nonlinear matter power spectrum as a function of redshift. Double interpolation is now avoided, and combinations of requirements for different likelihoods are automatically internally combined. (All thanks to Jason Dossett)
 Added halofit_ppf (Jason Dossett)
 Minimization now has more options, including hightemperature MCMC check, and uses existing .covmat for widths: best fits seems to be a lot more stable now; also MPI support to compare result from multiple minimizations (not usually required)
 Added checkConflicts to likelihood class (so new likelihoods can check full list for conflicts and abort if necessary e.g. BAO/MPK) and added .dataset filebased likelihood ancestor class, with conflict specification input parameters
 New python plotting options and Planck default settings; sample Planck output scripts updated
 June 2013
 Fix getdist bounds outputs when plot_params is set and triangle plot data generation
 Fix for cosmomc runs with no covmat; more robust checkpoint file output
 April 2013
 [23 April] fix to work with default test_likelihood parameter (F)
 Automatic thinning by oversample_fast factor for sampling_method=1 (prevents files getting very large)
 oversample_fast meaning slightly changed to give more regular fast updates in standard sampling, and generate oversample_fast standard fast metropolis samples per slow update in the dragging method.
 Tweaks to various internal convergence and update parameters
 GetDist option can be set to m for old matlab outputs or py for similar python plot outputs
 Added getdist parameter converge_test_limit to set limit for convergence tests
 Fixes for runGridGetdist.py, and default to producing .py python plot files in each dist folder rather than matlab .m.
 Renamed matlab_subplot_xx etc to subplot_xxx
 Various other minor bug fixes, tidied up MCMC.f90 code (for the moment removing old unupdated sampling methods)
 March 2013
 Sampling
 New fastslow sampling_method=7, using new fast/slow blocked decorrelation scheme (paper) and fast dragging following Neal 2005. This is recommended for Planck.
 fast_param_index specifies that all parameters with number greater or equal to fast_param_index should be treated as fast. Can alternatively use fast_parameters to set specific parameter to be treated as fast.
 dragging_steps determines the number of fast steps per slow step. In total dragging_steps x num_fast metropolis steps are taken in the fast direction for each slow step. Does not need to be an integer, 23 works well for Planck.
 for finetuning block_semi_fast boolean defines whether initial power spectrum parameters are treated as separate blocks, block_fast_likelihood_params determines if fast parameters are blocked depending on likelihood dependencies. Both true (default) is usually fastest.
 Grids of models and python utilities
 A new suite of python scripts for running CosmoMC for grids of models, running GetDist over the result, management, analysis and plotting. See the python scripts readme
 Structure
 Restructuring using Fortran 2003 features (probably does not compile on gfortran, ifort 13 OK); likelihoods and theory now only recomputed as required as parameters change (enables the fastslow sampling method to work). Each likelihood specifies its own theory and nuisance parameter requirements.
 Data likelihoods now specify their own .paramnames file for any nuisance parameters (samples in ./data). Combining theory and data parameters is done internally, there's no need to change hardcoded parameter numbers when new nuisance parameters are added, and unused likelihood nuisance parameter are no longer output. Each likelihood function is passed the array of its nuisance parameters, completely independent of what other likelihoods are doing (but multiple likelihood functions can use the same nuisance parameter names when they are the same parameter). Likelihoods specify their speed (<0 is slow, >=0 is fast, with higher faster), and are internally sorted to be in speed order before use.
 Reorganized parameterization class and module implementation; can now set H0_min and H0_max as .ini input parameters. Added parameterization=background option (e.g. for supernovaeonly runs): parameter numbers can now be changed dynamically without recompiling.
 CAMB and cosmology
 CAMB (and CosmoMC) updates fix issues with larger neutrino masses and nonlinear calculation in very closed models (Mar 2013 version)
 Added support for massive neutrinos with varying n_eff (nnu), treating massive as nearly thermal and the rest as massless (for n>3.046), or reducing the temperature of the massive neutrinos for n<3.046.
 Added use_lensing_potential and use_nonlinear_lensing (currently can't be used with any LSS data; also note that it is not calculated consistency when only the initial power spectra are changed). Changed default num_cls_ext=1.
Lensing potential accuracy increased for use_lensing_potential=T.
 Derived parameters now include r_s/D_v(0.57)
 T_CMB changed to 2.7255
 lmax_computed_cl to define CAMB maximum L; higher L are approximated by scaling fixed template file (highL_theory_cl_template), for use where nonprimordial contributions dominate.
 Input parameter num_massive_neutrinos for use with the mnu parameter (e.g. can fix to 0.06 with num_massive_neutrinos=1 to approximate minimal hierarchy)
 Links by default with CAMB simplified ppf module for varying w (parameter wa).
 Base parameters changed to use m_{nu} rather than f_{nu}; several new chain and derived parameters supported and output by default.
 GetDist
 parameter credible_interval_threshold to determine when credible intervals or tail integrals are used
 .margestats has new format, with separate limit type for each confidence
 Prior ranges set automatically for MCMC parameters from .ranges file
 applies 1D smoothing scale relative to standard deviation, or semioptimal: smooth_scale_1D
 2D plots use adaptive elliptical kernel density, smooth_scale_2D sets smoothing scale relative to posterior width or bin size.
 Removed sm support. Added python/GetDistPlots.py with fairly general plotting support.
 R1 statistics now use all samples left after cutting ignore_rows. The value is redefined more uniquely to be the worst eigenvalue of the covariance of the chain means of meancovarianceorthonormalized parameters
 Change for making large arrays of 1D plots not too small; matlab_subplot_size_inch, matlab_plot_output parameters
 Likelihoods
 Support for the Planck likelihood
 Added SNLS supernovae (with option for internal marginalization) and updated Union to Union 2.1
 BAO data up dated to BOSS DR9 final results (DR7, DR9 and 6DF). Note the code is not identical, cosmomc computes the drag sound horizon numerically (recalibrated to be consistent in the fiducial model); also be aware of correlation with Wigglez.
 HST data updated to Riess et al: 1103.2976 (from BOSS mod)
 Updated for WMAP9 (edit the Makefile in your wmap_likelihood_v5 directory appropriately first).
 Input parameters use_WMAP_TT_beam_ptsrc, use_WMAP_TE, use_WMAP_TT that can all be set to false to use only WMAP low L
 added prior[xxx]=mean std inputs to specific Gaussian priors on parameters
 removed Use_BBN, use_mpk and others that are currently not updated
 a large number of old files in data/ have been deleted
 Importance sampling
 Added redo_like_name for importance sampling when only one likelihood is changed
 Added redo_no_new_data option to redo only a specific likelihood when importance sampling
 Added redo_add to only calculate changes due to new set of likelihoods (without recomputing old ones)
 .data format for importance sampling reorganised; can now be reused if unused parameter ordering and numbering changes
 Minimization
 Minimizer uses fast and slow subspaces for speed and sanity check on convergence
 Likelihood/chisquare values for the separate data sets tracked separately (as well as total), and output in .minimum file
 start_at_bestfit = T option to start chains at best fit point (if true, be careful with convergence since nondispersed)
 Output .bestfit_cl files with bestfit C_L from action=2 runs. .minimum files now include latex labels (from .paramnames)
 action=3 to find bestfit and hessian (if it works!), and then stop; output .hessian.covmat file and bestfit
 Output chains .txt files only include parameters that are actually varied (specified in .paramnames file; .ranges file specifies all parameters with ranges, including fixed parameters)
 Output .initparams file for each chain giving input parameters used
 Can be compiled in single or double precision (double is new default)
 Added many Planck .covmat files and common/batch input parameter set .ini files.
 Numerous other things
 October 2012
 New bestfit finding routine (action=2) uses Powell's 2009 BOBYQA routine (faster and reliable with bounded
parameters). Bestfit parameter values written out including derived parameters.
 estimate_propose_matrix outputs file in named parameter .covmat compatible format and copes better with parameters with hard prior cuts
 CAMB October 2012 update: tweaked recfast model and support for compiling CosmoMC with CosmoRec and HyRec recombination codes; updated halofit model
 .ini files support reading in file of default parameter values that can then be overridden (greatly reduce duplication between similar runs), e.g. DEFAULT(baseparameter_defaults.ini); can be used in nested way, and with INCLUDE.
 January 2012
 Fixed generation of .paramnames file when using post processing (importance sampling)
 CAMB update for January 2012 (~1e3 improvement in interpolation error, slightly faster for high accuracy); see arXiv:1201.3654
 Added compare_means.m matlab script to graphically compare differences between posterior means from two or more .margestats files with the same parameters (like this)
 Increased precision in GetDist's .margestat files
 Included a couple of extra Plancklike .covmat files for nonflat models and massive neutrinos
 October 2011
 New BAO multipledataset module including Wigglez (thanks to Jason Dosset)
 stop_on_error parameter, if F global_error_flag>0 from CAMB results in a rejected point rather than stop
 Fix to setting fractional number of neutrinos since July CAMB version (thanks to Zhiqi Huang)
 CAMB Oct 2011 update: high_accuracy_default precision in nonflat models, minor tweaks, and error flag
 Makefile updates
 August 2011
 Changes to params_CMB.f90 for gfortran 4.6 compatibility
 July 2011
 Updated matlab colormaps in mscripts directory; added color_for_bw.m (yellowblue/black, which should look consistent printing in B&W).
 all_l_exact likelihood now uses fsky rather than fsky^{2} scaling at all L
 GetDist changes to use more IO wrapper functions
 %DATASETDIR% and %LOCALDIR% placeholder support for all input file names; custom_params input parameter to read and store additional parameter file in CustomParams object (settings.f90), also used as optional additional placeholders.
 .ini files now support INCLUDE(filename) to share common parameters between files. INCLUDES can be nested.
 MPI job now finishes neatly (not aborted) if convergence criterion is achieved
 num_cls now set to 4 by default (include BB). C_l .data files now store every L by default
 CAMB updated to July 2011 version; new high_accuracy_default input parameter to target 0.1%accuracy on small scales
 Added directory of generic python scripts; simple example to make fake perfect CMB dataset with given beam and noise
 Cosmologui compatibility
 May 2010
 Sets helium abundance using BBN consistency ignoring very small error bar (bbn.f90 thanks to Jan Hamann). Set bbn_consistency=F to fix to old default value of 0.24.
 Added nnu (effective number of neutrinos) and YHe (helium fraction) to cmbtypes.f90; now easier to make these varying parameters [by default nnu is fixed to 3.046 and YHe set from BBN consistency)
 Updated supernovae.f90 to Union 2 (Nao Suzuki)
 Updates to BAO for more general acoustic scale calculation (thanks to Jan Hamann and Beth Reid)
 Covariance matrices (.covmat) now only include varied parameters and have a header giving names of parameters used (so much easier to reuse if parameters are reordered or other parameters added)
 Aded local_dir parameter to change default location for .covmat and .paramname files
 New GetDist options
 line_labels=T to write out legend of roots being plotted (matlab)
 finish_run_command to run system command when getdist finished (e.g. "matlab < %ROOTNAME%.m" to make 1D plot)
 no_triangle_axis_labels to suppress axis tick labels (except on edges) when making large triangle plots
 Makefile updated for simpler MKL linking with ifort version 11.1+
 Jan 2010
 Updated to use WMAP 7year likelihood
 Updated CAMB to Jan 2010 version  main change is use of RECFAST 1.5 (up to 2% change in C_{l} at l=2000)
 Added ParamNamesFile optional input parameter for cosmomc
 Added basic support for CMB lensing reconstruction power spectrum, and fullsky implementation in Planck_like.
 October 2009
 [9th Nov] changed use_bao to use_BAO in the sample .ini file
 [27th Oct] fixed GetDist bug in credible intervals with prior cutoffs (Jan Hammann); fixed all_l_exact
 [27th Oct] fixed problems with .newdat files, and sometimeproblem in LRG likelihood; updated ACBAR and BICEP dataset; COSMOS computer detected by Makefile
 Support for naming parameters to simplify changing number of parameters and parameterization. Transfer of names and labels between cosmomc chains and getdist via .paramnames files (should be backwards compatible with old .ini files). Reference indexed .ini parameters by name, e.g. param[omegambh2] as alias for param1. Give getdist plot parameters
as name lists (e.g. H0 omegam tau).
 Added SDSS LRG dataset (thanks to Beth Reid; many changes to mpk.f90; to use must have EXTDATA = LRG in the Makefile)
 supernovae.f90 now replaced by default with SDSS Supernovae compilation (previous code now supernovae_Union.f90; thanks to Wessel Valkenburg); config in data/supernovae.dataset.
 Added simple baryon oscillation option (thanks to Beth Reid)
 Added Quad pipeline 1 dataset (QUAD_pipeline1_2009.newdat). Support for QUADformat .newdat files.
 Changed HST data to use the latest result (HST.f90; thanks to Beth Reid).
 Added optional data_dir input parameter to use different directory than ./data; .newdat data files read window functions from relative path location.
 Updated CAMB to Feb 2009 version (fixed issue with lensed nonflat models) + change to halofit to include w/=1 in the background (Beth Reid)
 New IO wrapper module to simplify pipelining.
 Generalized A_{SZ} internally to allow num_freq_params parameters governing frequencydependent part of CMB signal (default in settings.f90 set to one, A_{SZ} as before  an SZ template amplitude).
 Fixed buffer overflow with CMB lensing and AccuracyLevel > 1.
 Only one source Makefile supplied, and now builds CAMB automatically; if WMAP variable is unset builds without WMAP
 June 2008
Fixed problem initializing nuisance parameters. Updated CAMB to June 2008 version (fix for very closed models).
 May 2008
supernovae.f90 now replaced by default with UNION Supernovae Ia dataset (previous code now supernovae_ReissSNLS.f90; thanks to Anze Slosar).
Additions to Planck_like module; support for sampling and hence marginalizing over data nuisance parameters, point sources, beam uncertainty modes.
New GetDist option single_column_chain_files to support WMAP 5year format chains (thanks to Mike Nolta): 1col_distparams.ini is a supplied sample input file. New GetDist option do_minimal_1d_intervals to calculate equallikelihood 1D limits (see 0705.0440, thanks to Jan Hamann). New GetDist option num_contours to produce more than two sets of limits.
 April 2008
Includes latest CAMB version with new reionization parameterization  default now assumes first ionization of helium happened at the same time as hydrogen, and z_re is defined as the point where x_{e} is half its maximum (the optical depth and z_re are related in a way independent of the speed of the transition in the new parameterization). This changes the z_re numbers at the ~6% level. Fixed bug reading in mpk parameters.
 March 2008
Uses WMAP 5year likelihood code. Added cmb_dataset_SZx and cmb_dataset_SZ_scalex parameters to specify (parameter independent) SZ template for each CMB dataset (WMAP_SZ_VBand.dat included from LAMBDA). Parameter 13 is now A_{SZ}  the scaling of all the SZ templates, as used in WMAP3/WMAP5 papers. Updated supplied covariance params_CMB.covmat for WMAP5. Minor compatibility changes.
 February 2008
Added generic_mcmc in settings.f90 to easily use CosmoMC as generic sampling program without calling CAMB etc (write GenericLikelihoodFunction in calclike.f90 and use Makefile_nowmap). Added latest ACBAR dataset. CAMB update (including RECFAST 1.4). New Planck_like.f90 module for C_{l} likelihoods using approximation of arXiv:0801.0554 (also basic lowl likelihood). Added markerx GetDist parameters for adding vertical lines to parameter x in 1D Matlab plots. Various minor changes/compatibility fixes.
 November 2006
Updated CBI data. Compiler compatibility tweaks. Fixed error msg in mpk.f90. Minor CAMB update. Better error reporting in conjgrad_wrapper (thanks to Sam Leach).
 October 2006
(20th October 2006)Fixed kscaling for SDSS LRG likelihood in mpk.f90. Changes for new version of WMAP likelihood code. Added out_dir and plot_data_dir options for GetDist. Minor compatibility fixes.
Added support for SDSS LRG data (astroph/0608632; thanks to Licia Verde, Hiranya Peiris and Max Tegmark). CAMB fixes and other minor changes.
 August 2006
Improved speed of GetDist 2D plot generation, added limitsxxx support when smoothing = F. Added sampling_method = 5,6, preliminary implementations of multicanonical and WangLandau sampling for nasty (e.g. multimodal) distributions (currently does not compute Evidence, just generates weighted samples). Changed matter_power_minkh (cmbtypes) to work around potential rounding errors on some computers. Updated CAMB following August 2006 version. Added warning about missing limitsxx parameters to getdist. Added MPI_Max_R_ProposeUpdateNew parameter (when varying parameters that are fixed in covmat). Updated CBI data files.
 May 2006
Supernovae.f90 updated to use SNLS by default, edit to use Riess Gold. 2dF updated (twodf.f90 file deleted, use 2df_2005.dataset); covariance matrix support in mpk.f90.
Fixed bug using LSS with nonflat models. Improved error checking and Matlab 7 enhancements in getdist. Getdist auto column counting with columnnum=0, various hidden extra options now shown in sample distparams.ini. Extra fix for confid2D. Fixed MPI thinning bug in utils.F90. Makefile fixes. Fixed mpk.f90 analytical marginalization (since March 2006). SDSS likelihood now computed from k/h=1e4.
 April 2006
Fixed bug in lya.f90 (SDSS lymanalpha now the default; lya.f90 now includes Croft by default). Fixes to Confid2D Matlab script. Added .covmat files for WMAP with running and tensors, and basic Planck simulation. Fixed version confusion in GetDist (onetail limits set to prior limit value).
 March 2006
Updated for 3year WMAP. Added use_lya to include lymanalpha data (standard LCDM only). Default in lya.f90 is LUQAS (can also compile with SDSSLyav3.f90 for SDSS).
New Matlab scripts for producing solid contour and 4D plots. New checkpoint option to generate checkpoint files and continue terminated runs.
Added action=1 parameters redo_add (adds new likelihoods rather than recalculating) and redo_from_text (if you don't have .data files). Added pivot_k and inflation_consistency for use with default power spectrum parameterization.
 July 2005
Added get_sigma8 to force calculation of σ_{8}. Updated .newdat CMB dataset format (also added B03 data files). New use_fast_slow parameter to turn on/off fastslow optimizations. Fixed bug which resulted in occasional wrong tau values when importance sampling .data files. GetDist now outputs one/twotail limit info in .margestats file. Updated CAMB version (support for nonlinear matter power spectrum).
 February 2005
Updated CAMB for new accurate lensed C_{l} calculation of astroph/0502425. Minor changes to getdist (new Matlab_version input parameter, all_limits to set same limits for all parameters). cmbdata.f90 includes new format used by BOOMERANG/CBI for polarization.
 October 13 2004
Fixed bug in mpk.f90 when using 2df. Changes to GetDist for compatibility with Matlab 7. Fixed Makefile_intel (though now obsolete if you have Intel fortran v8).
 October 2004
Added mpk.f90 for reading in general (multiple) matter power spectrum data files in a similar way to CMB dataset files  corresponding changes to input parameter file. Included SDSS data files (note CosmoMC only models linear spectrum).
Various minor bug fixes and improved MPI error handling. Included (though not compiled by default) supernovae_riess_gold.f90 file to include more recent supernova data. Some mscripts fixes for compatibility with Matlab 7.
 August 2004
Improved proposal density for efficient handling of fast and slow parameters, plus more robust distance proposal (should see significant speed improvement). New sampling_method parameter: new options for slice sampling (robust) and directional gridding (robust and efficient use of fast parameters). Also option to use slice sampling for burn in (more robust than Metropolis in many cases), then switch to Metropolis (faster with good covariance matrix). See the notes for details. Improved MPI handling and minor bug fixes. Fixed effect of reionization on CAMB's lensed C_{l} results.
 June 2004
Uses June 2004 CAMB version: bessel_cache.camb file no longer produced or needed (prevents MPI problems). Increased sig figs of chain output and GetDist analysis. New parameter propose_scale, the ratio of proposal width to st. dev., default 2.4 (following Roberts, Gelman, Gilks, astroph/0405462)  often significantly speeds convergence (parameters in .ini file are now estimates of the st. dev., not desired proposal widths). Added MPI_R_StopProposeUpdate to stop updating proposal covariance matrix after a given convergence level has been reached. Added accuracy_level parameter to run at higher CAMB accuracy level (may be useful for forecasting).
 March 2004
Added new VSA and CBI datasets. Added first_band= option to .dataset files to cut out low l that aren't wanted. CAMB pivot scale for tensors changed to 0.05/MPc (same as scalar). Fixed various compiler compatibility issues. Corrected CMB_lensing parameter in sample .ini file. Fixed minor typo in params_CMB.f90. Fixed reading in of MPI_Limit_Converge parameter in driver.F90.
Fixed bounds checking in MatterPowerAt (harmless with 2df). Added an exact likelihood calculation/data format to cmbdata.f90 for polarized full sky CMB C_{l}.
 December 2003
Added MPI support, with stopping on convergence and optional proposal density updating. Added calculation of matter power spectrum at different redshifts using CAMB (settings in cmbtypes.f90). Fixed bug when restarting chains using "continue_from" parameter [March 2006: now obsolete], and a few compiler compatibility issues. Updated CAMB for more accurate nonflat model results. Added output of parameter autocorrelations to GetDist, along with support for ignore_rows<1 to cut out a fraction of the chain and percentile splittest error estimators. Changed proposal density to proposal a random number of parameter changes on each step. Added GetDist samples_are_chains option  if false, rows can be any samples of anything (starting in column one, without an importance weight or likelihood value as produced by CosmoMC)  useful for analysing samples that don't come from CosmoMC. Added GetDist auto_label parameter to label parameters automatically by their parameter number.
 July 2003
Fixed bug in MCMC.f90 affecting all raw chains  weights and likelihoods were displaced by one row. Postprocessed results were correct, and effect on parameters is very small. Minor bug fixes in GetDist. Can now make file_root.read file to be read by all chains file_root_1, file_root_2, etc (this file is not autodeleted after being read).
 May 2003
Added support for 'triangle' plots to GetDist (example. Set triangle_plot=T in the .ini file). If truncation is required, the covariance matrix for CMB data sets is now truncated (rather than truncating the inverse covariance). Fixed CAMB bug with nonflat models, and problem setting CAMB parameters when run separately from CosmoMC.
 March 4 2003
Fixed bug in GetDist  the .margestats file produced contained incorrect limits (the mean and stddev were OK)
 Feb 2003
Support for WMAP data (customized code fixes TE and amplitude bugs). CMB computation now uses C_{l} transfer functions  complete split possible between transfer functions and the initial power spectrum, so improved efficiency handling fast parameters. Bug fixes and tidying of proposal function. Initial power spectrum no longer assumed smooth for P_k. GetDist limitsxxx variables can be N to autosize one end (margestats are still one tail). Support of IBM XL fortran (workarounds for bug on Seaborg). GetDist will automatically compute some chain statistics to help diagnose convergence and accuracy. CAMB updated, including more accurate and faster handling of tight coupling. Option to generate chains including CMB lensing effect. Various other changes.
 Nov 2002
Added support for polarization, and improved compatibility with different compilers and systems.
Reference links
See the BibTex file of CosmoMC references you should cite (including data likelihoods), along with some references of potential interest. These are the two main CosmoMC papers and some general sampling references:
FAQ
 What are the dotted lines on the plots?
Dotted lines are mean likelihoods of samples, solid lines are marginalized probabilities. For Gaussian distributions they should be the same. For skew distributions, or if chains are poorly converged, they will not be. Sometime there is a much better fit (giving high mean likelihood) in a small region of parameter space which has very low marginalized probability. There is more discussion in the original paper.
 What's in the .likestats file produced by getdist?
These are values for the bestfit sample, and projections of the nDimensional confidence region. Usually people only look at the bestfit values. The nD limits give you some idea of the range of the posterior, and are much more conservative than the marginalized limits.
 I'm writing a paper "constraints on X". How do I add X to cosmomc?
To add new theory parameters
 add the definition of the physical parameter to CMBParams in CosmologyTypes.f90
 Change CosmologyParameterizations.f90 to add a new parameterization or modify an existing one. In particular the InitWithSetNames (_Init) procedure has
call SetTheoryParameterNumbers(num_slow_params,num_semi_slow_params)
which sets the number of hard and semihard parameters (the latter being things like initial power spectrum parameters).
Make a new .paramnames file with the new parameter names in and change
and then
call this%Initialize(Ini,Names, 'params_CMB.paramnames', Config)
to set your new parameter names file.
 Modify Calculator_CAMB.f90 (the CAMBCalc_CMBToCAMB procedure) to pass your new CMBParams parameters to CAMB to actually change the result
 Edit your .ini files to to add range and width settings for the new parameter names
If instead your parameter is a likelihood parameter (nuisance parameter), the new parameter can be handled entirely inside your likelihood function code (see supernovae_JLA.f90 for a simple example that has two nuisance parameters): you just set the .paramnames file (which determimes the number of new parameters), and then use them when passed in to your likelihood function. See Likelihood_Cosmology.f90 for likelihood classes that your likelihood can extend.
 Why do some chains sometimes appear to get stuck?
Usually this is because the starting position for the chain is a long way from the best fit region. Since the marginal distributions of e.q. A_s are rather narrow, it can take a while for chains to move from into an acceptable region of A_s exp(2τ). The cure is to check your starting parameter values and start widths (especially make sure the widths are not too wide too small is better than too wide when running with MPI), or to use a sampling method that is more robust (e.g. use sampling_method = 7). If you are patient, stuck chains should eventually find a sensible region of parameter space anyway. Occasionally the staring position may be in a corner of parameter space so that prior ranges prevent any reasonable proposed moves. In this case check your starting values and ranges, or just try restarting the chain (a different random starting position will possibly be OK).
 How to I simulate futuristic CMB data?
See CosmoCoffee.
Feel free to ask questions (and read answers to other people's) on the CosmoCoffee software forum. There is also a FAQ in the CosmoloGUI readme.
Antony Lewis.