Emcee chains error
I am a graduate student at the Institute of Theoretical Physics, Chinese Academy of Sciences. I use bilby for Bayesian analysis. The sampler emcee can't give the correct contour and I found a bug in bilby.
In the file core/sampler/emcee.py, line 359 and line 371
chain = self.sampler.chain.reshape((-1, self.ndim)) self.result.samples = chain[n_samples:, :]
The chain is reshaped before dropping burn-in steps(slice after n_samples). But this will throw away n_samples in the first chain instead of the first nburns in each chains. So the samples stored in the result is wrong. On the other hand, ptemcee.py do the slice before reshape. I modified emcee.py according to ptemcee.py and the result is correct.
I hope that you can correct this bug, and thank you for your contribution.
EDIT: I reformatted to use the code-formatting (Greg Ashton)