[GRASS-dev] Re: [GRASS-user] Re: Calculating standard error of many
maps?
Hamish
hamish_b at yahoo.com
Thu Feb 12 21:01:30 EST 2009
Glynn Clements wrote:
> I can add sum of squares/cubes/etc to r.series easily
> enough if there is a use for them.
well, sum of squares is useful so you can calculate variance & friends.
don't know of any use for cubes+.
r.univar/stats.c:
/* all these calculations get promoted to doubles, so any DIV0 becomes nan */
mean = stats->sum / stats->n;
variance = (stats->sumsq - stats->sum * stats->sum / stats->n) / stats->n;
if (variance < GRASS_EPSILON)
variance = 0.0;
stdev = sqrt(variance);
var_coef = (stdev / mean) * 100.; /* perhaps stdev/fabs(mean) ? */
adding sum of sq would let people calc that with r.series+r.mapcalc
manually.
not sure what components are required to calc kurtosis & skewness,
although I've an idea that they'd be possible with a single-serial-pass
construction method as s.cellstats had them (??).
perhaps 'mean of absolute values' too?
Hamish
More information about the grass-dev
mailing list