JamesPaynter / PyGRB

Gamma-ray burst analysis library
https://pygrb.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
28 stars 8 forks source link

Example in docs produces NaNs #5

Closed zingale closed 4 years ago

zingale commented 4 years ago

Running the example here: https://pygrb.readthedocs.io/en/latest/user/usage.html

The output results in some nans to the stdio:

22:41 bilby INFO    : Sampling time: 0:00:18.407568
22:41 bilby INFO    : Summary of results:
nsamples: 4645
log_noise_evidence:    nan
log_evidence: -3709.519 +/-  0.310
log_bayes_factor:    nan +/-  0.310

is this an error?

zingale commented 4 years ago

perhaps related, there are overflows reported:

/home/zingale/temp/PyGRB/PyGRB/backend/rate_functions.py:77: RuntimeWarning: overflow encountered in exp
  rate = np.where(times - start <= 0, MIN_FLOAT, scale * np.exp( - xi * (
/home/zingale/temp/PyGRB/PyGRB/backend/rate_functions.py:77: RuntimeWarning: overflow encountered in multiply
  rate = np.where(times - start <= 0, MIN_FLOAT, scale * np.exp( - xi * (
zingale commented 4 years ago

tagging the JOSS review: https://github.com/openjournals/joss-reviews/issues/2536

JamesPaynter commented 4 years ago

Not an error, log_evidence is the only part needed here. log_noise_evidence is nan because there is no noise model specified in the likelihood (this is printed by bilby, not pygrb) log_bayes_factor is nan because there is only one model specified and hence the bayes factor between two models cannot be evaluated.

The overflows are not valid evaluations and are rejected by the sampler, but I have not managed to suppress the warnings entirely.

I updated the docs accordingly: https://pygrb.readthedocs.io/en/latest/user/usage.html

James

zingale commented 4 years ago

great! Looks good.