ml.bn: Maximum likelihood estimates for parameters of a BN.

Description Usage Arguments Details Value See Also

View source: R/param-ml.R

Description

Computes the maximum likelihood estimates for the parameters of a Bayesian Network. These are just the proportions of each category for each configuration of the parents of a node in the Bayesian Network.

Usage

1
2
3
  ## S3 method for class 'bn'
 ml(x, data, nodes = seq_along(x),
    regularisation = NaN, cache = new.env(hash = T), ...)

Arguments

x

The Bayesian Network. An object of class 'bn'

data

A data frame

nodes

A subset of 1, ..., nNodes(x). A numeric vector.

regularisation

One of NaN, "qi", or a numeric vector of length 1. Supplying NaN will place a NaN in any parts of the table where there is no information. Supplying "qi" will add a factor of 1/(number of parents of node) to each value (as in Bayesian inference). Supplying a number will add this to each value.

cache

A cache

...

Further arguments (unused)

Details

If, for a particular configuration of the parents, we have no observations, then by default, NaN is returned.

Value

A list of length nNodes(x). Each component is a list containing components for each configuration of that node's parents in the Bayesian Network x. Each of these components is a numeric vector of probabilities that sum to 1, labelled with the levels of the relevant node.

See Also

ml


rjbgoudie/structmcmc documentation built on Nov. 3, 2020, 3:41 a.m.