Mean, variance and standard error of a beta-distributed probability

Gives the expected value and the variance of a probability that follows Beta(alpha, beta), and its standard error as the square root of the variance. The mean depends only on the ratio of the two parameters, while their sum acts like a sample size: the larger alpha + beta, the narrower the distribution. The function sqrt is the square root.

Signature

E_p = alpha / (alpha + beta); V_p = alpha * beta / ((alpha + beta)^2 * (alpha + beta + 1)); SE_p = sqrt(V_p)
Inputs
InputsDefinitionUnit
alphaFirst shape parameter, above zero; with event counts, the number of eventsnone
betaSecond shape parameter, above zero; with event counts, the number of non-eventsnone
Output
E_pExpected value of the uncertain probability pprobability, above zero and below one
V_pVariance of p, describing uncertainty in the population probability rather than variation between patientsprobability squared
SE_pStandard deviation of the beta distribution, read as the standard error of the probabilityprobability

Function

Beta distribution density, moments and fitting for an uncertain probability

Maps two positive shape parameters, alpha and beta, to a probability density on the unit interval that describes uncertainty about a probability, such as a transition probability in a decision tree or Markov model. The parameters are fitted from event counts, with alpha counting events and beta non-events, or from a reported mean and standard error by the method of moments, and the fitted distribution is sampled in probabilistic sensitivity analysis. The formulae below give the mean and variance, the two fitting routes, the gamma alternative for a utility decrement and the Dirichlet extension for states with three or more exits. Gamma(.) in the density is the gamma function.

Try this function

Implementations

  • Excel

    Beta mean, variance and standard error in three cells

    With named cells AlphaParam and BetaParam, the three formulas return the mean, the variance and the standard error; the third refers to the variance held in a cell named Variance.

    =AlphaParam/(AlphaParam+BetaParam); =AlphaParam*BetaParam/((AlphaParam+BetaParam)^2*(AlphaParam+BetaParam+1)); =SQRT(Variance)

Assumptions

  • Positive beta shape parameters

    Both alpha and beta are above zero, the condition for the beta density to integrate to one. A zero parameter, as produced by a zero event count with no prior, does not define a beta distribution.

  • Beta variance read as parameter uncertainty

    The distribution describes uncertainty about a population probability, so SE_p is a standard error that shrinks as evidence accumulates. It does not describe how individual patients differ.

Worked examples

  • Moments of Beta(24, 96) for a one-year progression probability

    In the article's illustrative cohort, 24 of 120 patients progressed within a year, giving Beta(24, 96). The mean is 0.20, the variance about 0.0013223, shown as 0.00132 in the article, and the standard error about 0.036364.

    alpha = 24; beta = 96; E_p = 0.20; V_p = 0.0013223; SE_p = 0.036364
  • Moments of Beta(12.6, 50.4) fitted to a mean of 0.20

    The method-of-moments fit in the article's second step has the same mean, 0.20, and a variance of 0.0025, so it returns the reported standard error of 0.05 exactly, which confirms the fit.

    alpha = 12.6; beta = 50.4; E_p = 0.20; V_p = 0.0025; SE_p = 0.05
  • Moments of the uniform Beta(1, 1)

    With both parameters equal to one the distribution is uniform, with mean 0.5 and variance one twelfth, about 0.083333, so the standard error is about 0.288675.

    alpha = 1; beta = 1; E_p = 0.5; V_p = 0.083333; SE_p = 0.288675

Common errors

  • Treating beta fits with the same mean as interchangeable

    Two beta distributions with the same mean can carry very different uncertainty. Beta(24, 96) and Beta(12.6, 50.4) both have mean 0.20 but standard errors of about 0.036 and 0.050, because the second behaves like evidence from about 63 patients rather than 120. Reporting only the mean hides this, which is why the ISPOR-SMDM task force asks for each distribution and its parameters to be disclosed.

Sources

  • Beta density, mean and variance in Bayesian Data Analysis

    Gelman A, Carlin JB, Stern HS, Dunson DB, Vehtari A, Rubin DB. Bayesian Data Analysis. 3rd edition. Boca Raton: Chapman & Hall/CRC; 2013. Appendix A, Table A.1 (pp. 580-581), which gives the beta density on the unit interval with mean alpha/(alpha + beta) and variance alpha beta/((alpha + beta)^2 (alpha + beta + 1)), and describes the two parameters, both above zero, as prior sample sizes.

    View source →

  • Reporting beta distributions and their parameters in a PSA

    Briggs AH, Weinstein MC, Fenwick EAL, Karnon J, Sculpher MJ, Paltiel AD. Model parameter estimation and uncertainty: a report of the ISPOR-SMDM Modeling Good Research Practices Task Force-6. Value in Health. 2012;15(6):835-842. Section on reporting probabilistic sensitivity analysis, p. 840, which states that the specific distribution and its parameters should be disclosed and the choice justified.

    View source →

Canonical Identity

Stable URI · Machine-readable · Resolvable · CC BY 4.0