Description Usage Arguments Details Author(s) See Also Examples
View source: R/writeJagsModel.R
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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | 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)
|
network |
A network of class HydeNetwork |
node |
A node within |
node_str |
A character string giving the name of a node within |
node_params |
A vector of parameters for the node. Generated by
|
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.
Jarrod Dalton and Benjamin Nutter
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.