Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Sum of two beta distributions

5,952 views
Skip to first unread message

Torben Hoffmann

unread,
Jan 9, 2004, 2:49:39 AM1/9/04
to
Hi,

I have just attended a course on scheduling for project managers and there
the beta distribution comes up in relation to estimation of task durations.

I have looked up in my old probability theory book regarding this and found
the proof for the fact that the sum of _many_ beta distributions converges
to a gaussian distribution, but neither my beloved book (and some hard core
integral solvining) or extensive search on the internet has given me
anything on what the distribution of the sum of two beta functions is. From
what I have found (this includes characteristic function of the beta
distribution and it's density function) I am beginning to believe that there
is no distribution defined/named for the sum of two beta distributions, but
I might be wrong.

Can anyone answer this one?

Thanks in advance
/Torben
--

P.S. The views expressed above are my own.
P.P.S. Remove dashes in mail address when replying.


Robert Israel

unread,
Jan 9, 2004, 5:55:45 PM1/9/04
to
In article <btll8u$2il$1...@avnika.corp.mot.com>,
Torben Hoffmann <Torben....@mo-to-ro-la.com> wrote:


>I have just attended a course on scheduling for project managers and there
>the beta distribution comes up in relation to estimation of task durations.

>I have looked up in my old probability theory book regarding this and found
>the proof for the fact that the sum of _many_ beta distributions converges
>to a gaussian distribution,

Presumably you're talking about independent random variables with the
same parameters for the beta distribution. Then this is just the Central
Limit Theorem - nothing special about beta distribution.

> but neither my beloved book (and some hard core
>integral solvining) or extensive search on the internet has given me
>anything on what the distribution of the sum of two beta functions is. From
>what I have found (this includes characteristic function of the beta
>distribution and it's density function) I am beginning to believe that there
>is no distribution defined/named for the sum of two beta distributions, but
>I might be wrong.

I'm almost certain there's no closed-form general formula for the
distribution of the sum (again, assuming independence). In some
particular cases (e.g. if the parameters are positive integers) there
may be a formula, but it's not a "standard" named distribution.

Robert Israel isr...@math.ubc.ca
Department of Mathematics http://www.math.ubc.ca/~israel
University of British Columbia
Vancouver, BC, Canada V6T 1Z2

Herman Rubin

unread,
Jan 10, 2004, 9:08:25 AM1/10/04
to
In article <btnbhh$ob9$1...@nntp.itservices.ubc.ca>,

Robert Israel <isr...@math.ubc.ca> wrote:
>In article <btll8u$2il$1...@avnika.corp.mot.com>,
>Torben Hoffmann <Torben....@mo-to-ro-la.com> wrote:


>>I have just attended a course on scheduling for project managers and there
>>the beta distribution comes up in relation to estimation of task durations.

>>I have looked up in my old probability theory book regarding this and found
>>the proof for the fact that the sum of _many_ beta distributions converges
>>to a gaussian distribution,

>Presumably you're talking about independent random variables with the
>same parameters for the beta distribution. Then this is just the Central
>Limit Theorem - nothing special about beta distribution.

>> but neither my beloved book (and some hard core
>>integral solvining) or extensive search on the internet has given me
>>anything on what the distribution of the sum of two beta functions is. From
>>what I have found (this includes characteristic function of the beta
>>distribution and it's density function) I am beginning to believe that there
>>is no distribution defined/named for the sum of two beta distributions, but
>>I might be wrong.

>I'm almost certain there's no closed-form general formula for the
>distribution of the sum (again, assuming independence). In some
>particular cases (e.g. if the parameters are positive integers) there
>may be a formula, but it's not a "standard" named distribution.

The distribution of the sum of k Beta independent random
variables has a density which is not analytic at any sum
of endpoints; there are between k+1 and 2^k of these,
depending on the particular ranges, and all but 2 of the
endpoints are internal.

The distribution of a sum of independent Beta random variables
is "close" to normal if no variance is large compared to the
sum, and the parameters do not get too extreme; iid always
works, but the rate of convergence is well estimated by the
sum of the third absolute moments about the mean divided by
the cube of the standard deviation, the Berry-Esseen result.


--
This address is for information only. I do not claim that these views
are those of the Statistics Department or of Purdue University.
Herman Rubin, Department of Statistics, Purdue University
hru...@stat.purdue.edu Phone: (765)494-6054 FAX: (765)494-0558

Colin Rose

unread,
Jan 11, 2004, 9:59:02 AM1/11/04
to
Torben Hoffmann <Torben....@mo-to-ro-la.com> wrote:

> ... The sum of _many_ beta distributions converges to a gaussian distribution,

> but neither my beloved book (and some hard core integral solvining) or extensive search on the internet has given me

> anything on what the distribution of the sum of two beta functions is. ...

Herman Rubin wrote:

The distribution of a sum of independent Beta random variables
is "close" to normal if no variance is large compared to the sum,
and the parameters do not get too extreme;


The pdf of the sum of 2 Beta rv's (the question posed above) will
generally not be "close" to Normal. One can derive the characteristic
function of the sum, and then invert it numerically to derive the pdf,
for given parameter values.

For example, here is a quick 2-line derivation and pdf plot using
mathStatica:

http://www.mathstatica.com/Sumof2Betas/

Cheers

Colin

______________________________
Dr Colin Rose
mathStatica Pty Ltd

Email: co...@mathStatica.com

Web: www.mathStatica.com
______________________________

Axel Vogt

unread,
Jan 11, 2004, 3:31:26 PM1/11/04
to
Colin Rose wrote:
>
> Torben Hoffmann <Torben....@mo-to-ro-la.com> wrote:
>
> > ... The sum of _many_ beta distributions converges to a gaussian distribution,
> > but neither my beloved book (and some hard core integral solvining) or extensive search on the internet has given me
> > anything on what the distribution of the sum of two beta functions is. ...
>
> Herman Rubin wrote:
>
> The distribution of a sum of independent Beta random variables
> is "close" to normal if no variance is large compared to the sum,
> and the parameters do not get too extreme;
>
> The pdf of the sum of 2 Beta rv's (the question posed above) will
> generally not be "close" to Normal. One can derive the characteristic
> function of the sum, and then invert it numerically to derive the pdf,
> for given parameter values.
>
> For example, here is a quick 2-line derivation and pdf plot using
> mathStatica:
>
> http://www.mathstatica.com/Sumof2Betas/
>
> Cheers
>
> Colin


BTW: is there a 'standardized' way to measure how far
a pdf is from being normal? I mean, hm, a practical
one and may be only for some classes of pdf.

Robert Dodier

unread,
Jan 11, 2004, 7:55:19 PM1/11/04
to
Colin Rose <co...@mathStatica.com> wrote:

> The pdf of the sum of 2 Beta rv's (the question posed above) will
> generally not be "close" to Normal. One can derive the characteristic
> function of the sum, and then invert it numerically to derive the pdf,
> for given parameter values.
>
> For example, here is a quick 2-line derivation and pdf plot using

> mathStatica: [...]

Well, if numerical approximations are allowed, here's a short
construction in Octave which amounts to the same thing (since the
convolution is implemented via the fast Fourier transform).

x = 0:0.01:1;
f = 1/beta(a, b) * x.^(a-1) .* (1-x).^(b-1);
f2 = conv(f, f);
f2 = f2 / sum(f2*0.01);
plot([0:0.01:2], f2);

It's more than 2 lines, but the upside is that you don't have to
buy somebody's book and/or program to do it.

Happy new year,
Robert Dodier
--
If I have not seen as far as others, it is because
giants were standing on my shoulders. -- Hal Abelson

Colin Rose

unread,
Jan 14, 2004, 1:17:32 PM1/14/04
to
Colin Rose <co...@mathStatica.com> wrote:

> The pdf of the sum of 2 Beta rv's will generally NOT be "close" to Normal.

> For example, here is a quick 2-line derivation and pdf plot using
> mathStatica: [...]


Robert Dodier <robert...@yahoo.com> replied:

> Well, if NUMERICAL approximations are allowed, here's a short
> construction in Octave which amounts to the same thing [ snip ]


Neat code. Since you have raised the stakes, I shall see your
Numerical solution, and raise you an EXACT SYMBOLIC solution
(given parameter values). See:

http://www.mathStatica.com/Sumof2Betas/

Method 2: Transform Method
Exact Symbolic solutions for sum of 2 Betas

This yields some rather scrumptuous pdf plots.

Robert Dodier

unread,
Jan 18, 2004, 4:25:48 PM1/18/04
to
Concerning a numerical solution, Colin Rose <co...@mathStatica.com> wrote:

> Neat code. Since you have raised the stakes,

A telling phrase, indeed.

> I shall see your Numerical solution, and raise you an
> EXACT SYMBOLIC solution (given parameter values). See:
>

> http://www.mathStatica.com/Sumof2Betas/ [...]

Well, here's some Maxima (http://maxima.sourceforge.net) code
for this problem. We approach the problem by stating it as a
convolution, and then carrying out the integration.

(C1) f(t):=1/beta(a,b)*t^(a-1)*(1-t)^(b-1)$
(C2) i:f(t)*f(u-t)$
(C3) assume(u>0)$
(C4) I1:integrate(ev(i,a=1/2,b=1),t,0,u);
%PI
(D4) ---
4
(C5) forget(u>0)$ assume(u>1,u<2)$
(C6)
(C7) I2:integrate(ev(i,a=1/2,b=1),t,u-1,1);
1
2 ATAN(-----------) - 2 ATAN(SQRT(u - 1))
SQRT(u - 1)
(D7) -----------------------------------------
4
(C8) g(u):=if u<1 then ev(I1) else ev(I2);
(D8) g(u) := IF u < 1 THEN EV(I1) ELSE EV(I2)
(C9) plot2d('(g(u)),[u,0,2])$

For these parameters (a=1/2, b=1) Maxima is happy. However
Maxima can't solve it with a=3/4, b=1. Rats!

Now what would be -really- useful in this context would be to
have the Maxima simplifier know about how indicator functions in
integrals work. Then the limits would be handled automatically,
and repeated integrations (sums of three or more variables in
this context) would be much simpler.

Incidentally Maxima is derived from the old (circa 1980)
MIT/DOE Macsyma source code. Commercial Macsyma was a fork of
that same code. It appears that Wolfram was heavily inspired by
Macsyma; maybe he should have taken the opportunity to revise the
programming language -- it's rather strange in Macsyma/Maxima, and
for better or worse Mathematica shares a lot of that strangeness.

Regards,

Robert Israel

unread,
Jan 18, 2004, 5:35:41 PM1/18/04
to
In article <6714766d.04011...@posting.google.com>,

Robert Dodier <robert...@yahoo.com> wrote:
|>Concerning a numerical solution, Colin Rose <co...@mathStatica.com>
wrote:

|>Well, here's some Maxima (http://maxima.sourceforge.net) code


|>for this problem. We approach the problem by stating it as a
|>convolution, and then carrying out the integration.

|>(C1) f(t):=1/beta(a,b)*t^(a-1)*(1-t)^(b-1)$
|>(C2) i:f(t)*f(u-t)$

...

|>For these parameters (a=1/2, b=1) Maxima is happy. However
|>Maxima can't solve it with a=3/4, b=1. Rats!

OK, here's some Maple.

> f:= (a,b,t) -> 1/Beta(a,b)*piecewise(t<0,0,t<1,t^(a-1)*(1-t)^(b-1),0);

> int(f(1/2,1,t)*f(1/2,1,u-t),t=0..1) assuming u>0,u<1;

Pi
----
4

> int(f(1/2,1,t)*f(1/2,1,u-t),t=0..1) assuming u>1,u<2;

u - 2
-1/2 arcsin(-----)
u

# However, Maple isn't clever enough to do the integral assuming u::real.
# For a=3/4,b=1, it won't do it assuming u>0,u<1 either, but:

> v:= f(3/4,1,t)*f(3/4,1,u-t) assuming t>0,t<1,u>t,u-t<1;

9
v := ------------------
1/4 1/4
16 t (u - t)

> F:= int(v,t);

3/4
t hypergeom([1/4, 3/4], [7/4], t/u)
F := 3/4 --------------------------------------
1/4
u

> F1:= simplify(eval(F,t=u)-eval(F,t=0)) assuming u>0,u<1;

1/2 2
u GAMMA(3/4)
F1 := 9/8 ----------------
1/2
Pi

> F2:= simplify(eval(F,t=1)-eval(F,t=u-1)) assuming u>1,u<2;

/
F2 := 3/4 |hypergeom([1/4, 3/4], [7/4], 1/u)
\

(3/4) u - 1 \ / 1/4
- (u - 1) hypergeom([1/4, 3/4], [7/4], -----)| / u
u / /

# Maple won't simplify this farther, although it can express it in terms
# of the LegendreP function.

> plot(piecewise(u<1,F1,F2),u=0..2);

Torben Hoffmann

unread,
Jan 20, 2004, 9:31:55 AM1/20/04
to
"Colin Rose" <co...@mathStatica.com> wrote in message
news:150120040518412381%co...@mathStatica.com...

> Colin Rose <co...@mathStatica.com> wrote:
>
> > The pdf of the sum of 2 Beta rv's will generally NOT be "close" to
Normal.
> > For example, here is a quick 2-line derivation and pdf plot using
> > mathStatica: [...]
>
>
> Robert Dodier <robert...@yahoo.com> replied:
>
> > Well, if NUMERICAL approximations are allowed, here's a short
> > construction in Octave which amounts to the same thing [ snip ]
>
>
> Neat code. Since you have raised the stakes, I shall see your
> Numerical solution, and raise you an EXACT SYMBOLIC solution
> (given parameter values). See:
>
> http://www.mathStatica.com/Sumof2Betas/
>
> Method 2: Transform Method
> Exact Symbolic solutions for sum of 2 Betas
>
> This yields some rather scrumptuous pdf plots.
>

Now that's neat indeed. I'll call your exact symbolic solution and raise
with the following:

1. Sum of two Betas with different parameters - I guess this is easy.
2. Sum of two Betas with different parameters and scaled diffently, ie, min
and max not tied to zero and one respectively (this is the scenario used
with Pert analysis).

(I have more to raise with but I'm keeping that in hand for the moment ;-)

BTW: MathStatica is about to enter my list of want-to-have toys - now I just
need a business case for getting it so that my boss will pay for it.

Cheers,

0 new messages