Description Usage Arguments See Also Examples
Draw data according to a Bayesian Network.
1 2 | simulate.bn(object, nsim, seed, ptables, expectation = F,
...)
|
object |
A object of class |
nsim |
Number of simulations |
seed |
The starting seed (UNIMPLEMENTED) |
ptables |
A table of the form generated by
|
expectation |
... |
... |
Further arguments, currently unused |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | cpt <- list(
as.table(array(c(0.7, 0.3), 2)),
as.table(array(c(0.5, 0.5, 0.2, 0.8), c(2, 2)))
)
net <- bn(NULL, 1)
sim <- simulate(object = net, nsim = 1000, ptables = cpt)
# a three node example
cpt <- list(
as.table(array(c(0.7, 0.3), 2)),
as.table(array(c(0.5, 0.5,
0.2, 0.8),
c(2, 2))),
as.table(array(c(
# prob of 1 then 2 given
0.8, 0.2, # p1 = 1, p2 = 1
0.2, 0.8, # p1 = 2, p2 = 1
0.2, 0.8, # p1 = 1, p2 = 2
0.2, 0.8 # p1 = 2, p2 = 2
), c(2, 2, 2)))
)
net <- bn(NULL, 1L, c(1L, 2L))
sim <- simulate(object = net, nsim = 1000, ptables = cpt)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.