Bind Output From coda Samples
After determining the simulated distributions are satisfactory, it can be advantageous to bind the simulated distributions together in order to aggregate values and perform other manipulations and analyses.
bindSim(hydeSim, relabel_factor = TRUE) bindPosterior(hydeSim, relabel_factor = TRUE)
hydeSim |
An object of class |
relabel_factor |
Logical. If |
For the purposes of this function, it is assumed that if the simulated distributions are satisfactory, the multiple chains in a run can be bound together. Subsequently, the multiple runs are bound together. Lastly, the factors are relabeled, if requested.
Jarrod Dalton and Benjamin Nutter
#' 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 simulated distribution Simulated <- HydeSim(compiledNet, variable.names = c("d.dimer", "death"), n.iter=1000) Bound <- bindSim(Simulated) #* Bind a Decision Network #* Note: angio shouldn't really be a decision node. #* We use it here for illustration Net <- setDecisionNodes(Net, angio, treat) compiledDecision <- compileDecisionModel(Net, n.chains=5) SimulatedDecision <- HydeSim(compiledDecision, variable.names = c("d.dimer", "death"), n.iter = 1000)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.