# Hopkins statistic - to exponentiate or not to exponentiate?

I used 2 different R implementations of Hopkins statistic:

hopkins::hopkins() (https://github.com/kwstat/hopkins/blob/main/R/hopkins.R) and

factoextra::get_clust_tendency() (https://github.com/kassambara/factoextra/blob/master/R/get_clust_tendency.R)

Both functions returned vastly different results (~.98 vs ~ .55). It seems that the difference is due to hopkins() exponentiating the final sums of distances as such:

return( sum(dux^d) / sum( dux^d + dwx^d ) )


while get_clust_tendency() does not perform this operation:

list(hopkins_stat = sum(minp)/(sum(minp) + sum(minq)), plot = plot)


I have seen both versions of the definition e.g. 1) https://www.datanovia.com/en/lessons/assessing-clustering-tendency/ after https://pubs.acs.org/doi/abs/10.1021/ci00065a010 or 2) https://en.wikipedia.org/wiki/Hopkins_statistic, https://ieeexplore.ieee.org/document/1375706. This seems to be a big problem so I would like to ask an expert to weigh in.

• According to the original paper and some reviews, IIRC, exponentiation of the terms in the formula is necessary Commented Mar 14, 2023 at 15:06
• due to hopkins() exponentiating the final sums of distances Not the sums but the distances themselves. Commented Mar 14, 2023 at 15:18

The factoextra package calculates Hopkins Statistic in the same way as the clustertend package, which has now been deprecated. I believe the hopkins package gives a better answer. If you want to know why, have a look at this paper: "Will the Real Hopkins Statistic Please Stand Up?", https://journal.r-project.org/articles/RJ-2022-055/
FYI, I am author of the hopkins package.
• Sure. Use packageDescription("hopkins") to get the contact info for a package. Commented Apr 7, 2023 at 16:18