bn2dn: simulates data from a bn

Description Usage Arguments Details Value Examples

Description

(dn) This function creates a /dn/ object simulating bn simu times.

Usage

1
bn2dn(bn, simu=100, score=TRUE)

Arguments

bn

the bn object with which to simulate

simu

Either (1) a numeric indicating the desired number of simulations, or (2) a data.frame whose the number of rows indicates the desired number of simulations, and where columns can comprises already computed nodes. More details are given in the documentation of simulate8bn.

score

When TRUE, an additional variable scoring the likelihood of each individual according to the variable domains is added. See the function dn2score for more details.

Details

In a first version, the function was performing a genuine simulation from the distributions associated to each node of the bn. Then, it was found convenient to allow 'already known nodes' using simu as a matrix.

Value

The resulting dn object

Examples

1
2
3
4
5
6
7
 rebastaba3k("RESET"); # For R convenience when checking
 print(bn2dn(rebastaba.bn1, 10), quoi="i", simu=100);
 print(bn2dn(rebastaba.bn2, 10), quoi="i", simu=100);
 print(bn2dn(rebastaba.bn3, 10), quoi="i", simu=100);
 print(bn2dn(rebastaba.bn4, 10), quoi="i", simu=100);
 print(bn2dn(rebastaba.bn5, 10), quoi="i", simu=100);
 print(bn2dn(rebastaba.bn6, 10), quoi="i", simu=100);

rebastaba documentation built on May 2, 2019, 5:24 p.m.

Related to bn2dn in rebastaba...