|
From: ZoltánVörös <zv...@gm...> - 2009-11-09 20:46:59
|
Tait <gnuplot-devel <at> t41t.com> writes: > > Mean as used here seems to be the arithmetic mean. What about the geometric > mean? (Or harmonic mean, or any of the other types of averages?) Harmonic mean is easily done with the present stats command as stats 'foo' u 1:(1.0/$2) noout var harmonic = records / sum_y > I have always addressed these sorts of issues by using a tool that's > designed for manipulating arbitrary data sets (Perl in my case, but there > are others). This has the advantage of providing infinite flexibility, That is sort of a platform-dependent solution for a problem that comes up too often, but Philipp has already discussed this issue at length, I believe. > I wonder, rather than providing a restricted set of pre-defined functions, > is there a way to allow the user to provide a formula or expression that > will be applied across multiple rows? Then the user could calculate the > mean (whatever that means to their application) or standard deviation or > some other arbitrary metric on their own. stats 'foo' u ($2*$3+cos($4)) should work as it is, if that is what you meant. A fairly large set of quantities can be calculated using the variables that are produced by stats, if the proper function is applied to the columns beforehand. Best, Zoltán |