willvousden / ptemcee

A parallel-tempered version of emcee.
MIT License
57 stars 29 forks source link

Need blob data support #7

Open cdcapano opened 6 years ago

cdcapano commented 6 years ago

The EnsembleSampler in emcee supports storing blob data. This allows us to store additional information aside from just the loglikelihood and logprior (e.g., in gravitational-wave analyses, we like to know what the loglikelihood is in each detector). Can support for blobs be added?

With the ensemble sampler, it looks if it gets a tuple back from the lnpost function. If so, it assumes the first element in the tuple is the logposterior and the second element is the blob data, which can be anything. It stores the blob to a chain of blobs, which can then be retrieved later. Things are a bit different here because you require separate loglikelihood and logprior functions. But maybe allow for the possibility that either or both of these functions return blob data, then store each as separate chains (e.g., pblobs be the blob data returned by the prior function and lblobs be the blob data returned by the loglikelihood function).