setAndCalculateOne: Creates a nimbleFunction for setting the value of a scalar...

Description Usage Arguments Details Author(s) Examples

Description

This nimbleFunction generator must be specialized to any model object and any scalar model node. A specialized instance of this nimbleFunction will set the value of the target node in the specified model, calculate the associated logProb, calculate the values of any deterministic dependents, calculate the logProbs of any stochastic dependents, and return the sum log-probability associated with the target node and all stochastic dependent nodes.

Usage

1
setAndCalculateOne(model, targetNode)

Arguments

model

An uncompiled or compiled NIMBLE model. This argument is required.

targetNode

The character name of any scalar node in the model object. This argument is required.

Details

Calling setAndCalculateOne(model, targetNode) will return a function with a single, required argument:

targetValue: The numeric value which will be put into the target node, in the specified model object.

Author(s)

Daniel Turek

Examples

1
2
my_setAndCalc <- setAndCalculateOne(Rmodel, 'x[1]')
lp <- my_setAndCalc(2)

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