Description Usage Arguments Value Author(s) See Also Examples
Determines the structure and the conditional probability tables for the Chow-Liu tree fitted to data.
1 |
data |
The data the tree structure should be based on. |
root |
An optional argument, choosing a userspecified root for the tree. |
bayes_smooth |
Additional cell counts for bayesian estimation of probability tables. |
CPTs |
A logical value indicating whether conditional probability tables should be estimated from data or not. |
... |
Additional parameters passed to |
A list containing the following components:
skeleton_adj
The adjacency matrix for the skeleton
of the Chow-Liu tree.
adj_DAG
The adjacency matrix of the resulting DAG.
CPTs
The estimated conditional probability tables
of the bayesian network if estimated. Otherwise the logical value
FALSE
.
Katrine Kirkeby, enir_tak@hotmail.com
Maria Knudsen, mariaknudsen@hotmail.dk
Ninna Vihrs, ninnavihrs@hotmail.dk
MI2
for mutual information,
CPT
for probability tables and
is_acyclic
for a test for cycles.
1 2 3 4 5 6 7 8 9 10 11 12 13 | set.seed(43)
var1 <- c(sample(c(1, 2), 50, replace = TRUE))
var2 <- var1 + c(sample(c(1, 2), 50, replace = TRUE))
var3 <- var1 + c(sample(c(0, 1), 50, replace = TRUE,
prob = c(0.9, 0.1)))
var4 <- c(sample(c(1, 2), 50, replace = TRUE))
data <- data.frame("var1" = as.character(var1),
"var2" = as.character(var2),
"var3" = as.character(var3),
"var4" = as.character(var4))
CL <- ChowLiu(data, root = 'var1', smooth = 0.1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.