From 3a5cf84317197cdac88196cda76c6a7e08943f20 Mon Sep 17 00:00:00 2001 From: Damien Lespiau Date: Fri, 26 Jun 2015 17:02:09 +0100 Subject: stats: Add a way to specify if the data set is a population or a sample This changes how we compute the variance. We want an unbiased variance when reasoning about a sample. Signed-off-by: Damien Lespiau --- lib/igt_stats.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/igt_stats.h') diff --git a/lib/igt_stats.h b/lib/igt_stats.h index c45c8197..d2c1cc7a 100644 --- a/lib/igt_stats.h +++ b/lib/igt_stats.h @@ -38,12 +38,14 @@ typedef struct { /*< private >*/ unsigned int capacity; + unsigned int is_population : 1; unsigned int mean_variance_valid : 1; double mean, variance; } igt_stats_t; void igt_stats_init(igt_stats_t *stats, unsigned int capacity); void igt_stats_fini(igt_stats_t *stats); +void igt_stats_set_population(igt_stats_t *stats, bool full_population); void igt_stats_push(igt_stats_t *stats, uint64_t value); double igt_stats_get_mean(igt_stats_t *stats); double igt_stats_get_variance(igt_stats_t *stats); -- cgit v1.2.3