Problem with NIMBLE Code model Error in addMissingIndexingRecurse

17 views
Skip to first unread message

Richard Golden

unread,
Jul 24, 2025, 3:59:02 PMJul 24
to nimble-users
Hello...everybody...I'm an expert MATLAB user but new to nimble. I've written a few
successful NIMBLE programs so far but having trouble with this one.

Here is a problem I have encountered which i have spent quite a bit of time on and
any help would be greatly appreciated. I've tried to isolate the problem so you can
run it using the two attached files (one file is the main program and one file has
some nimble functions with the nimble code).

I wrote an "R" version of the two nimble functions and the "R" versions and the
nimble functions seem to work outside the "model setup" but not inside the
model setup.

Any suggestions or guidance would be helpful. I think once I understand this I will
have a much better understanding of how to use NIMBLE going forward.
thank you for your consideration of this request! :)

Here is the error message:
[1] "setup CDM constants" [1] "initialize random variables.." [1] "this is an example function call to the functions with similar computations...it seems to be ok..." [1] "compute probabilities..." [1] "setup model...This is where we have a problem..." Defining model Error in addMissingIndexingRecurse(code[[i]], dimensionsList) : inconsistent dimensionality provided for node 'betavector'

ProblemZCDMmodelcode.R
ProblemrunZCDM.R

Chris Paciorek

unread,
Jul 25, 2025, 1:32:04 PMJul 25
to Richard Golden, nimble-users
Hi Richard,

Just based on a quick look at the model code, you define `betavector[1, betawtindex]` as a one-row matrix, but then you try to use it as a vector (1-d array): `betavector[1:nrbetawts]` (and you also initialize it as a vector).

Please see if that helps you fix things and if not, I'll look in more detail.

-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 visit https://groups.google.com/d/msgid/nimble-users/85fdae1e-9d64-401b-9247-cedd8ebb9b23n%40googlegroups.com.

Richard Golden

unread,
Jul 25, 2025, 4:57:58 PMJul 25
to nimble-users
thank you so much for taking a look at this. I've actually resolved this issue but I have a new post on the NIMBLE forum about indexing.
Reply all
Reply to author
Forward
0 new messages