Deal with proposals outside the prior range
Even when proposals are outside the prior range, the code still tries to evaluate log_l on them.
This is problematic when the prior range is given for the reason we cannot compute log_l outside it, e.g. when the prior range is just the input domain. In my case, IMRPhenomDGenerateh22FDAmpPhase
complains when we set spins outside the range [-1, 1].
The question is how we should solve the problem. I have three solutions in mind:
- Reject proposals that are outside the prior range. If this is the way to go, I guess we need to modify
full_step
inchain.py
. - Modify the provided log_l function with a decorator, in such a way that it returns -inf when proposals are outside.
- The same as 2 but let users of the code to deal with it every time themselves.
For me all the above are mathematically correct and I like the first one the most. However, I've only seen the third solution in other samplers, maybe because it's easier to implement.
What's your opinions? @maudelejeune @stas