rbn()
implements forward/logic sampling: values for the root nodes are
sampled from their (unconditional) distribution, then those of their children
conditional on the respective parent sets. This is done iteratively until
values have been sampled for all nodes.
If x
contains NA
parameter estimates (because of unobserved
discrete parents configurations in the data the parameters were learned from),
rbn
will produce samples that contain NA
s when those parents
configurations appear in the simulated samples. See bn.fit
for
details on how to make sure bn.fit
objects contain no NA
parameter estimates.