WAIC calculation for joint models

6 views
Skip to first unread message

Lawson, Andrew B.

unread,
Jul 17, 2024, 4:43:44 PM (5 days ago) Jul 17
to nimble...@googlegroups.com
Hi 
I have a two-part question about how WAIC is calculated in the specific situation where there are two linked data models (likelihoods)
in a given model. 
The first question is: how is the WAIC calculated in Nimble if there are two (or more) models ? 
Second, is there any way to obtain a split WAIC for each model currently?
This was something that used to be available for DIC in BUGS and could be very useful.

best wishes
Andrew


Chris Paciorek

unread,
Jul 17, 2024, 8:10:45 PM (5 days ago) Jul 17
to Lawson, Andrew B., nimble...@googlegroups.com
hi Andrew,

This isn't something we've considered. WAIC is calculated based on the full likelihood from all contributions to the likelihood, however they appear in the model, i.e., based on what nodes are flagged as data. 

There's no way to do that currently that I can see. One potential approach would be to modify some of nimble's code (from the `MCMC_WAIC.R` file) to calculate your desired WAIC offline (i.e., after running the MCMC). 

I think what you'd need to do is:
- modify the `buildOfflineWAIC` nimbleFunction in `MCMC_WAIC.R` to only use a subset of data nodes (by having `dataNodes` be an argument to the `setup` function rather than being obtained from `model$getNodeNames(dataOnly = TRUE)` in lines 29-30 of `MCMC_WAIC.R`.
- modify `calculateWAIC` (in lines 545-551 of `MCMC_WAIC.R`) to run the new `buildOfflineWAIC` once for each set of data nodes and then calculate and return WAIC for each set.

Happy to iterate if you want to take a try at it and have questions/problems.

-chris



--
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/PH7PR11MB7499E3D9CD84CFCBEED40C40A3A32%40PH7PR11MB7499.namprd11.prod.outlook.com.
Reply all
Reply to author
Forward
0 new messages