sample.cibn: Sampling from a causal independence Bayesian network

Description Usage Arguments Value See Also Examples

View source: R/cibn.r

Description

Draw a random sample from a causal independence Bayesian network

Usage

1
sample.cibn(x, nsam, seed=NULL)

Arguments

x

An object of class cibn.

nsam

The number of sample units.

seed

The seed for the random number generator. If NULL (the default), it is chosen randomly.

Value

An object of class data.frame.

See Also

new.cibn; query.cibn.

Examples

1
2
3
4
5
6
data(bankrisk_code)
bankrisk_bn <- new.cibn(bankrisk_code)
#
bankrisk_sam <- sample.cibn(bankrisk_bn, nsam=100)
head(bankrisk_sam)
summary(bankrisk_sam)

alessandromagrini/cibn documentation built on Feb. 7, 2022, 10:55 p.m.