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

writeJagsModel

Write a Node's JAGS Model


Description

Constructs the JAGS code that designates the model for the node conditioned on its parents. The parameters for the model may be user supplied or estimated from a given data set.

Usage

writeJagsModel(network, node)

writeJagsModel_default(network, node_str, node_params)

writeJagsModel_dbern(network, node_str, node_params)

writeJagsModel_dcat(network, node_str, node_params)

writeJagsModel_determ(network, node_str, node_params)

writeJagsModel_dnorm(network, node_str, node_params)

writeJagsModel_dnorm_default(network, node_str, node_params)

writeJagsModel_dpois(network, node_str, node_params)

Arguments

network

A network of class HydeNetwork

node

A node within network

node_str

A character string giving the name of a node within network. This is usually generated within writeJagsModel and passed to a specific method.

node_params

A vector of parameters for the node. Generated by writeJagsModel and passed to a specific method.

Details

The manipulations are performed on the nodeParams element of the Hyde network. A string of JAGS code is returned suitable for inclusion in the Bayesian analysis.

The function will (eventually) travel through a serious of if statements until it finds the right node type. It will then match the appropriate arguments to the inputs based on user supplied values or estimating them from the data.

Author(s)

Jarrod Dalton and Benjamin Nutter

See Also

Examples

## Not run: 
#* NOTE: writeJagsModel isn't an exported function
data(PE, package='HydeNet')
Net <- HydeNetwork(~ wells + 
                     pe | wells + 
                     d.dimer | pregnant*pe + 
                     angio | pe + 
                     treat | d.dimer*angio + 
                     death | pe*treat,
                     data = PE)
HydeNet:::writeJagsModel(Net, 'pe')
HydeNet:::writeJagsModel(Net, 'treat')

## End(Not run)

HydeNet

Hybrid Bayesian Networks Using R and JAGS

v0.10.11
MIT + file LICENSE
Authors
Jarrod E. Dalton <daltonj@ccf.org> and Benjamin Nutter <benjamin.nutter@gmail.com>
Initial release

We don't support your browser anymore

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