Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

values

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


Description

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

Usage

values(model, nodes, accessorIndex)

values(model, nodes, accessorIndex) <- value

Arguments

model

a NIMBLE model object, either compiled or uncompiled

nodes

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

accessorIndex

For internal NIMBLE use only

value

value to set the node(s) to

Details

Access or set values for a set of nodes in a NIMBLE model.

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


nimble

MCMC, Particle Filtering, and Programmable Hierarchical Modeling

v0.11.0
BSD_3_clause + file LICENSE | GPL (>= 2)
Authors
Perry de Valpine [aut], Christopher Paciorek [aut, cre], Daniel Turek [aut], Nick Michaud [aut], Cliff Anderson-Bergman [aut], Fritz Obermeyer [aut], Claudia Wehrhahn Cortes [aut] (Bayesian nonparametrics system), Abel Rodrìguez [aut] (Bayesian nonparametrics system), Duncan Temple Lang [aut] (packaging configuration), Sally Paganin [aut] (reversible jump MCMC), Jagadish Babu [ctb] (code for the compilation system for an early version of NIMBLE), Lauren Ponisio [ctb] (contributions to the cross-validation code), Peter Sujan [ctb] (multivariate t distribution code)
Initial release
2021-04-16

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.