Beta Distribution Density Calculator
Evaluate the beta probability density at a point x between 0 and 1 for shape parameters alpha and beta, the usual model for an uncertain proportion or rate.
Beta Distribution Density Calculator
Background.
Some quantities can only fall between 0 and 1: the share of voters who will back a measure, a batter's true hitting rate, the fraction of a batch that is defective, the probability that a coin favours heads. The beta distribution is the standard way to describe uncertainty about a number like that. Two positive shape parameters, α and β, decide everything about it: where the bulk of the probability sits, how spread out it is, and whether it piles up against one end.
A practical way to read the two shapes is as counts. Begin with α = β = 1, which is flat, every value equally plausible. Each observed success adds 1 to α and each failure adds 1 to β. After one success and two failures you hold Beta(2, 3), the case used in the worked example, centred on α ÷ (α + β) = 0.4. That bookkeeping is why Bayesian statisticians reach for the beta as a prior for a binomial probability: after the data come in, the updated distribution is still a beta.
The number returned is the probability density at the point x you choose, which is the height of the curve there. It is not itself a probability, and it can be larger than 1; Beta(2, 3) peaks at about 1.78. What has to equal 1 is the area under the whole curve. The chance of the proportion landing inside a range comes from that area, found by integrating the density, and is not computed here.
x has to lie strictly between 0 and 1. At the endpoints the density can be zero, finite or infinite depending on the shapes, so they are left out.
What is beta distribution density calculator?
The beta distribution is a continuous probability distribution on the interval from 0 to 1, with density f(x) = x^(α−1)(1−x)^(β−1) ÷ B(α, β). Its mean is α ÷ (α + β). When both shapes exceed 1 it has a single peak at (α − 1) ÷ (α + β − 2); equal shapes make it symmetric about 0.5; α = β = 1 gives the flat uniform distribution; and shapes below 1 bend it into a U or J that rises toward the ends.
How to use this calculator.
- Enter x, the point where you want the height of the curve, as a decimal strictly between 0 and 1; a proportion of 40% is 0.4.
- Enter shape alpha and shape beta, both positive. To encode evidence from a flat start, use successes + 1 and failures + 1. To encode a belief with mean m worth n observations, use α = m × n and β = (1 − m) × n.
- Read the density. On its own it is a height, so it is most useful compared across points: if the density at 0.3 is twice that at 0.6, values near 0.3 are twice as plausible as values near 0.6.
- For the probability of a range, such as the chance the proportion is below 0.4, use a cumulative beta function instead, for example BETA.DIST with the cumulative flag set to TRUE in a spreadsheet.
The formula.
f(x) = x^(α−1) × (1−x)^(β−1) ÷ B(α, β). The factor x^(α−1) grows toward x = 1 as α rises, pulling the curve right; (1−x)^(β−1) does the same toward 0 as β rises. B(α, β) = Γ(α)Γ(β) ÷ Γ(α + β) is the beta function, the constant that scales the curve so its total area is exactly 1. For whole-number shapes the gamma function reduces to factorials, Γ(n) = (n − 1)!, so B(2, 3) = 1! × 2! ÷ 4! = 1/12. The page works in logarithms, adding (α−1)·ln x and (β−1)·ln(1−x) and subtracting the log-gamma terms from a Lanczos approximation before exponentiating, so very large shapes do not overflow. Swapping α and β mirrors the curve: f(x; α, β) = f(1 − x; β, α).
A worked example.
Take x = 0.4 with α = 2 and β = 3, the distribution you would hold after one success and two failures starting from a flat prior. The exponents are α − 1 = 1 and β − 1 = 2, so the shape part is 0.4¹ × 0.6² = 0.4 × 0.36 = 0.144. The beta function is B(2, 3) = Γ(2)Γ(3) ÷ Γ(5) = (1 × 2) ÷ 24 = 1/12, and dividing by 1/12 means multiplying by 12: 0.144 × 12 = 1.728. So the curve stands 1.728 high at 0.4, just below its peak of about 1.778 at (2 − 1) ÷ (2 + 3 − 2) = 1/3. Out at x = 0.9 the height is only 0.108, so values near 0.4 are 16 times as plausible as values near 0.9. Integrating from 0 to 0.4 gives a probability of 0.5248, a little over half, because the curve has a longer tail to the right.
Frequently asked questions.
How can a probability density be greater than 1?
How do I choose alpha and beta from successes and failures?
What does the curve look like when alpha or beta is below 1?
How do I get the probability that the proportion is below a given value?
Why are x = 0 and x = 1 not allowed?
References& sources.
- [1]NIST/SEMATECH e-Handbook, Beta Distribution.
- [2]Johnson, Kotz and Balakrishnan, Continuous Univariate Distributions, Vol. 2 (PRINT).
- [3]BIPM, The International System of Units (SI Brochure), 9th ed., version 3.01, coherent derived units and quantity equations.
How this page was produced
- Published by
- Quanta Calculator
- Overseen by
- Daniel, Quanta Calculator Researcher
- Primary sources
- 3 cited below
- Method
- f(x) = x^(alpha-1)(1-x)^(beta-1) / B(alpha,beta)
- Published
- Last verified
Built with AI assistance and verified by automated tests against the cited sources — every worked example on this page is computed by the same code that runs the calculator. How we build and check calculators.
In this category
Embed
Quanta Pro
Paid features are coming later.
- All 1560 calculators remain free
- No billing is enabled