Learn R Programming

HydeNet (version 0.10.11)

vectorProbs: Convert a vector to JAGS Probabilities

Description

Probability vectors can be passed manually to the model, but they must be formatted in code appropriate to JAGS. vectorProbs will convert a vector of counts or weights to probabilities and format it into JAGS code.

Usage

vectorProbs(p, node, normalize = TRUE)

Arguments

p

a vector of counts, weights, or probabilities.

node

the node for the parameters. this is converted to a character string. It is important that this be given accurately or it will not match with the code written by writeNetworkModel.

normalize

A logical indicating if the weights in p should be normalized (each value is taken as a proportion of the sum).

Examples

Run this code
# NOT RUN {
vectorProbs(c(1, 2, 3), "wells")

# }

Run the code above in your browser using DataLab