passing arguments into nimble

5 views
Skip to first unread message

Brook Milligan

unread,
Sep 9, 2025, 4:35:14 PMSep 9
to nimble-users
I have a complex hierarchical model with lots of related constants, data, etc. Until now, I have always passed lists of scalars as the constants, data, and inits arguments to nimble. Now, as the scale increases, that seems confusing and error prone.

Is it possible to represent related quantities in a higher level data structure, e.g., a list, and pass the entire list as part of, say, the constants? Something like,

L <- list(A,B,C,D)
nimbleMCMC(constants=L)

and refer to L$A[i] and L$B[j] in the model itself?

When I try something like this, I get messages like the following:

[Warning] Indexing information for A not provided in `constants`.
Information has been found in the user's environment,
but we recommend all indexing information be provided via `constants`.

To me, this suggests that nimble is not using the list argument as the source of information being passed into the model.

Thoughts?

Cheers,
Brook

Perry de Valpine

unread,
Sep 10, 2025, 3:06:50 AMSep 10
to Brook Milligan, nimble-users
The short answer is no, that is not supported.
You could write functions that take the higher-level input you want to use and then re-arrange them for what nimble needs. E.g. `constants=do.call("c", L)` or `do.call("c", L) |> structure(names=L|>sapply("names"))`.
HTH
Perry



--
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/BC4F6F18-5ED6-44FF-868C-6D16CD47AACC%40nmsu.edu.
Reply all
Reply to author
Forward
0 new messages