You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/architectural_decisions/005-variance-addition.md
+31-11Lines changed: 31 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,19 +6,37 @@ Current
6
6
7
7
## Context
8
8
9
-
For counts data, the uncertainty on counts is typically defined by poisson counting statistics, i.e. the standard deviation on `N` counts is `sqrt(N)`.
9
+
For counts data, the uncertainty on counts is typically defined by poisson counting statistics, i.e. the standard
10
+
deviation on `N` counts is `sqrt(N)`.
10
11
11
-
This can be problematic in cases where zero counts have been collected, as the standard deviation will then be zero, which will subsequently lead to "infinite" point weightings in downstream fitting routines for example.
12
+
This can be problematic in cases where zero counts have been collected, as the standard deviation will then be zero,
13
+
which will subsequently lead to "infinite" point weightings in downstream fitting routines for example.
12
14
13
15
A number of possible approaches were considered:
14
16
15
-
| Option | Description |
16
-
| --- | --- |
17
-
| A | Reject data with zero counts, i.e. explicitly throw an exception if any data with zero counts is seen as part of a scan. |
18
-
| B | Use a standard deviation of `NaN` for points with zero counts. |
19
-
| C | Define the standard deviation of `N` counts as `1` if counts are zero, otherwise `sqrt(N)`. This is one of the approaches available in mantid for example. |
20
-
| D | Define the standard deviation of `N` counts as `sqrt(N+0.5)` unconditionally - on the basis that "half a count" is smaller than the smallest possible actual measurement which can be taken. |
21
-
| E | No special handling, calculate std. dev. as `sqrt(N)`. |
17
+
### Option A
18
+
19
+
Reject data with zero counts, i.e. explicitly throw an exception if any data with zero counts is seen as part of a scan.
20
+
21
+
### Option B
22
+
23
+
Use a standard deviation of `NaN` for points with zero counts.
24
+
25
+
### Option C
26
+
27
+
Define the standard deviation of `N` counts as `1` if counts are zero, otherwise `sqrt(N)`. This is one of the
28
+
approaches [available in mantid](https://github.com/mantidproject/mantid/blob/bbbb86edc2c3fa554499770463aa25c2b46984e5/docs/source/algorithms/SetUncertainties-v1.rst#L16) for example.
29
+
30
+
### Option D
31
+
32
+
Define the standard deviation of `N` counts as `sqrt(N+0.5)` unconditionally - on the basis that "half a count" is
33
+
smaller than the smallest possible actual measurement which can be taken.
34
+
35
+
### Option E
36
+
37
+
No special handling, calculate std. dev. as `sqrt(N)`.
38
+
39
+
---
22
40
23
41
For clarity, the following table shows the value and associated uncertainty for each option:
24
42
@@ -53,6 +71,8 @@ The consensus was to go with Option D.
53
71
## Justification
54
72
55
73
- Option A will cause real-life scans to crash in low counts regions.
56
-
- Option B involves `NaN`s, which have many surprising floating-point characteristics and are highly likely to be a source of future bugs.
74
+
- Option B involves `NaN`s, which have many surprising floating-point characteristics and are highly likely to be a
75
+
source of future bugs.
57
76
- Option D was preferred to option C by scientists present, because it is continuous.
58
-
- Option E causes surprising results and/or crashes downstream, for example fitting may consider points with zero uncertainty to have "infinite" weight, therefore effectively disregarding all other data.
77
+
- Option E causes surprising results and/or crashes downstream, for example fitting may consider points with zero
78
+
uncertainty to have "infinite" weight, therefore effectively disregarding all other data.
0 commit comments