Function Repository Resource:

MeanSpreadBetaDistribution

Source Notebook

Create a beta distribution using the mean and a measure of its spread as parameters instead of using the conventional parameters

Contributed by: Seth J. Chandler

ResourceFunction["MeanSpreadBetaDistribution"][mean,spread]

creates a beta distribution that is centered at mean and with standard deviation of spread multiplied by the maximum possible standard deviation for mean.

Details and Options

The mean and spread must both lie between 0 and 1.

Examples

Basic Examples (2) 

Create a beta distribution whose mean is 2/3 and whose standard deviation is 1/2 of the maximum possible value given that mean:

In[1]:=
ResourceFunction["MeanSpreadBetaDistribution"][2/3, 1/2]
Out[1]=

Create a beta distribution whose mean is 1/4 and whose standard deviation is 9/10 of the maximum possible value given that mean:

In[2]:=
ResourceFunction["MeanSpreadBetaDistribution"][1/4, 9/10]
Out[2]=

Scope (1) 

The function handles symbolic parameters:

In[3]:=
ResourceFunction["MeanSpreadBetaDistribution"][\[Mu], \[ScriptS]]
Out[3]=

Applications (1) 

Show how decreasing the spread of a beta distribution affects the associated PDF :

In[4]:=
Table[Plot[
  PDF[ResourceFunction["MeanSpreadBetaDistribution"][0.6, spread], x], {x, 0, 1}, PlotRange -> {0, 10}, PlotLabel -> StringTemplate["spread: `1`"][spread]], {spread, 0.1, 0.9, 0.2}]
Out[4]=

Properties and Relations (2) 

One can take the parameters of a beta distribution and compute their mean and spread:

In[5]:=
Mean[BetaDistribution[a, b]]
Out[5]=
In[6]:=
sol = Solve[
  StandardDeviation[BetaDistribution[a, b]] == \[ScriptS]*
    StandardDeviation[BetaDistribution[a, 1]], \[ScriptS]]
Out[6]=

Thus, for BetaDistribution[3,4] the mean is 3/7 and the spread is calculated below:

In[7]:=
sol /. {a -> 3, b -> 4}
Out[7]=

Possible Issues (1) 

If one uses a spread less than zero, the result is a meaningless beta distribution. With a value of greater than one, the result is a meaningless beta distribution with an illegal negative first parameter:

In[8]:=
{ResourceFunction["MeanSpreadBetaDistribution"][1/2, -1/2], ResourceFunction["MeanSpreadBetaDistribution"][1/2, 3/2]}
Out[8]=

Publisher

Seth J. Chandler

Version History

  • 1.0.0 – 17 December 2019

Related Resources

Author Notes

The reparameterization of the beta distribution is found by first computing a value σ[μ] that constitutes the maximum permissible standard deviation for a BetaDistribution with a given mean μ and then executing the following code, which solves for conventional parameters a and b:

License Information