Returning full log-likelihood from NIMBLE

199 views
Skip to first unread message

TJ McKinley

unread,
Oct 2, 2023, 6:49:36 PM10/2/23
to nimble-users
Hi,

I was wondering if there was a way to return the full un-normalised log-posterior densities for each iteration of the MCMC from NIMBLE (essentially as a way of monitoring convergence)? I know that getLogProbs() will extract the latest value for single nodes, but I want the value at each iterations summed across all nodes. Is this possible to get easily?

Many thanks,

TJ

Daniel Turek

unread,
Oct 4, 2023, 11:35:39 AM10/4/23
to TJ McKinley, nimble-users
Yes, TJ, that can be pretty easily done by writing a custom sampler to record this total log-density value into a model node.

I just sketched out an example of how to do this for posterity:

Let me know if this works for you, or if you have any questions.

Cheers,
Daniel


--
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 on the web visit https://groups.google.com/d/msgid/nimble-users/6003da57-ecbc-4748-99d3-21e95ad3c2b7n%40googlegroups.com.

TJ McKinley

unread,
Oct 5, 2023, 6:05:25 AM10/5/23
to Daniel Turek, nimble-users
Thanks Daniel, this is great. Much appreciated. I will give this a go.

Many thanks indeed,

TJ
Reply all
Reply to author
Forward
0 new messages