node.names: Utilities for extracting node names from JAGS models

View source: R/utilities.R

node.namesR Documentation

Utilities for extracting node names from JAGS models

Description

These utility functions allow the user to obtain the names of nodes within a compiled JAGS model. The node.names function returns the names of all nodes within the graph (without array indices), and the observed.stochastic.nodes function returns only the node names and incidies that represent observed stochastic variables. The expand.name function converts a base array name (as returned by node.names) along with a provided vector of array dimensions into the vector of node names as returned by observed.stochastic.nodes and the coda.samples function.

Usage

node.names(model)
observed.stochastic.nodes(model)
expand.name(name, dimensions)

Arguments

model

a jags model object

name

a length-1 character string giving the variable name to expand

dimensions

an integer vector giving the dimensions of the variable

Author(s)

Matt Denwood

Examples

data(LINE)
LINE$recompile()
node.names(LINE)
observed.stochastic.nodes(LINE)
expand.name("Y", 5)

rjags documentation built on Nov. 21, 2026, 9:10 a.m.