Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/increase_order_complete_search.R
Determine the structure of the (k + 1)'th order t-cherry tree with the highest weight from a k'th order t-cherry tree based on a complete search.
1 | increase_order_complete_search(tch_cliq, data, ...)
|
tch_cliq |
A list containing the cliques of a k'th order t-cherry tree. |
data |
The data the structure of the tree should be based on. |
... |
Additional arguments passed to |
The algorithm for constructing the (k + 1)'th order t-cherry tree from a k'th order t-cherry tree is based on an atempt to minimize the Kullback-Leibler divergence, by mazimising the weight. All possible structures are determined and the one with the highest weight is chosen.
Note that this procedure is highly inefficient, and only suited for small problems.
A list containing the following components:
model
A list containing the following components:
weight
The weight of the final (k + 1)'th order
t-cherry tree.
cliques
A list containing the cliques of
the (k + 1)'th order t-cherry tree.
separators
A list containing the separators of a
junction tree for the (k + 1)'th order t-cherry tree.
adj_matrix
The adjacency matrix for the (k + 1)'th order
t-cherry tree.
n_edges
The number of edges in the resulting graph.
n_models
The number of considered models.
Katrine Kirkeby, enir_tak@hotmail.com
Maria Knudsen, mariaknudsen@hotmail.dk
Ninna Vihrs, ninnavihrs@hotmail.dk
weight_junction_tree
for calculation of the
weight and increase_order2
for a more
efficient, but greedy algorithm.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | set.seed(43)
var1 <- c(sample(c(1, 2), 100, replace = TRUE))
var2 <- var1 + c(sample(c(1, 2), 100, replace = TRUE))
var3 <- var1 + c(sample(c(0, 1), 100, replace = TRUE,
prob = c(0.9, 0.1)))
var4 <- c(sample(c(1, 2), 100, replace = TRUE))
var5 <- var2 + var3
var6 <- var1 - var4 + c(sample(c(1, 2), 100, replace = TRUE))
var7 <- c(sample(c(1, 2), 100, replace = TRUE))
data <- data.frame("var1" = as.character(var1),
"var2" = as.character(var2),
"var3" = as.character(var3),
"var4" = as.character(var4),
"var5" = as.character(var5),
"var6" = as.character(var6),
"var7" = as.character(var7))
ChowLiu_cliques <- list(c("var1", "var5"),
c("var2", "var5"),
c("var3", "var5"),
c("var3", "var7"),
c("var4", "var6"),
c("var5", "var6"))
(tch <- increase_order_complete_search(ChowLiu_cliques, data,
smooth = 0.1))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.