Learn R Programming

bnstruct (version 1.0.6)

learn.params: learn the parameters of a BN.

Description

Learn the parameters of a BN object according to a BNDataset using MAP (Maximum A Posteriori) estimation.

Usage

learn.params(bn, dataset, ess = 1, use.imputed.data = F)

# S4 method for BN,BNDataset learn.params(bn, dataset, ess = 1, use.imputed.data = FALSE)

Arguments

bn

a BN object.

dataset

a BNDataset object.

ess

Equivalent Sample Size value.

use.imputed.data

use imputed data.

Value

new BN object with conditional probabilities.

Details

Parameter learning is not possible in case of networks learnt using the mmpc algorithm, or from bootstrap samples, as there may be loops.

See Also

learn.network

Examples

Run this code
# NOT RUN {
## first create a BN and learn its structure from a dataset
dataset <- BNDataset("file.header", "file.data")
bn <- BN(dataset)
bn <- learn.structure(bn, dataset)
bn <- learn.params(bn, dataset, ess=1)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab