Skip to content

Commit 0425cb3

Browse files
Liz ObermaierLiz Obermaier
Liz Obermaier
authored and
Liz Obermaier
committed
new fieller interval documentation
1 parent a1a6dbf commit 0425cb3

File tree

2 files changed

+27
-17
lines changed

2 files changed

+27
-17
lines changed

cspell.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,9 @@
658658
"akin",
659659
"vineeth",
660660
"vijaye",
661-
"brock"
661+
"brock",
662+
"Fieller",
663+
"Fieller's"
662664
],
663665
"ignorePaths": [
664666
"node_modules/**",

docs/stats-engine/confidence-intervals.mdx

+24-16
Original file line numberDiff line numberDiff line change
@@ -22,36 +22,41 @@ Once we've established the variance of the delta, it's straightforward to comput
2222

2323
For the **absolute metric delta**, the confidence interval is given by:
2424

25-
$$\Large
26-
CI(\Delta \overline{X}) = \Delta \overline{X} \pm Z_{\alpha/2} \cdot \sqrt{{var(\Delta \overline{X})}}
25+
$$
26+
\Large
27+
CI(\Delta \overline{X}) = \Delta \overline{X} \pm Z_{\alpha/2} \cdot \sqrt{{var(\Delta \overline{X})}}
2728
$$
2829

2930
where:
3031

3132
- $Z_{\alpha/2}$ is the z-critical value for the desired significance level (1.96 for the standard $\alpha=0.05$ and 95% confidence interval) and we run a two-sided test
3233
- $var(\Delta \overline{X})$ is the variance of the absolute delta (details [here](/stats-engine/variance))
3334

34-
Similarly, the confidence interval for the **relative metric delta** is:
35+
The confidence interval for the **relative metric delta** is calculated using Fieller's Theorem:
36+
37+
First the constant g must be calculated.
3538

36-
$$\Large
37-
CI(\Delta \overline X\%)
38-
= \Delta \overline X\% \pm Z_{\alpha/2} \cdot\sqrt{{var(\Delta \overline X\%)}}
39-
= \frac{\Delta \overline X}{\overline X_c} \pm Z_{\alpha/2} \cdot\sqrt{(\frac{\overline X_t}{\overline X_c})^{2} \cdot (\frac{var(\overline X_c)}{n_c \cdot \overline X_c^2} + \frac{var(\overline X_t)}{n_t \cdot \overline X_t^2})} \cdot 100\%
39+
$$
40+
\Large
41+
g = \frac{Z_{\alpha/2}^2 \cdot var(X_C)}{(n-1) \cdot \overline{X_C}^2}
4042
$$
4143

42-
If the control mean is not significantly away from zero, then
44+
When g < 1, the control mean is significantly different from 0. Since the control and test group results are independent of each other, covariance terms in Fieller's Theorem can be dropped.
4345

44-
$$\Large
46+
$$
47+
\Large
4548
CI(\Delta \overline X\%)
46-
= \Delta \overline X\% \pm Z_{\alpha/2} \cdot\sqrt{{var(\Delta \overline X\%)}}
47-
= \frac{\Delta \overline X}{\overline X_c} \pm Z_{\alpha/2} \cdot \frac{\sqrt{{var\left(\Delta \overline X\right)}}}{\overline X_c} \cdot 100\%
49+
= \frac{1}{1-g} ( \frac{\overline{X_T}}{\overline{X_C}} - 1 \pm \frac{Z_{\alpha/2}}{sqrt{n_C} \cdot \overline{X_C}} sqrt{(1-g) \cdot \frac{var(X_T)}{n_T(n_T-1)} + \frac{\overline{X_T} var(X_C)}{\overline{X_C} n_C (n_C-1)}})
4850
$$
4951

52+
If the control mean is not significantly different from zero, then a confidence interval for relative metric delta is not well defined, and a point estimate is surfaced instead.
53+
5054
### One-Sided Tests
5155

5256
When running one-sided tests, the form of the confidence interval calculation changes slightly to account for a redistribution of desired false positive rate when looking for increases or decreases in the metric:
5357

54-
$$\Large
58+
$$
59+
\Large
5560
CI(\Delta \overline{X}) = \begin{cases}
5661
\left[\Delta \overline{X} - Z_{\alpha} \cdot \sqrt{{var(\Delta \overline{X})}}, \quad +\infty \right) & \text{if right-hand test}\\
5762
\\
@@ -71,11 +76,13 @@ For small sample sizes, we use Welch's t-test instead of a standard z-test. This
7176

7277
For a two-sided test, the confidence interval is therefore:
7378

74-
$$\Large
75-
CI(\Delta \overline{X}) = \Delta \overline{X} \pm t_{\alpha/2} \cdot \sqrt{{var(\Delta \overline{X})}}
79+
$$
80+
\Large
81+
CI(\Delta \overline{X}) = \Delta \overline{X} \pm t_{\alpha/2} \cdot \sqrt{{var(\Delta \overline{X})}}
7682
$$
7783

78-
$$\Large
84+
$$
85+
\Large
7986
\nu = \frac{\left(var(\overline X_t) + var(\overline X_c)\right)^2}{\frac{var(\overline X_t)^2}{N_t - 1}+\frac{var(\overline X_c)^2}{N_c - 1}}
8087
= \frac{var(\Delta\overline{X})^2}{\frac{var(\overline X_t)^2}{N_t - 1}+\frac{var(\overline X_c)^2}{N_c - 1}}
8188
$$
@@ -88,6 +95,7 @@ Sometimes we want to answer questions like "Does my test variant lead to a click
8895

8996
The confidence interval is calculated by
9097

91-
$$\Large
98+
$$
99+
\Large
92100
CI(\Delta \overline X) = (\overline X_{group} - fixed \ value) \pm Z \cdot\sqrt{{var( \overline X_{group})}}
93101
$$

0 commit comments

Comments
 (0)