# Beta Distributions for a Given Mean, Median or Mode

The beta distribution of a random variable , where and , has mode , mean , median and variance , which are determined by and in a nonintuitive manner. However, once , or has been chosen, can be expressed as a function of its value and becomes the sole determinant of the distribution's spread. This Demonstration calculates and plots the beta distribution's probability density function (PDF) and cumulative distribution function (CDF) for chosen values of the mode, mean or median and displays the numerical values of all three, as well as the corresponding variance.

### DETAILS

Snapshot 1: beta distribution function with a fixed mode and left skewness
Snapshot 2: symmetric beta distribution function where the mode, mean and median coincide
Snapshot 3: wide beta distribution function with a fixed mean and right skewness
Snapshot 4: narrow beta distribution function with a fixed median and left skewness
Snapshot 5: beta distribution function with a fixed mode and right skewness resembling a truncated distribution, reminiscent of the coarse fraction after sieving the fines
Snapshot 6: beta distribution function with a fixed mean and left skewness resembling a truncated distribution, reminiscent of the fine fraction after sieving
The beta distribution is a convenient flexible function for a random variable in a finite absolute range from to , determined by empirical or theoretical considerations. A corresponding normalized dimensionless independent variable can be defined by
,
or, when the spread is over orders of magnitude,
,
which restricts its domain to in either case.
The beta distribution function, with two parameters and, can be written in the form [1–3]
When both , is a unimodal distribution. When it is symmetric around and for its skewness direction is determined by whether or .
Since for the beta distribution's mode is
,
its mean
and its median
,
can be expressed explicitly in terms of and the mode, mean or median, that is,
, and ,
respectively. These terms, in turn, can be used to calculate and plot the beta distribution function for any chosen (fixed) value of the mode, mean or median, as a function of alone.
Choose the parameter to be fixed (mode, mean or median) with the "plot parameter" setter bar and enter its selected value using the slider. The value of can then also be entered and varied with its slider to calculate and plot the PDF and CDF forms of the beta distribution for the current setting. The numerical values of the other parameters and corresponding variance are then calculated and displayed above the plots.
Except for the mode, the mean, median and variance can also be calculated with the built-in Wolfram Language functions Mean, Median and Variance, and for simplicity we have used the median's commonly accepted approximation formula for and not the more elaborate general form [4]. Also note that certain entered control settings may produce parameters that violate the condition and thus should be discarded.
References
[1] E. W. Weisstein. "Beta Distribution" from Wolfram MathWorld—A Wolfram Web Resource. mathworld.wolfram.com/BetaDistribution.html.
[2] Wikipedia. "Beta Distribution." (Apr 24, 2019) en.wikipedia.org/wiki/Beta_distribution.
[3] Engineering Statistics Handbook, "Beta Distribution." (Apr 24, 2019) www.itl.nist.gov/div898/handbook/eda/section3/eda366h.htm.
[4] J. Kerman, "A Closed-Form Approximation for the Median of the Beta Distribution." arxiv.org/abs/1111.0433v1.

### PERMANENT CITATION

 Share: Embed Interactive Demonstration New! Just copy and paste this snippet of JavaScript code into your website or blog to put the live Demonstration on your site. More details » Download Demonstration as CDF » Download Author Code »(preview ») Files require Wolfram CDF Player or Mathematica.