Deterministic nodes cannot be specified as 'data' or 'constants'

Skip to first unread message

Dan Linden

Jun 5, 2023, 8:52:23 AM6/5/23
to nimble-users
I realize the paint is still drying on version 1 so I apologize for discussing this bug that has already been identified (

I attempted Perry's proposed solution but it did not work so thought I would start a conversation here.  This issue affects models with variables that have a mix of RHSonly and stochastic nodes, which is obviously pretty common for BUGS-style approaches to partially latent variables in ecology (capture-recapture, etc.).  My application is a multi-event model conditioning on first capture which worked without error in NIMBLE before version 1 (which is not to say the model was ideal or without flaws!).

I probably made a mistake trying to implement Perry's fix.  Either way, hoping a conversation may be helpful.

Daniel Turek

Jun 5, 2023, 10:04:43 AM6/5/23
to Dan Linden, nimble-users
Dan, are you able to share reproducible code implementing your attempt at the workaround - that which is still not working correctly for you?  That would certainly help us take a look at what's going awry.


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
To view this discussion on the web visit

Dan Linden

Jun 5, 2023, 12:34:40 PM6/5/23
to nimble-users
Hi Daniel, it does look like Perry's solution works.  This was a model translated from JAGS and the actual problem was that the latent state at first capture was being assigned in the model.  This assignment is what NIMBLE version 1.0 did not like, and the fix is easy.  Taking that statement out and using data and initial values (absent any NAs) to inform the latent states works fine.

It does give me the following note, but clearly this is expected:
[Note] Ignoring non-NA values in inits for data nodes: Z
Reply all
Reply to author
0 new messages