[R] Information criteria for kmeans

From: Serguei Kaniovski <Serguei.Kaniovski_at_wifo.ac.at>
Date: Wed, 5 Dec 2007 11:31:33 +0100

Hello,

how is, for example, the Schwarz criterion is defined for kmeans? It should be something like:

k <- 2
vars <- 4
nobs <- 100

dat <- rbind(matrix(rnorm(nobs, sd = 0.3), ncol = vars),

           matrix(rnorm(nobs, mean = 1, sd = 0.3), ncol = vars))

colnames(dat) <- paste("var",1:4)

(cl <- kmeans(dat, k))

schwarz <- sum(cl$withinss)+ vars*k*log(nobs)

Thanks for your help,
Serguei



Austrian Institute of Economic Research (WIFO)
P.O.Box 91                          Tel.: +43-1-7982601-231
1103 Vienna, Austria        Fax: +43-1-7989386

Mail: Serguei.Kaniovski_at_wifo.ac.at
http://www.wifo.ac.at/Serguei.Kaniovski

        [[alternative HTML version deleted]]



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Wed 05 Dec 2007 - 10:42:03 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 05 Dec 2007 - 12:30:17 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.