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 arXiv:1707.03897 [stat.CO]

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)

Example output

[1] 4
[1] 4
[1] 9951.74

ClustGeo documentation built on May 2, 2019, 10:15 a.m.