dist.entropy {truecluster} | R Documentation |
This functions calculates the entropy distance between variables
dist.entropy(x)
x |
a matrix of categorical raw data (cases in rows, variables in columns) |
An object of class dist
.
Jens Oehlschlaegel
MacKay, David J.C. (2003). Information Theory, Inference, and Learning Algorithms (Exercise 8.5). Cambridge University Press.
dist
, cor2dist
, cor2sim
, sim2dist
n <- 1000 x <- runif(n) x <- cbind( x , x , 2*x , x+runif(n, max=0.1) , x+runif(n) , x+runif(n, max=10) , x+runif(n, max=10) , 2*(x+runif(n, max=10)) , 2*(x+runif(n, max=10)) , runif(n, max=22) , runif(n, max=22) ) x <- round(x) colnames(x) <- letters[1:ncol(x)] D <- dist.entropy(x) plot(hclust(D, method="average"))