Skip to content
Prev 24294 / 29559 Next

how to calculate centroid (or centre of gravity) of a population (count data)

Hi Diego,

A perhaps dumb yet straightforward way of doing it is to replicate each 
point the number of times of its corresponding count, this will get you 
the right unbiased centroid, essentially  a weighted average as 
Marcelino suggests, assuming that the weight you use is proportional to 
the count. It's like saying that each bird contributes once to the 
centroid location, instead of each point contributing once.

Note that just by using your suggested kernelUD you don't really get the 
centroid of the points (I think, never used it myself actually), I 
suspect you simply get a kernel estimate of the bivariate distribution 
of the points in space. Going from that to an actual centroid is 
possible but non necessarily straightforward.

The answer to your specific question is much simpler than that: in 2D, 
simple calculate the means of the X and Y coordinates, multiply each 
coordinate by a weight, the count - that would be an alternative to what 
I suggested above - and there is your centroid.

Note that this gets you the right mean centroid, but not necessarily the 
right variance for that centroid estimate. Also, you might want to think 
about if that is the right weight. But those are all questions beyond 
your original question ;)

cheers

Tiago

?s 09:36 de 20/04/2016, Marcelino de la Cruz escreveu:
---
Este e-mail foi verificado em termos de v?rus pelo software antiv?rus Avast.
https://www.avast.com/antivirus