Description Usage Arguments Details Author(s) Examples
This nimbleFunction generator must be specialized to any model object and one or more model nodes. A specialized instance of this nimbleFunction will set the values of the target nodes in the specified model, calculate the associated logProbs, calculate the values of any deterministic dependents, calculate the logProbs of any stochastic dependents, and return the sum log-probability associated with the target nodes and all stochastic dependent nodes.
1 | setAndCalculate(model, targetNodes)
|
model |
An uncompiled or compiled NIMBLE model. This argument is required. |
targetNodes |
A character vector containing the names of one or more nodes or variables in the model. This argument is required. |
Calling setAndCalculate(model, targetNodes) will return a function with a single, required argument:
targetValues: A vector of numeric values which will be put into the target nodes in the specified model object. The length of this numeric vector much exactly match the number of target nodes.
Daniel Turek
1 2 | my_setAndCalc <- setAndCalculate(Rmodel, c('x[1]', 'x[2]', 'y[1]', 'y[2]'))
lp <- my_setAndCalc(c(1.2, 1.4, 7.6, 8.9))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.