values: Access values for a set of nodes in a model

Description Usage Arguments Details Value Author(s)

Description

Get or set values for a set of nodes in a model

Usage

1
values(model, nodes)

Arguments

model

a NIMBLE model object, either compiled or uncompiled

nodes

a vector of node names, allowing index blocks that will be expanded

Details

Calling values(model, nodes) returns a vector of the concatenation of values from the nodes requested P <- values(model, nodes) is a newer syntax for getValues(P, model, values), which still works and modifies P in the calling environment.

Calling values(model, nodes) <- P sets the value of the nodes in the model, in sequential order from the vector P.

In both uses, when requested nodes are from matrices or arrays, the values will be handled following column-wise order.

The older function getValues(P, model, nodes) is equivalent to P <- values(model, nodes), and the older function setValues(P, model, nodes) is equivalent to values(model, nodes) <- P

These functions work in R and in NIMBLE run-time code that can be compiled.

Value

A vector of values concatenated from the provided nodes in the model

Author(s)

NIMBLE development team


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