inference {gmgm} | R Documentation |
Perform inference in a Gaussian mixture Bayesian network
Description
This function performs inference in a (non-temporal) Gaussian mixture Bayesian network. This task consists in estimating the state of the system given partial observations of it (the evidence). Inference is performed by likelihood weighting, which is a particle-based approximate method (Koller and Friedman, 2009).
Usage
inference(
gmbn,
evid,
nodes = names(gmbn),
n_part = 1000,
max_part_sim = 1e+06,
verbose = FALSE
)
Arguments
gmbn |
A (non-temporal) object of class |
evid |
A data frame containing the evidence. Its columns must explicitly
be named after nodes of |
nodes |
A character vector containing the inferred nodes (by default all
the nodes of |
n_part |
A positive integer corresponding to the number of particles generated for each observation. |
max_part_sim |
An integer greater than or equal to |
verbose |
A logical value indicating whether subsets of |
Value
A data frame (tibble) with a structure similar to evid
containing the estimated values of the inferred nodes.
References
Koller, D. and Friedman, N. (2009). Probabilistic Graphical Models: Principles and Techniques. The MIT Press.
See Also
filtering
, prediction
,
smoothing
Examples
set.seed(0)
data(gmbn_body, data_body)
evid <- data_body
evid$GENDER[sample.int(2148, 430)] <- NA
evid$AGE[sample.int(2148, 430)] <- NA
evid$HEIGHT[sample.int(2148, 430)] <- NA
evid$WEIGHT[sample.int(2148, 430)] <- NA
evid$FAT[sample.int(2148, 430)] <- NA
evid$WAIST[sample.int(2148, 430)] <- NA
evid$GLYCO[sample.int(2148, 430)] <- NA
infer <- inference(gmbn_body, evid, verbose = TRUE)