Makes predictions (either as the most likely state or as the conditional distributions) of variables conditional on finding (evidence) on other variables in an independence network.
# S3 method for grain
predict(object, response, predictors = setdiff(names(newdata),
response), newdata, type = "class", ...)
A grain object
A vector of response variables to make predictions on
A vector of predictor variables to make predictions from. Defaults to all variables that are note responses.
A data frame
If "class", the most probable class is returned; if "distribution" the conditional distrubtion is returned.
Not used
A list with components
A list with the predictions
A vector with the probability of the finding (evidence) on which the prediction is based
S<U+00F8>ren H<U+00F8>jsgaard (2012). Graphical Independence Networks with the gRain Package for R. Journal of Statistical Software, 46(10), 1-26. http://www.jstatsoft.org/v46/i10/.