grain-simulate | R Documentation |
Simulate data from an independence network.
## S3 method for class 'grain'
simulate(object, nsim = 1, seed = NULL, ...)
object |
An independence network. |
nsim |
Number of cases to simulate. |
seed |
An optional integer controlling the random number generation. |
... |
Not used. |
A data frame
Søren Højsgaard, sorenh@math.aau.dk
Søren Højsgaard (2012). Graphical Independence Networks with the gRain Package for R. Journal of Statistical Software, 46(10), 1-26. https://www.jstatsoft.org/v46/i10/.
tf <- system.file("huginex", "chest_clinic.net", package = "gRain")
chest <- loadHuginNet(tf, details=1)
simulate(chest,n=10)
chest2 <- setFinding(chest, c("VisitToAsia", "Dyspnoea"),
c("yes", "yes"))
simulate(chest2, n=10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.