uvex_transients.utils.stat_utils.tolerance_rank#
- uvex_transients.utils.stat_utils.tolerance_rank(n_samples: int, confidence: float, tolerance: float) int[source]#
Find the rank of the sample value that is the tightest valid upper tolerance limit (Wilks 1941).
The
r-th largest ofMsamples leaves at most a fraction \(\delta\) of the population above it with confidence \(P[\mathrm{Binomial}(M, \delta)\geq r]\). This returns the largestrfor which that still reaches the required confidence.- Parameters:
- Returns:
The rank
r >= 1, counted from the largest sample.- Return type:
- Raises:
ValueError – If
n_samplesis below tolerance_min_samples.