weight_junction_tree: Calculates the weight of a junction tree

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

View source: R/weight_junction_tree.R

Description

Calculates the weight of a junction tree with the given cliques and separators.

Usage

1
weight_junction_tree(cliques, separators, data, ...)

Arguments

cliques, separators

Lists containing cliques and separators given by variable names.

data

A data frame or matrix containing the variables.

...

Additional arguments passed to MIk.

Details

The weight of the junction tree is calculated as

∑ MI(clique)-∑ MI(separator)

where the sum is over all cliques and separators respectively.

Value

The weight of the junction tree.

Author(s)

Katrine Kirkeby, enir_tak@hotmail.com

Maria Knudsen, mariaknudsen@hotmail.dk

Ninna Vihrs, ninnavihrs@hotmail.dk

References

\insertRef

EKTShyptcherry

See Also

MIk for mutual infomation for k variables.

Examples

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

data <- data.frame("var1" = as.character(var1),
                   "var2" = as.character(var2),
                   "var3" = as.character(var3),
                   "var4" = as.character(var4))
                   
cliques <- list(c("var1", "var2", "var4"), c("var1", "var3", "var4"))
separators <- list(c("var1", "var4"))

weight_junction_tree(cliques, separators, data, smooth = 0.001)

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