Learn R Programming

bnlearn (version 2.0)

bn.fit: Fit the parameters of a Bayesian network

Description

Fit the parameters of a Bayesian network conditional on its structure.

Usage

bn.fit(x, data, debug = FALSE)

Arguments

x
an object of class bn.
data
a data frame, containing the variables in the model.
debug
a boolean value. If TRUE a lot of debugging output is printed; otherwise the function is completely silent.

Value

See Also

bn.fit utilities, bn.fit plots.

Examples

Run this code
data(learning.test)

# learn the network structure.
res = gs(learning.test)
# set the direction of the only undirected arc, A - B.
res = set.arc(res, "A", "B")
# estimate the parameters of the Bayesian network.
fitted = bn.fit(res, learning.test)

Run the code above in your browser using DataLab