Skip to content

Commit bb5a9ab

Browse files
authored
Merge pull request usra-riacs#77 from bernalde/fix/issue-72-noori-repeat-validation
Validate Noori repeat reliability formulas
2 parents 2680ac7 + f540176 commit bb5a9ab

5 files changed

Lines changed: 656 additions & 0 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ Use the root README as the entry point, then follow the focused documents for th
147147
- [examples/general_workflow.md](examples/general_workflow.md) for the end-to-end benchmark flow
148148
- [CI-TESTING.md](CI-TESTING.md) for local CI reproduction and environment setup
149149
- [TESTING.md](TESTING.md) for the test suite overview
150+
- [docs/noori_repeat_reliability_validation.md](docs/noori_repeat_reliability_validation.md) for validation of Noori et al. repeat-reliability formulas
150151
- [examples/wishart_n_50_alpha_0.5/README.md](examples/wishart_n_50_alpha_0.5/README.md) for the Wishart example details
151152

152153
## Testing
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Noori et al. Repeat-Reliability Validation
2+
3+
This note defines how this repository validates the Noori et al. repeat-reliability
4+
formulas without an author reference implementation, executable code, or raw
5+
numerical data. The formulas are implemented as deterministic reference helpers
6+
in `src/repeat_reliability.py`; downstream production integrations should cite
7+
the same equation labels and reuse these tests when behavior is changed.
8+
The API uses `confidence_fraction` for statistical confidence-interval coverage
9+
and `target_confidence` for the `R_c` target probability, so callers do not
10+
confuse these fractional values with the percentage-style `confidence_level`
11+
arguments used elsewhere in the repository.
12+
13+
Paper reference:
14+
15+
Noori, Moslem, Elisabetta Valiante, Ignacio Rozada, Thomas Van Vaerenbergh, and
16+
Masoud Mohseni. "Statistical analysis for per-instance evaluation of stochastic
17+
optimizers: Avoiding unreliable conclusions." Physical Review Applied 25, no. 3
18+
(2026): 034081.
19+
20+
## Equation Map
21+
22+
| Paper item | Repository function | Validation coverage |
23+
| --- | --- | --- |
24+
| Eq. (8), Agresti-Coull confidence interval for success probability | `agresti_coull_interval`, `agresti_coull_interval_from_estimate` | Deterministic fixture grid in `tests/test_repeat_reliability.py` for `p_hat in {0, 0.01, 0.1, 0.5, 0.9, 0.99, 1}` and `n in {100, 1000, 10000}`. |
25+
| Eq. (9), confidence-interval width and relative width | `ProportionInterval.width`, `ProportionInterval.relative_width` | Covered by the same fixture grid because lower, upper, and adjusted estimate are asserted numerically. |
26+
| Eq. (10), worst-case repeats needed for an absolute success-probability error | `required_repeats_for_probability_error` | Exact numeric checks for error tolerances `0.01` and `0.03` at 95 percent confidence. |
27+
| Eqs. (1)-(2), `R_c` from success probability | `repeat_count` | Deterministic fixture grid checks the induced `R_c` point estimate from each Agresti-Coull estimate. |
28+
| Confidence interval of `R_c` induced by the success-probability interval | `repeat_count_interval` | Deterministic fixture grid checks lower and upper `R_c` bounds, including boundary cases with infinite upper bounds. |
29+
| Eq. (3), CETS scaling from `R_c` | `cets_from_repeat_count`, `scaled_repeat_count_interval` | Unit test verifies deterministic scaling preserves relative error. |
30+
| RTT/time-to-solution scaling from `R_c` | `rtt_from_repeat_count`, `scaled_repeat_count_interval` | Unit test verifies deterministic scaling preserves relative error. |
31+
| Eq. (13), maximum relative error in `R_c` | `maximum_relative_error` | Deterministic fixture grid checks exact relative-error values for finite intervals. |
32+
| Eq. (19), lower-bound repeats for target `R_c` relative error | `required_repeats_lower_bound` | Numeric checks and qualitative fixed-seed Bernoulli tests cover monotonic behavior for low vs. moderate success probabilities. |
33+
| Exact numerical repeats for target `R_c` relative error | `required_repeats_exact` | Binary-search numerical checks assert stable required-repeat values and compare them with lower-bound behavior. |
34+
35+
## Validation Strategy
36+
37+
The validation intentionally uses two classes of checks.
38+
39+
Exact deterministic checks:
40+
41+
- Use fixed `p_hat` and `n` fixture inputs.
42+
- Assert numerical Agresti-Coull estimates and intervals.
43+
- Assert induced `R_c` intervals and maximum relative errors.
44+
- Assert lower-bound and exact repeat-count outputs for selected parameters.
45+
- Do not compare against paper plots or author data that are not available.
46+
47+
Qualitative fixed-seed Bernoulli checks:
48+
49+
- Show that an `R_c` interval induced by a success-probability interval is
50+
asymmetric.
51+
- Show that low estimated success probability requires more repeats than a
52+
moderate estimated success probability under the Eq. (19) lower bound.
53+
- Show that noisy small-sample estimates can invert optimizer rankings even
54+
when the first optimizer has the larger true success probability.
55+
56+
These tests use fixed RNG seeds and only assert qualitative claims from the
57+
paper. They are not treated as reproduction of the paper's Monte Carlo tables or
58+
figures.
59+
60+
## Boundary Policy
61+
62+
The implementation clips Agresti-Coull probability intervals to `[0, 1]`, as
63+
discussed in the paper for boundary cases. `target_confidence` is validated as
64+
an open probability interval, `0 < c < 1`. `R_c(0)` is infinite and `R_c(p)` is
65+
clamped to `1` when `p >= c`, matching Eq. (1)'s `max(..., 1)` form.
66+
67+
Deterministic RTT/CETS scaling accepts zero scale for finite repeat counts. It
68+
rejects zero scale for non-finite repeat counts because `0 * infinity` is
69+
undefined and would otherwise produce `nan` bounds.
70+
71+
The paper source text contains an apparent mismatch around the `epsilon_p = 0.03`
72+
repeat-count example. Eq. (10) with a two-sided 95 percent normal critical value
73+
gives `n = 1064`, and one later sentence in the source also refers to `1064`;
74+
the tests follow the equation rather than the inconsistent prose value.

0 commit comments

Comments
 (0)