inertdiss: Pseudo inertia of a cluster

Description Usage Arguments References Examples

Description

The pseudo inertia of a cluster is calculated from a dissimilarity matrix and not from a data matrix.

Usage

1
inertdiss(D, indices = NULL, wt = NULL)

Arguments

D

an object of class "dist" with the dissimilarities between the n observations. The function as.dist can be used to transform an object of class matrix to object of class "dist".

indices

a vector with the indices of the subset of observations.

wt

vector with the weights of the n observations

References

M. Chavent, V. Kuentz-Simonet, A. Labenne, J. Saracco. ClustGeo: an R package for hierarchical clustering with spatial constraints. Comput Stat (2018) 33: 1799-1822.

Examples

1
2
3
4
5
6
7
8
data(estuary)
n <- nrow(estuary$dat)
Z <- scale(estuary$dat)*sqrt(n/(n-1))
inertdiss(dist(Z)) # pseudo inertia
inert(Z) #equals for euclidean distance

w <- estuary$map@data$POPULATION # non uniform weights 
inertdiss(dist(Z),wt=w)

chavent/ClustGeo documentation built on Oct. 2, 2021, 3:55 a.m.