Beta Distribution Calculator
Evaluate the beta density, mean and variance for two positive shape parameters.
What it does
The beta distribution is a flexible family for values that lie between zero and one. It is often used for proportions, probabilities and fractions, and it is the conjugate prior for the Bernoulli and binomial parameters in Bayesian statistics.
The density depends on two positive shape parameters. The beta function in the denominator makes the total area equal to one. When both shapes are one the distribution is uniform. When they are equal and greater than one it is symmetric about one half, and when they differ it is skewed toward one end.
The mean is alpha over alpha plus beta, so the two parameters can be thought of as weights pulling the distribution toward zero or one. The variance falls as the shapes grow, giving a narrower distribution when there is more information.
The tool evaluates the density at one value of x and also prints the mean and variance. It uses the gamma function to compute the beta normalising constant, which allows non integer shape parameters as well as whole numbers.
If either shape is less than one the density becomes infinite at the corresponding endpoint. The tool reports that case explicitly rather than returning an estimate. For interval probabilities you would need the cumulative distribution function, which this page does not provide.
How to use
- Enter a value x between zero and one.
- Enter a positive shape parameter alpha.
- Enter a positive shape parameter beta.
- Read the density at x.
- Read the mean and variance of the distribution.
- Check whether either shape is below one, which changes endpoint behaviour.
Formula
- x
- Value in the standard interval from 0 to 1.
- alpha
- First positive shape parameter.
- beta
- Second positive shape parameter.
- B
- Beta function, the normalising constant.
- Gamma
- Gamma function, a generalised factorial.
The variance is alpha times beta divided by (alpha plus beta) squared times (alpha plus beta plus one). The standard form has no location or scale parameters, so a variable on a different interval must be rescaled before using this tool.
Worked example
Example: x = 0.4 with alpha 2 and beta 3
Defaults: x 0.4, alpha 2 and beta 3.
- Beta of 2 and 3 is Gamma(2)Gamma(3)/Gamma(5) = 1 x 2 / 24 = 1/12.
- x to the power alpha minus one is 0.4.
- One minus x to the power beta minus one is 0.6 squared, or 0.36.
- Numerator: 0.4 x 0.36 = 0.144.
- Density: 0.144 / (1/12) = 1.728000.
- Mean is 2 / 5 = 0.400000 and variance is 6 / 150 = 0.040000.
Reference table
| x | Density | Comment |
|---|---|---|
| 0.1 | 0.486000 | Lower tail |
| 0.4 | 1.728000 | Default example |
| 0.6 | 1.152000 | Upper side |
| 0.9 | 0.054000 | Upper tail |
Limits
- Only covers the standard interval from zero to one.
- Reports density, not cumulative probability.
- Endpoint densities can be infinite for shapes below one.
- Does not fit parameters from data.
Common mistakes
- Entering x outside the zero to one interval.
- Using a negative or zero shape parameter.
- Reading density as probability.
- Applying the standard form to a variable on a different range without rescaling.
- Confusing the beta distribution with the beta function alone.
Try it yourself
Quick checks. Answers sit tucked under each question.
What happens for alpha 0.5 and beta 0.5 at x 0.5?
The density is 0.318310 and the variance is 0.125000. Both shapes below one give a U shaped density with infinite ends.
What distribution results when both shapes equal one?
The uniform distribution on zero to one, with constant density one.
Why does the mean move toward one as alpha grows?
Because the mean is alpha over alpha plus beta, so a larger alpha relative to beta weights the upper end more.
Questions
What is the beta distribution used for?
Modelling proportions and probabilities, and as a prior distribution in Bayesian statistics.
Why is it limited to zero and one?
The standard form is defined on that interval. Other ranges need a rescaled version.
What are the two shape parameters?
Alpha and beta control how the density is skewed toward zero or one.
What is the beta function?
An integral that normalises the density so its total area is one.
Can shapes be non whole numbers?
Yes. The gamma function lets the formula work for any positive real shapes.
What if a shape is below one?
The density increases without bound at that endpoint, which the tool reports as infinite.