Page 1 of 1

Cosmomc 2d contours

Posted: March 31 2006
by Anze Slosar
Hi,

What exactly is the algorithm used for 2D contouring in cosmomc getdist's matlab scripts?

The algorithm I used before and I think it is sensible is to grid samples on a 2d grid, sort the cells by the density and then go from the densenst to the least dense cell until 68% (95%) of all samples are enclosed and record the density at that point which is then used as contouring level. Is something similar used in getdist?

Re: Cosmomc 2d contours

Posted: March 31 2006
by Antony Lewis
Yes, where the bin values are given by a Gaussian weighting given by the distance from the bin centre, with appropriate compensation for priors when near sharp prior boundaries. Technically it does it by a binary search on the density rather than sorting for 2D case. See Get2DPlotData. It is not very efficient.

Should check results are stable under increasing the number of bins - smoothing can make contours look larger than they really are, depending on how sharply the likelihood falls off.