library("TreeTools", quietly = TRUE)
tree1 <- BalancedTree(8)
tree2 <- PectinateTree(8)
# Calculate HMI between two trees
HierarchicalMutualInfo(tree1, tree2)
# HMI normalized against the mean information content of tree1 and tree2
HierarchicalMutualInfo(tree1, tree2, normalize = mean)
# Normalized HMI above is equivalent to:
HMI(tree1, tree2) / mean(SelfHMI(tree1), SelfHMI(tree2))
# Expected mutual info for this pair of hierarchies
EHMI(tree1, tree2, precision = 0.1)
# The adjusted HMI normalizes against this expectation
AHMI(tree1, tree2, precision = 0.1)
Run the code above in your browser using DataLab