[GRASS-dev] variation coefficient: use mean_of_abs not mean?

Hamish hamish_b at yahoo.com
Thu May 21 11:29:34 EDT 2009


Hi,

r.univar/stats.c has:
...
    stdev = sqrt(variance);
    var_coef = (stdev / mean) * 100.;   /* perhaps stdev/fabs(mean) ? */
...


instead of mean should that use mean_of_abs, so for a perfectly
distribution about 0 the result does not end up as nan?

the idea of the variation coefficient is to be able to normalize
stdevs from two different datasets, e.g. if you took the stdev of a
bunch of elephant's tails and the stdev of a bunch of mice's tails,
which group has more variation in it? using stdev alone doesn't work
because the "units" of elephant tails is much larger.

or is var_coef meaningless for any set that dips below zero?
to use mean_of_abs probably biases badly a distribution that slightly
overlaps zero too..

hmmmph,
Hamish


More information about the grass-dev mailing list