Brook Milligan
unread,Sep 9, 2025, 7:24:35 PMSep 9Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to nimble-users
Hi all,
I am trying to understand the rules for defining variables within a nimble model. It seems that there should be some simple rules that are generally applicable, but some of that is eluding me.
The nimble manual (section 6.1.1.1) states the following:
Values for nodes that appear only on the right-hand side of BUGS declarations (e.g., covariates/predictors) can be provided as constants or as data or initial values. There is no real difference between providing as data or initial values and the values can be added after building a model via setInits or setData.
Although the second sentence is not quite as inclusive as the first, the first directly states that RHS variables can be defined via any of the three possible means: constants, data, initial values.
I have a simple case (see attached) that demonstrates to me that this is not the case. There are three different calls to nimbleMCMC that differ only in the way that a RHS variable is defined (one per possibility, see lambda). Case 3 (using constants) fails with the following, so at least in this case they are not all equivalent and possible.
Defining model
Error in addMissingIndexingRecurse(code[[i]], dimensionsList) :
inconsistent dimensionality provided for node 'lambda’
Calls: nimbleMCMC ... addMissingIndexingRecurse -> addMissingIndexingRecurse
Execution halted
I must be missing something here, but I do not see it. What are the rules that govern initialization of model variables?
Thanks a lot for your help.
Cheers,
Brook