Description Usage Arguments Details Value Author(s) Examples

View source: R/HydePosterior.R

The simulated distributions of the decision network can be evaluated to determine the probabilistic outcomes based on the decision inputs in the model as well as subject specific factors.

1 2 3 4 5 6 7 8 9 10 11 | ```
HydeSim(
cHN,
variable.names,
n.iter,
thin = 1,
...,
monitor_observed = TRUE,
bind = TRUE
)
HydePosterior(...)
``` |

`cHN` |
A |

`variable.names` |
a character vector giving the names of variables to be monitored. |

`n.iter` |
number of iterations to monitor. |

`thin` |
thinning interval for monitors. |

`...` |
options arguments that are passed to the update method for jags model objects. |

`monitor_observed` |
If TRUE, the observed or fixed variables (those
passed to the |

`bind` |
Logical. If |

This is essentially a wrapper around `coda.samples`

that
returns in a list the output for each run of `coda.samples`

over
the rows of the policy/decision matrix given in the `data`

argument
of `compileJagsNetwork`

.

A list of class `HydeSim`

with elements `codas`

(the MCMC matrices from `coda.samples`

), `observed`

(the values
of the variables that were observed), `dag`

(the dag object for
convenience in displaying the network), and `factorRef`

(giving the
mappings of factor levels to factor variables).

Jarrod Dalton and Benjamin Nutter

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ```
data(PE, package="HydeNet")
Net <- HydeNetwork(~ wells +
pe | wells +
d.dimer | pregnant*pe +
angio | pe +
treat | d.dimer*angio +
death | pe*treat,
data = PE)
compiledNet <- compileJagsModel(Net, n.chains=5)
#* Generate the posterior distribution
Posterior <- HydeSim(compiledNet,
variable.names = c("d.dimer", "death"),
n.iter = 1000)
#* Posterior Distributions for a Decision Model
Net <- setDecisionNodes(Net, angio, treat)
decisionNet <- compileDecisionModel(Net, n.chains=5)
decisionsPost <- HydeSim(decisionNet,
variable.names = c("d.dimer", "death"),
n.iter = 1000)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.