summaryrefslogtreecommitdiff
path: root/lib/igt_stats.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/igt_stats.c')
-rw-r--r--lib/igt_stats.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/igt_stats.c b/lib/igt_stats.c
index cec35876..b7053c3c 100644
--- a/lib/igt_stats.c
+++ b/lib/igt_stats.c
@@ -528,3 +528,19 @@ double igt_stats_get_iqm(igt_stats_t *stats)
return mean;
}
+
+/**
+ * igt_stats_get_trimean:
+ * @stats: An #igt_stats_t instance
+ *
+ * Retrieves the trimean of the @stats dataset.
+ *
+ * The trimean is a the most efficient 3-point L-estimator, even more
+ * robust than the median at estimating the average of a sample population.
+ */
+double igt_stats_get_trimean(igt_stats_t *stats)
+{
+ double q1, q2, q3;
+ igt_stats_get_quartiles(stats, &q1, &q2, &q3);
+ return (q1 + 2*q2 + q3) / 4;
+}