Perform belief propagation for the network of an InferenceEngine, given a set of observations.
In the current version of bnstruct
, belief propagation can be computed only over a junction tree.
belief.propagation(ie, observations = NULL, return.potentials = FALSE)# S4 method for InferenceEngine
belief.propagation(ie, observations = NULL, return.potentials = FALSE)
updated InferenceEngine
object.
an InferenceEngine
object.
list of observations, consisting in two vector, observed.vars
for the observed variables,
and observed.vals
for the values taken by the variables listed in observed.vars
. If no observations
are provided, the InferenceEngine
will use the ones it already contains.
if TRUE only the potentials are returned, instead of the default BN
.