Author 
Message 
Georg Wenig science forum beginner
Joined: 29 Jul 2005
Posts: 4

Posted: Mon Jul 17, 2006 9:37 am Post subject:
Incomplete Beta function



Hi there,
anyone familiar with the numerical evaluation of the incomplete beta
function defined by
B(x;a,b) = \int_0^x t^{a1} (1t)^{b1} dt
especially for the case x < 0?
I found various implementations of B (Netlib, GSL, ...). These
implementations allow for all values a,b>0 and therefore assume 0 < x < 1
to avoid (potential) trouble with square roots in the integrands.
In my case I know that a is an integer >= 1, so that x < 0 is no problem.
Does anyone know how to evaluate the beta function for this case
efficiently? Can the standard methods (continued fractions, power series
etc.) from the available codes easily be extended to my situation? Is there
even code available I have not found yet?
Thanks in advance and best regards,
Georg 

Back to top 


Paul Abbott science forum addict
Joined: 19 May 2005
Posts: 99

Posted: Mon Jul 17, 2006 2:07 pm Post subject:
Re: Incomplete Beta function



In article <4i141vF1l4l2U1@news.dfncis.de>,
Georg Wenig <georg.wenig@ruhrunibochum.de> wrote:
Quote:  anyone familiar with the numerical evaluation of the incomplete beta
function defined by
B(x;a,b) = \int_0^x t^{a1} (1t)^{b1} dt
especially for the case x < 0?
I found various implementations of B (Netlib, GSL, ...). These
implementations allow for all values a,b>0 and therefore assume 0 < x < 1
to avoid (potential) trouble with square roots in the integrands.
In my case I know that a is an integer >= 1, so that x < 0 is no problem.
Does anyone know how to evaluate the beta function for this case
efficiently? Can the standard methods (continued fractions, power series
etc.) from the available codes easily be extended to my situation? Is there
even code available I have not found yet?

For a an integer >= 1, Beta[x, a, b] can be computed explicitly. For
example, using Mathematica,
Table[{a, Beta[x, a, b]}, {a, 3}] // FunctionExpand // Factor
b
1 + (1  x)
()
1 b
b b
1 + (1  x) + b (1  x) x
()
2 b (1 + b)
b b b 2 2 b 2
2 + 2 (1  x) + 2 b (1  x) x + b (1  x) x + b (1  x) x
()
3 b (1 + b) (2 + b)
The recurrence relation you want is given at
http://functions.wolfram.com/06.19.17.0002.01
Cheers,
Paul
_______________________________________________________________________
Paul Abbott Phone: 61 8 6488 2734
School of Physics, M013 Fax: +61 8 6488 1014
The University of Western Australia (CRICOS Provider No 00126G)
AUSTRALIA http://physics.uwa.edu.au/~paul 

Back to top 


Nico Temme science forum beginner
Joined: 04 Oct 2005
Posts: 4

Posted: Mon Jul 17, 2006 5:42 pm Post subject:
Re: Incomplete Beta function



Georg, Paul,
I would use
B(x;a,b) = (x)^a(1+x)^b/(aB(a,b)) F(1,1b; a+1; x/(1+x),
where F is the Gauss hyperegeometric function.
The power series of the Gauss function converges for every positive x.
When x is large you can switch and use representations of
F(a,b;c;z) in terms of F(a',b';c';1z).
See Abramowitz and Stegun, Eq. 15.3.6.
Nico.
On Mon, 17 Jul 2006, Paul Abbott wrote:
Quote:  Date: Mon, 17 Jul 2006 22:07:03 +0800
From: Paul Abbott <paul@physics.uwa.edu.au
Newsgroups: sci.math.numanalysis
Subject: Re: Incomplete Beta function
In article <4i141vF1l4l2U1@news.dfncis.de>,
Georg Wenig <georg.wenig@ruhrunibochum.de> wrote:
anyone familiar with the numerical evaluation of the incomplete beta
function defined by
B(x;a,b) = \int_0^x t^{a1} (1t)^{b1} dt
especially for the case x < 0?
I found various implementations of B (Netlib, GSL, ...). These
implementations allow for all values a,b>0 and therefore assume 0 < x < 1
to avoid (potential) trouble with square roots in the integrands.
In my case I know that a is an integer >= 1, so that x < 0 is no problem.
Does anyone know how to evaluate the beta function for this case
efficiently? Can the standard methods (continued fractions, power series
etc.) from the available codes easily be extended to my situation? Is there
even code available I have not found yet?
For a an integer >= 1, Beta[x, a, b] can be computed explicitly. For
example, using Mathematica,
Table[{a, Beta[x, a, b]}, {a, 3}] // FunctionExpand // Factor
b
1 + (1  x)
()
1 b
b b
1 + (1  x) + b (1  x) x
()
2 b (1 + b)
b b b 2 2 b 2
2 + 2 (1  x) + 2 b (1  x) x + b (1  x) x + b (1  x) x
()
3 b (1 + b) (2 + b)
The recurrence relation you want is given at
http://functions.wolfram.com/06.19.17.0002.01
Cheers,
Paul
_______________________________________________________________________
Paul Abbott Phone: 61 8 6488 2734
School of Physics, M013 Fax: +61 8 6488 1014
The University of Western Australia (CRICOS Provider No 00126G)
AUSTRALIA http://physics.uwa.edu.au/~paul



Back to top 


Georg Wenig science forum beginner
Joined: 29 Jul 2005
Posts: 4

Posted: Tue Jul 18, 2006 8:06 am Post subject:
Re: Incomplete Beta function



Nico Temme wrote:
Quote: 
B(x;a,b) = (x)^a(1+x)^b/(aB(a,b)) F(1,1b; a+1; x/(1+x),
where F is the Gauss hyperegeometric function.
Thanks for the hint, but are sure about the relation as it stands? 
Abramowitz and Stegun, Eq. 26.5.23 give
I(x;a,b) = B(x;a,b)/B(a,b) = 1/B(a,b) x^a/a F(a,1b,a+1;x),
so that B(x;a,b) = x^a/a F(a,1b,a+1,x).
Now using Eq. 15.3.5 on F, one obtains
B(x;a,b) = x^a/a F(a,1b,a+1;x)
= x^a/a * [ (1x)^(b1) F(1b,1,a+1;x/(x1) ],
so that
B(x;a,b) = (x)^a/a * [ (1+x)^(b1) F(1b,1,a+1;x/(1+x) ]
which is similar but not identical to your relation.
Quote:  The power series of the Gauss function converges for every positive x.
When x is large you can switch and use representations of
F(a,b;c;z) in terms of F(a',b';c';1z).
See Abramowitz and Stegun, Eq. 15.3.6.
What would be the main advantage of your suggestion compared to Paul's? 
Avoiding the recursion?
Thanks to both of you,
Georg 

Back to top 


Google


Back to top 



The time now is Thu Jan 17, 2019 2:12 pm  All times are GMT

