From 261e8aac16e5105bff1c9ffde2e02cfc79081ed0 Mon Sep 17 00:00:00 2001 From: Axel Uhl Date: Mon, 9 Jan 2012 16:18:17 +0100 Subject: [PATCH] added getConfidence() with comment --- .../sailing/domain/base/HasConfidence.java | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/java/com.sap.sailing.domain/src/com/sap/sailing/domain/base/HasConfidence.java b/java/com.sap.sailing.domain/src/com/sap/sailing/domain/base/HasConfidence.java index 60ac6a81771..aab19b49ff6 100755 --- a/java/com.sap.sailing.domain/src/com/sap/sailing/domain/base/HasConfidence.java +++ b/java/com.sap.sailing.domain/src/com/sap/sailing/domain/base/HasConfidence.java @@ -13,5 +13,28 @@ package com.sap.sailing.domain.base; * */ public interface HasConfidence { - + /** + * A confidence is a number between 0.0 and 1.0 (inclusive) where 0.0 means that the value is randomly guessed while + * 1.0 means the value is authoritatively known for a fact. It represents the weight with which a value is to be + * considered by averaging, interpolation and extrapolation algorithms. + *

+ * + * An averaging algorithm for a sequence of n tuples (v1, c1), ..., (vn, cn) of a value + * vi with a confidence ci each can for example look like this: + * a := (c1*v1 + ... + cn*vn) / (c1 + ... + cn). For a single value with a confidence this trivially + * results in c1*v1 / (c1) which is equivalent to v1. As another example, consider two + * values with equal confidence 0.8. Then, a := (0.8*v1 + 0.8*vn) / (0.8 + 0.8) which + * resolves to 0.5*v1 + 0.5*v2 which is obviously the arithmetic mean of the two values. If one value + * has confidence 0.8 and the other 0.4, then + * a := (0.8*v1 + 0.4*vn) / (0.8 + 0.4) which resolves to 2/3*v1 + 1/3*v2 which is a + * weighed average. + *

+ * + * Note, that this doesn't exactly take facts for facts. In other words, if one value is provided with a confidence + * of 1.0, the average may still be influenced by other values. However, this cleanly resolves otherwise + * mutually contradictory "facts" such a (v1, 1.0), (v2, 1.0) with v1 != v2. It is + * considered bad practice to claim a fact as soon as it results from any kind of measurement or estimation. All + * measurement devices produce some statistical errors, no matter how small (cf. Heisenberg ;-) ). + */ + double getConfidence(); }