"log probability density value of infinity"

54 views
Skip to first unread message

PierGianLuca

unread,
Apr 15, 2025, 12:22:46 PM4/15/25
to nimble-users
Hi great Nimble devs!

Just a quick question: since an update or two of Nimble, I often see the message "MCMC sampling encountered a log probability density value of infinity. Results of sampling may not be valid." during sampling. This is happening with very diverse datasets.

So I wanted to ask whether this message didn't exist in previous versions – so it was happening before but I wasn't aware –, or if it's always been there – which means some bug must have entered in my sampling routines.

Thank you for your help and, as usual, for Nimble!
Luca

Perry de Valpine

unread,
Apr 15, 2025, 2:02:58 PM4/15/25
to PierGianLuca, nimble-users
Hi Luca,
Thanks for the question. Yes, these messages were added fairly recently. On the other hand, they don't necessarily mean there is a problem (sometimes a sampler will explore values that are not valid, and they will be rejected). We'd welcome feedback on whether the messages are helpful and working ok.
Perry


--
You received this message because you are subscribed to the Google Groups "nimble-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nimble-users...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/nimble-users/a5912243-edd2-89cc-7f7d-8fa16b9eed43%40magnaspesmeretrix.org.

PierGianLuca

unread,
Apr 17, 2025, 3:25:06 AM4/17/25
to Perry de Valpine, nimble-users
Hi Perry,

Thank you for the clarification and explanation. Then I'm relieved, as the results make sense now and they did in the past. It's always useful to know that these rejections occur. Maybe a shorter message, or the possibility of suppressing them? But things are good as they are as well :)

Cheers,
Luca

Lucile Mo'

unread,
Jan 14, 2026, 12:25:56 PM (8 days ago) Jan 14
to nimble-users
Hi Perry,

I encouter the same kind of messages as Lucas. However, when they appear several issues are following such as: the impossiblity to obtain traceplot using MCMCtrace, Rhat and n.eff for certain parameters estimated. 
I was wondering if you had any tips to solve this issue.

Thanks
Lucile

Chris Paciorek

unread,
Jan 15, 2026, 1:30:12 PM (6 days ago) Jan 15
to Lucile Mo', nimble-users
Hi Lucile,

I'm not able to fully understand your message regarding what is impossible. Do you mean that the sampler stops before finishing or that there are NA or NaN values in the samples produced?

As Perry noted in the original discussion, in some cases it might be ok to ignore the message, though one should try to understand why an infinity might occur and how that impacts the validity of the sampling. However, if you are getting NaN values, that suggests something serious is going wrong with the sampler.

If you can provide a minimal reproducible example (on- or off-list) we could take a look to try to better understand what is happening.

-Chris

Reply all
Reply to author
Forward
0 new messages