PolyChord / PolyChordLite

Public version of PolyChord: See polychord.co.uk for PolyChordPro
https://polychord.io/
Other
83 stars 26 forks source link

Calculating minimum loglikelihoods after live point generation #73

Closed williamjameshandley closed 2 years ago

williamjameshandley commented 2 years ago

The variables RTI%i were not being calculated after live points had been generated. The function delete_outermost_point called in src/polychord/nested_sampling.F90 assumes that they have. This function is however only called in uninitialised form if nprior>nlive, and only results in undefined behavior for positive likelihoods (since this drives the minpos search function into regions of unallocated space). While this therefore seems to be one of those 'how did that ever work?' bugs, the actual situation in which it expresses itself is actually quite unusual, since loglikelihoods are usually negative (although not always, depending on the dimensions of continuous variables in probability densities like P(D|theta)).

Many thanks @yallup for the MWE, and for pointing this out. Could you test whether this fixes your solution

Fixes #72