moments.c: Implement calc_semean.
authorJohn Darrington <john@darrington.wattle.id.au>
Sat, 3 Mar 2012 11:05:17 +0000 (12:05 +0100)
committerJohn Darrington <john@darrington.wattle.id.au>
Sat, 3 Mar 2012 11:05:17 +0000 (12:05 +0100)
This function was always declared, but never implemented.  It's fairly
trivial, but for consistency it makes sense to have here.

src/math/moments.c
src/math/moments.h

index e289e8aec0ef27c2372e2c007eeb30e6b2f6d469..83cbbe4ca1fb3e4c2d4e2a6497ed84ced68b0c31 100644 (file)
@@ -461,6 +461,13 @@ moments1_destroy (struct moments1 *m)
   free (m);
 }
 \f
+
+double
+calc_semean (double var, double W)
+{
+  return sqrt (var / W);
+}
+
 /* Returns the standard error of the skewness for the given total
    weight W.
 
index 55c517e5217864cda1a1607485c8347d1c1bbf1f..8bf916592e759879a849020a18b20534cc394387 100644 (file)
@@ -65,7 +65,7 @@ void moments1_calculate (const struct moments1 *,
 void moments1_destroy (struct moments1 *);
 
 /* Standard errors. */
-double calc_semean (double stddev, double weight);
+double calc_semean (double var, double weight);
 double calc_seskew (double weight);
 double calc_sekurt (double weight);