Description Usage Arguments Details Value Examples
(dn) returns a matrix having simu rows and as many columns as
variables in the bn, using the joint probability distribution
implicitely defined by the bn.
Some of the columns can be already
computed, in that case there are skipped from the general loop. This
applies only for the root nodes to save the consistency with the /bn/
structure.
1 | simulate8bn(bn, simu=100)
|
bn |
the bn 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. |
A compatible order with the definition of the conditional
probabilities is first computed by porder, then nodes are sucessively
generated according to this order using the generating functions
stored into @rlks (except for some specific cases like 'empidata',
'numcat'...
BE AWARE that if a multivariate root node is included
in the matrix simu, then ALL variables must be included and the fact
is not checked.
Notice that the function relies on the column
names of this matrix and also that the control of existing variables
in case of multivariate nodes is not made a priori but at the moment
of their use (then possibly generating an error message at an
unexpected point for the user).
the resulting data frame with values outside corresponding 'lpod's put to NA)
1 2 3 4 5 6 | rebastaba3k("RESET"); # For R convenience when checking
simulate8bn(rebastaba.bn1, 10);
simulate8bn(rebastaba.bn2, 10);
simulate8bn(rebastaba.bn3, 10);
simulate8bn(rebastaba.bn4, 10);
simulate8bn(rebastaba.bn5, 10);
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.