How to use this calculator
Compare two independent beta-binomial conversion probabilities and compute the posterior chance that B has the higher underlying probability.
- Enter A successes, A trials, B successes, B trials, then complete the remaining labeled fields. Match the units shown beside each field and review the result together with the assumptions below.
- Read the worked example below to check the expected input format and result.
- Compare another scenario by changing one input at a time. Use Reset to return to the starting values.
Bayesian beta A B probability comparison explained
How the calculation works
P(pB>pA)=∫ fBeta,B(u) FBeta,A(u) du; posterior shapes add successes and failures to each shared beta prior.
Both groups update their own probability with the same entered prior. With positive integer shapes, a finite beta-function identity evaluates the comparison integral in log space. The expected difference is the difference of posterior means, not the mean percentage lift.
Set up the calculation
sa— A successes- Whole observed successes for this group, no larger than its trial total. Enter a whole number.
na— A trials- Whole observed Bernoulli trials for this group, including successes and failures. Enter a whole number.
sb— B successes- Whole observed successes for this group, no larger than its trial total. Enter a whole number.
nb— B trials- Whole observed Bernoulli trials for this group, including successes and failures. Enter a whole number.
a— Shared prior alpha- Shared positive integer beta prior alpha for each group, required by the finite-sum implementation. Enter a whole number.
b— Shared prior beta- Shared positive integer beta prior beta for each group. Both groups update this same prior separately. Enter a whole number.
Limits of this model
Independent groups and Bernoulli observations within each group. Shared integer prior shapes are required for this finite-sum implementation. The comparison is conditional on the prior and does not account for multiple simultaneous variants or utility/cost.
Check this example
A successes = 24; A trials = 80; B successes = 34; B trials = 90; Shared prior alpha = 1; Shared prior beta = 1.
- Posterior probability B exceeds A: 0.8547867426
- Posterior mean A: 0.30487805
- Posterior mean B: 0.38043478
- Posterior expected probability difference: 0.07555673
A updates to Beta(25,57), while B updates to Beta(35,57). The calculation integrates across both uncertain probabilities instead of comparing only 24/80 and 34/90.
Reading the outputs
The main result is P(pB>pA), not a frequentist p-value. The probability difference is in absolute probability units; multiply by one hundred for percentage points.
Frequently asked questions
Is 95% probability a guaranteed business win?
No. Practical gain, sample selection, costs, and repeated decisions still matter.
Can I use different priors for A and B?
This interface deliberately uses one shared prior to keep the comparison transparent.
What happens if I swap A and B?
For continuous beta distributions the two comparison probabilities sum to one, within numerical tolerance.
How do I use the Bayesian beta A B probability comparison calculator?
Enter A successes, A trials, B successes, B trials, then complete the remaining labeled fields. Match the units shown beside each field and review the result together with the assumptions below.
What is a worked example of Bayesian beta A B probability comparison?
A successes = 24; A trials = 80; B successes = 34; B trials = 90; Shared prior alpha = 1; Shared prior beta = 1. Posterior probability B exceeds A: 0.8547867426 Posterior mean A: 0.30487805 Posterior mean B: 0.38043478 Posterior expected probability difference: 0.07555673 A updates to Beta(25,57), while B updates to Beta(35,57). The calculation integrates across both uncertain probabilities instead of comparing only 24/80 and 34/90.
Method reference: SciPy beta distribution definition.
Read our calculation methodology.