Provides a data.frame of both random and deterministic nodes in a tsbugs BUGS model. Can also be used to extract nodes from just a single part of the model, such as the prior distributions. This might be of particular use to users when setting up parameters to follow when running models through R2WinBUGS or R2OpenBUGS.
Usage
nodes(bug, part = NULL)
Arguments
bug
A time series BUGS model created using the tsbugs package.
part
A part of the tsbugs models. Must be one of "likelihood", "priors", "forecast" or "simulation". Abbreviations of these parts are allowed (pmatch is used for the matching).
Value
A data.frame with columns:
name
Name of node.
type
Stochastic node represented by ~. Deterministic node represented by <-.
dt
Distribution or transformation in node.
beg
Beginning of node loop.
end
End of node loop.
stoc
Binary representation of type column, where 1 represents a stochastic node and 0 a deterministic node.
id
Line number of node in the BUGS model.
dist
Distribution in node.
param1
First parameter of distribution.
param2
Second parameter of distribution.
Details
Provides a summary of nodes in all of, or part of, the tsbugs BUGS model. Returns a data frame with details on each node. When nodes are within a loop additional details on the starting and ending time points for the node are also given.
# NOT RUN {# Create AR(1) model for Lake Huron dataLH <- LakeHuron
ar1 <- ar.bugs(y = diff(LH), ar.order = 1)
# All nodes in modelnodes(ar1)
# Priors in modelnodes(ar1, "priors")
# }