Background¶
Computation of the concepts described in README depend on the properties of underlying random variables.
For samples with binary results, such as pass/fail or success/failure, we typically assume binomial distribution.
Infinite population size¶
If in \(n\) samples, we find \(f\) failures, then the confidence in reliability \(r, 0 \le r \le 1\) is
where \(\binom{n}{k} = \frac{n!}{k!(n-k)!}\) is the binomial coefficient.
Calculating reliability means solving the above equation for \(r\). Yes,
it is complicated. That is why we have relistats.binomial.reliability()
method that uses
numerical optimization! There are closed-form approximations and this library
implements the ‘Wilson Score Interval with Continuity Correction’ method via
relistats.binomial.reliability_closed().
Calculating assurance means setting \(r = c = a\) in the above equation to get
Solving the above equation for \(a\) is not trivial. This library
offers a numerical method relistats.binomial.assurance() that allows
tuning desired accuracy level.
Finite population size¶
For finite population size, after \(n`\) samples are tested, we already know
how many additional samples, \(m\) remain. The acceptable number of failures
in these to reach desired reliability level and the associated confidence level
can be computed assuming infinite population size. This technique is implemented
in relistats.binom_fin.conf_fin().
Using the confidence method, reliability and assurance levels can be computed as
shown in relistats.binom_fin.
See references in README for more information.