grain-simulate: Simulate from an independence network

Description Usage Arguments Value Author(s) References Examples

Description

Simulate data from an independence network.

Usage

1
2
## S3 method for class 'grain'
simulate(object, nsim = 1, seed = NULL, ...)

Arguments

object

An inpendence network

nsim

Number of cases to simulate

seed

An optional integer controlling the random number generatation

...

Not used...

Value

A data frame

Author(s)

S<c3><b8>ren H<c3><b8>jsgaard, [email protected]

References

S<c3><b8>ren H<c3><b8>jsgaard (2012). Graphical Independence Networks with the gRain Package for R. Journal of Statistical Software, 46(10), 1-26. http://www.jstatsoft.org/v46/i10/.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 

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)

## End(Not run)

gRain documentation built on May 30, 2017, 8:20 a.m.