tcherry_complete_search: Determine the k'th order t-cherry tree from data with the...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/tcherry_complete_search.R

Description

Determine the structure of the k'th order t-cherry tree from data with the highest weight based on a complete search.

Usage

1

Arguments

data

The data the tree structure should be based on.

k

The order of the t-cherry tree.

...

Additional arguments passed to weight_junction_tree.

Details

The algorithm for constructing the t-cherry tree from data 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.

Value

A list containing the following components:

Author(s)

Katrine Kirkeby, enir_tak@hotmail.com

Maria Knudsen, mariaknudsen@hotmail.dk

Ninna Vihrs, ninnavihrs@hotmail.dk

See Also

weight_junction_tree for calculation of the weight and k_tcherry_step for a more efficient but greedy algorithm.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
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))

(tch <- tcherry_complete_search(data, 5, smooth = 0.1))

nvihrs14/tcherry documentation built on Aug. 1, 2020, 6:25 p.m.