nimble
nimble copied to clipboard
constant 'pi' in model code doesn't work
This must have once worked?
m <- nimbleModel(
nimbleCode({my_pi <- pi})
)
m$my_pi #NA
Please see issue #92 - we had a lengthy discussion of this and decided not to handle it natively.
Oh yeah, thanks. I guess we could error-trap it?
Error trap in what manner?
One logical perspective is that pi
should be a valid variable name in models (for stochastic, or RHS nodes) as in this example, without throwing in error.
Maybe, perhaps, issuing a Note
, at the time of model building:
[Note]: The use of "pi" as a variable name is detected in model.
This will represent a model variable the same as any other name,
and will not have any implied connection with the numerical value 3.14159....
Yes, I was imagining a short note
if we detect pi in a model and it was not set as part of data
, constants
, or inits
.
Should make sure it's only RHS.