Re: [R] distance in the function kmeans

About this list Date view Thread view Subject view Author view Attachment view

From: Thomas Petzoldt (thpe@hhbio.wasser.tu-dresden.de)
Date: Fri 28 May 2004 - 20:41:36 EST


Message-id: <40B71760.60201@hhbio.wasser.tu-dresden.de>

n.bouget wrote:
> Hi,
> I want to know which distance is using in the function kmeans
> and if we can change this distance.
> Indeed, in the function pam, we can put a distance matrix in
> parameter (by the line "pam<-pam(dist(matrixdata),k=7)" ) but
> we can't do it in the function kmeans, we have to put the
> matrix of data directly ...
> Thanks in advance,
> Nicolas BOUGET

One solution is to transform the data in a way, that the euclidean
distance of the transformed values represents some other distance of the
original values. This works at least for the Mahalanobis-Distance, when
one applies a multivariate technique to a PCA transformed and re-scaled
matrix, but I don't know if there are transformations for some other
distance measures.

Thomas P.

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Mon 31 May 2004 - 23:05:13 EST