setAndCalculate: Creates a nimbleFunction for setting the values of one or...

Description Usage Arguments Details Author(s) Examples

Description

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.

Usage

1
setAndCalculate(model, targetNodes)

Arguments

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.

Details

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.

Author(s)

Daniel Turek

Examples

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))

thirdwing/nimble documentation built on May 31, 2019, 10:41 a.m.