From e03970503d5ba427ada341596db8e55f5cd91fad Mon Sep 17 00:00:00 2001 From: John Darrington Date: Sat, 3 Mar 2012 12:05:17 +0100 Subject: [PATCH] moments.c: Implement calc_semean. 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 | 7 +++++++ src/math/moments.h | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/math/moments.c b/src/math/moments.c index e289e8aec0..83cbbe4ca1 100644 --- a/src/math/moments.c +++ b/src/math/moments.c @@ -461,6 +461,13 @@ moments1_destroy (struct moments1 *m) free (m); } + +double +calc_semean (double var, double W) +{ + return sqrt (var / W); +} + /* Returns the standard error of the skewness for the given total weight W. diff --git a/src/math/moments.h b/src/math/moments.h index 55c517e521..8bf916592e 100644 --- a/src/math/moments.h +++ b/src/math/moments.h @@ -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); -- 2.30.2