How to calculate the uncertainty of success rates?

In summary, the success rates for tests of various components are 95% +/- . If a component passes every test (100%), what is the lower limit on the actual rate? How many tests must we do to be confident it is above 95%? If the probability of failure is 5%, then the probability of passing 20 times is 0.95^20 = 0.36. So we can say we are 64% confident the probability of success is 95% or higher. To be 95% confident that X>=0.95 it must pass N=58 tests without failing.
  • #1
GingerCat
4
1
I am writing a report for my boss quoting the success rates for tests of various components. If something works 19 times out of twenty, then it's 95%. But what is the uncertainty on this? 95% +/- ?

And if a component passes every test (100%), what is the lower limit on the actual rate? How many tests must we do to be confident it is above 95%?

The assumption is that the probability of success is a fixed value, and the uncertainty on our estimate of this is just limited by the number of tests done.
 
Physics news on Phys.org
  • #2
Based on half lives..the upper limit would be to round the decimals to 100% which would be perfect certainty..

Otherwise it would be directly opposite..which would be a remaining 5% of uncertainty..

I think maybe actually testing it 20 times might work..
 
  • #3
Possible answer to my second question.

If the probability of failure is 5%, then the probability of passing 20 times is 0.95^20 = 0.36. So we can say we are 64% confident the probability of success is 95% or higher.
If the probability of success is X, and it passes N=20 tests without failing, then the 95% limit on X is found by solving 1-X^N=0.95, which gives 86%
To be 95% confident that X>=0.95 it must pass N=58 tests without failing.

Does that sound right?

Still puzzling about my first question.
 
  • #4
GingerCat said:
I am writing a report for my boss quoting the success rates for tests of various components. If something works 19 times out of twenty, then it's 95%. But what is the uncertainty on this? 95% +/- ?

And if a component passes every test (100%), what is the lower limit on the actual rate? How many tests must we do to be confident it is above 95%?

The assumption is that the probability of success is a fixed value, and the uncertainty on our estimate of this is just limited by the number of tests done.
This is a textbook application for Bayesian inference. If you have a binomial trial with n successes and m failures then the posterior probability is beta distributed with shape parameters n+1 and m+1. So if you have 19 successes and 1 failure then the probability of success is shown below. The 95% credible region is [0.762,0.988].

GingerCat said:
To be 95% confident that X>=0.95 it must pass N=58 tests without failing.
Interestingly, that is the same answer obtained with the Bayesian method. If you have Mathematica you can calculate it with:
Code:
Solve[Quantile[BetaDistribution[n + 1, 1], .05] == .95, n]
 

Attachments

  • BetaDist20-2.png
    BetaDist20-2.png
    3.1 KB · Views: 476
  • Like
Likes GingerCat
  • #5
Thanks. I don't suppose you know of a good reference which explains this in simple terms? I would like to learn to do these calculations myself and understand why it works, but when I Googled the terms you use, the results were a little intimidating.
 
  • #6
Unfortunately, I think that the whole Bayesian statistical community likes to make itself as mysterious as possible.

The basic idea is that in normal statistics you consider the hypothesis fixed and then calculate the probability of the observed data given that hypothesis. But in Bayesian statistics you consider the data to be fixed and calculate the probability of the hypothesis given that data.

So if you have 19 "heads" and 1 "tails" and were considering the hypothesis that the coin is fair then normal statistics would say "it is very unlikely to get 19 heads and 1 tail" while the Bayesian statistics would say "it is very unlikely that the coin is fair". I think the Bayesian way is a little closer to how I actually think about problems.

So in your question, you can calculate the probability of any hypothesis by using the beta distribution. The more data you get the narrower the beta distribution, but you always assign some probability to hypotheses that are close to the peak.
 
  • Like
Likes GingerCat
  • #7
GingerCat said:
Thanks. I don't suppose you know of a good reference which explains this in simple terms? I would like to learn to do these calculations myself and understand why it works, but when I Googled the terms you use, the results were a little intimidating.

I'd recommend starting out by discretizing things so that you can see what goes on. The continuous approach follows pretty naturally once you get the discrete case.

Discrete sketch: I use matrix vector notation here. You can do this in excel or whatever if you prefer.

prior distribution ##=
\mathbf x \propto
\begin{bmatrix}
1\\
1\\
\vdots\\
1\\

\end{bmatrix}##

that is a uniform distribution. (Is a uniform distribution reasonable?) Note I used ##\propto## not ##=## because it isn't a valid probability distribution-- it doesn't sum to one. For a vector ##\mathbf \in \mathbb R^n## (i.e. n items in your vector) you could multiply everything by ## \frac{1}{n}## if you wanted to make it a valid probability distribution. What's important is that your final distribution sums to one. Having your prior distribution be improper vs proper isn't such a big deal.

let's say we have 9 items in ##\mathbf x## (i.e. ##\mathbf x \in \mathbb R^9## for purposes of an illustrative example). So the Labels for ##\mathbf x## are that the true 'coin' has a 10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, or 90% of having a 'heads' occur for a given 'toss' and 1 minus that for 'tails'. That is we can act is if there are 9 different possible states of the world and we want to evaluate and update our probabilities of being in each one, as we make observations.

So likelihood function for heads is given by the diagonal matrix ##
\mathbf D_1 =\begin{bmatrix}
0.1 & 0 & 0& 0& 0& 0 & 0 & 0& 0\\
0 & 0.2 & 0& 0& 0& 0 & 0 & 0& 0\\
0 & 0 & 0.3 & 0& 0& 0 & 0 & 0& 0\\
0 & 0 & 0& 0.4& 0& 0 & 0 & 0& 0\\
0 & 0 & 0& 0& 0.5& 0 & 0 & 0& 0\\
0 & 0 & 0& 0& 0& 0.6 & 0 & 0& 0\\
0 & 0 & 0& 0& 0& 0 & 0.7 & 0& 0\\
0 & 0 & 0& 0& 0& 0 & 0 & 0.8& 0\\
0 & 0 & 0& 0& 0& 0 & 0 & 0& 0.9\\
\end{bmatrix}##

and the likelihood of tails is given by the diagonal matrix

##
\mathbf D_0 =\begin{bmatrix}
0.9 & 0 & 0& 0& 0& 0 & 0 & 0& 0\\
0 & 0.8 & 0& 0& 0& 0 & 0 & 0& 0\\
0 & 0 & 0.7 & 0& 0& 0 & 0 & 0& 0\\
0 & 0 & 0& 0.6& 0& 0 & 0 & 0& 0\\
0 & 0 & 0& 0& 0.5& 0 & 0 & 0& 0\\
0 & 0 & 0& 0& 0& 0.4 & 0 & 0& 0\\
0 & 0 & 0& 0& 0& 0 & 0.3 & 0& 0\\
0 & 0 & 0& 0& 0& 0 & 0 & 0.2& 0\\
0 & 0 & 0& 0& 0& 0 & 0 & 0& 0.1\\
\end{bmatrix}##

so if you observe 3 heads then one tail, your final distribution (posterior) is given by:

##\mathbf {posterior} \propto \mathbf D_0 \cdot \mathbf D_1 \cdot \mathbf D_1 \cdot \mathbf D_1 \cdot \mathbf x = \big(\mathbf D_0\big)^1 \big(\mathbf D_1\big)^3 \mathbf x##

To move from ##\propto ## to equals, you just need to add up the values in that final vector (call it ##\alpha## and multiply your calculated value by ##\frac{1}{\alpha}## -- that will make sure you posterior sums to one. hence ##\frac{1}{\alpha}## is your normalizing constant.

In the problem mentioned by Dale you'd actually have

##\mathbf {posterior} \propto \mathbf D_0 \big(\mathbf D_1\big)^{19} \mathbf x##

note that I used n terms, where n = 9 for the sake of the example. To the extent you were going to do this discretely and use the results, you'd want to use a much higher n, like n = 1,000. Alternatively, once you understand the discrete case deeply, you can fairly easily generalize to the continuous case.

- - - -
Alternatively, if you speak Python, Allen Downey does a great job walking you through discrete Bayes, here in his book "Think Bayes". It is made freely available by the author, here:

http://greenteapress.com/wp/think-bayes/
 
  • Like
Likes Greg Bernhardt

1. What is uncertainty and why is it important to calculate success rates?

Uncertainty refers to the lack of complete certainty or knowledge about a particular outcome or event. In the context of calculating success rates, uncertainty is important because it allows us to understand the level of confidence we can have in the reported success rate. It also helps to identify potential sources of error or variability in the data.

2. How do you calculate the uncertainty of success rates?

The uncertainty of success rates can be calculated using the formula: uncertainty = (standard deviation / mean) x 100%. This formula takes into account the variability of the data and expresses it as a percentage of the mean success rate.

3. What factors can contribute to the uncertainty of success rates?

There are several factors that can contribute to the uncertainty of success rates, including sample size, measurement error, and variability within the data. Other factors such as experimental design and data collection methods can also impact the uncertainty of success rates.

4. How can we reduce the uncertainty of success rates?

To reduce the uncertainty of success rates, it is important to increase the sample size, minimize measurement error, and carefully control for variability in the data. Implementing rigorous experimental design and data collection methods can also help to reduce uncertainty.

5. Can uncertainty be completely eliminated when calculating success rates?

No, uncertainty cannot be completely eliminated when calculating success rates. There will always be some degree of uncertainty due to the nature of scientific research and the inherent variability within data. However, by following best practices and reducing potential sources of error, we can minimize the uncertainty and increase our confidence in the reported success rates.

Similar threads

  • Set Theory, Logic, Probability, Statistics
Replies
2
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
7
Views
464
Replies
1
Views
1K
Replies
5
Views
1K
Replies
6
Views
5K
  • High Energy, Nuclear, Particle Physics
Replies
4
Views
926
  • Calculus and Beyond Homework Help
Replies
5
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
4
Views
2K
  • Other Physics Topics
Replies
3
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
4
Views
3K
Back
Top