plan0: generates values from one node of a bn

Description Usage Arguments Details Value Examples

Description

(bn) A vector of N values is extracted from a (most often marginal) node according to different ways to serve as value(s) when further generating a simulation design.
The possibilities depends on the node: root, distribution...
The result depends also on the nature of the variable ( numeric or character).

Usage

1
plan0(bn, ion, N=5, type="U")

Arguments

bn

The original bn.

ion

indicates the unique node from which values must be returned (iin or name).

N

number of values to extract.

type

The way to extract the values: "U" for equally spaced along the plausible range (numeric) "R" for randomly drawn from the distribution (this applies only for root nodes), "P" for proportional to the distribution (this applies only for numeric root nodes and when the distribution is a standard case where R provides the cumulative distribution.
For the moment, only the "U" option is implemented.

Details

Notice that the result can be random, so it is advisable to monitor the pseudo-random seed value. Multivariate nodes are accepted and their variables are considered as independent nodes.

Value

The resulting vector of values (in fact a matrix with as many columns as variables in the node, and N rows).

Examples

1
2
3
 rebastaba3k("RESET"); # (only for R checking)
 plan0(rebastaba.bn2, 1);
 plan0(rebastaba.bn2, 2);

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

Related to plan0 in rebastaba...