| Index | Topics |
| bn.fit {bnlearn} | R Documentation |
Fit the parameters of a Bayesian network
Description
Fit the parameters of a Bayesian network conditional on its structure.
Usage
bn.fit(x, data, method = "mle", ..., debug = FALSE)
Arguments
x |
an object of class bn. |
data |
a data frame containing the variables in the model. |
method |
a character string, either mle for Maximum Likelihood parameter estimation or
bayes for Bayesian parameter estimation (currently implemented only for discrete
data). |
... |
additional arguments for the parameter estimation prcoedure, see below. |
debug |
a boolean value. If TRUE a lot of debugging output is printed; otherwise the function is
completely silent. |
Value
An object of class bn.fit. See bn.fit class for
details.
Note
Due to the way Bayesian networks are defined it's possible to estimate their parameters only if the network
structure is completely directed (i.e. there are no undirected arcs). See set.arc and pdag2dag for two ways of manually
setting the direction of one or more arcs.
The only supported additional parameter is the imaginary sample size (iss) for the Dirichlet
posterior distribution of discrete networks (see score for details).
Author(s)
Marco Scutari
See Also
bn.fit utilities, bn.fit
plots.
Examples
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)
| Index | Topics |
