Bayesian Hypothesis Test Calculator

Compare null and alternative support with Bayesian updates. See posterior probabilities, odds, and evidence instantly. Built for faster reasoning, clearer reporting, and smarter decisions.

Calculator inputs

This calculator evaluates a point-null binomial hypothesis against a beta-distributed alternative and updates support using Bayes factors and posterior probabilities.

Total Bernoulli trials or observations.
Count of observed positive outcomes.
Success rate assumed under H0.
Shape parameter α of Beta prior.
Shape parameter β of Beta prior.
Belief in H1 before observing data.
Used for posterior interval bounds.
Posterior certainty needed for a decision.
Higher values make smoother density curves.
Reset

Example data table

Scenario n x p0 α β Prior H1 BF10 Posterior H1
Balanced prior example 40 24 0.50 1.00 1.00 50.00% 0.4267 29.91%
Optimistic alternative prior 60 39 0.55 3.00 2.00 60.00% 0.9107 57.73%
Skeptical prior example 80 36 0.50 2.00 2.00 35.00% 0.3027 14.01%

These rows illustrate how different priors and observed counts change the Bayes factor and the updated belief in the alternative.

Formula used

1) Likelihood under the null

P(x | H0) = C(n, x) · p0^x · (1 - p0)^(n - x)

2) Marginal likelihood under the alternative

P(x | H1) = C(n, x) · B(x + α, n - x + β) / B(α, β)

3) Bayes factor

BF10 = P(x | H1) / P(x | H0)

4) Posterior odds and posterior probability

Posterior odds = Prior odds × BF10

P(H1 | x) = Posterior odds / (1 + Posterior odds)

5) Updated alternative distribution

p | x, H1 ~ Beta(α + x, β + n - x)

How to use this calculator

  1. Enter the total number of trials in Sample size.
  2. Enter the count of successful outcomes in Observed successes.
  3. Set the null rate p0 to the benchmark you want to test.
  4. Choose alpha and beta to describe your alternative prior belief.
  5. Enter your prior probability for H1.
  6. Pick a credible level and a decision threshold.
  7. Click Calculate to view the results above the form.
  8. Use the CSV and PDF buttons to export the computed summary.

FAQs

1) What does BF10 mean?

BF10 compares how well the observed data are predicted by H1 versus H0. Values above 1 favor H1. Values below 1 favor H0. Bigger departures from 1 indicate stronger evidence.

2) Why use a beta prior?

A beta prior is flexible for proportions. It can represent neutral, skeptical, or optimistic beliefs and updates neatly with binomial data into another beta distribution.

3) How is this different from a p-value?

A p-value measures surprise under H0 only. This calculator directly compares H0 and H1, combines prior beliefs with data, and outputs posterior probabilities and Bayes factors.

4) What do alpha and beta control?

They shape the alternative prior. Larger alpha shifts belief toward higher success rates. Larger beta shifts belief toward lower rates. Equal values create symmetric priors around 0.50.

5) How should I choose prior probability of H1?

Use a value that reflects your pre-data confidence in the alternative. Neutral setups often begin at 0.50. More skeptical settings may use lower values.

6) What does the credible interval show?

It gives a posterior range for the success rate under H1. For example, a 95% credible interval contains the parameter with 95% posterior probability under the model.

7) Can this calculator handle zero or full success counts?

Yes. The beta-binomial framework remains valid for x = 0 and x = n, provided the prior alpha and beta values stay positive.

8) When is the decision marked inconclusive?

The result is inconclusive when neither posterior probability crosses your chosen decision threshold. That means the data did not produce enough certainty for either side.

Related Calculators

posterior predictive checkbayes rule calculatorbayesian logistic regressiondeviance information criterionbayesian t testprior probability calculatorrandom effects bayesianinverse gamma posteriorconjugate prior calculatormcmc acceptance rate

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.