Random values simulation from a Bayesian network: Random values simulation from a Bayesian network
Description
Random values simulation from a Bayesian network.
Usage
rbn(n, dagobj, x)
Arguments
n
The number of observations to generate.
dagobj
A "bn" object. See the examples for more information.
x
The data used to fit the Bayesian network in a data.frame format.
Value
A data frame with the same structure (column names and data types) of the argument "data".
Details
This information is taken directly from the R package "bnlearn". This function implements forward/logic sampling: values for the root nodes are sampled from their (un-conditional) distribution, then those of their children conditional on the respective parent sets. Thisis done iteratively until values have been sampled for all nodes.If "dagobj" contains NA parameter estimates (because of unobserved discrete parents configurations in the data the parameters were learned from), rbn will produce observations that contain NAs when thoseparents configurations appear in the simulated samples.
References
Korb K. and Nicholson A.E. (2010).Bayesian Artificial Intelligence. Chapman & Hall/CRC, 2nd edition.