Learn R Programming

bnstruct (version 1.0)

InferenceEngine-class: InferenceEngine class.

Description

InferenceEngine class.

Constructor method of InferenceEngine class.

constructor for InferenceEngine object

Usage

"initialize"(.Object, ...)
InferenceEngine(bn = NULL, observations = NULL, ...)

Arguments

.Object
an empty InferenceEngine object.
...
potential further arguments of methods.
bn
a BN object.
observations
a list of observations composed by the two following vectors:
  • observed.vars:vector of observed variables;
  • observed.vals:vector of values observed for the variables in observed.vars in the corresponding position.

Value

an InferenceEngine object.InferenceEngine object.

Slots

junction.tree:
junction tree adjacency matrix.
num.nodes:
number of nodes in the junction tree.
cliques:
list of cliques composing the nodes of the junction tree.
triangulated.graph:
adjacency matrix of the original triangulated graph.
jpts:
inferred joint probability tables.
bn:
original Bayesian Network (as object of class BN) as provided by the user, or learnt from a dataset. NULL if missing.
updated.bn:
Bayesian Network (as object of class BN) as modified by a belief propagation computation. In particular, it will have different conditional probability tables with respect to its original version. NULL if missing.
observed.vars:
list of observed variables, by name or number.
observed.vals:
list of observed values for the corresponding variables in observed.vars.

Examples

Run this code
## Not run: 
# dataset <- BNDataset()
# dataset <- read.dataset(dataset, "file.header", "file.data")
# bn <- BN(dataset)
# eng <- InferenceEngine(bn)
# 
# obs <- list(c("A","G,"X),c(1,2,1))
# eng.2 <- InferenceEngine(bn, obs)
# ## End(Not run)

Run the code above in your browser using DataLab