 Forum index » Science and Technology » Math » num-analysis
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^{a-1} (1-t)^{b-1} 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 Paul Abbott

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@ruhr-uni-bochum.de> wrote:

 Quote: anyone familiar with the numerical evaluation of the incomplete beta function defined by B(x;a,b) = \int_0^x t^{a-1} (1-t)^{b-1} 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 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,1-b; 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';1-z).

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 , Georg Wenig wrote: anyone familiar with the numerical evaluation of the incomplete beta function defined by B(x;a,b) = \int_0^x t^{a-1} (1-t)^{b-1} 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 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,1-b; 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,1-b,a+1;x),

so that B(x;a,b) = x^a/a F(a,1-b,a+1,x).

Now using Eq. 15.3.5 on F, one obtains

B(x;a,b) = x^a/a F(a,1-b,a+1;x)
= x^a/a * [ (1-x)^(b-1) F(1-b,1,a+1;x/(x-1) ],

so that

B(-x;a,b) = (-x)^a/a * [ (1+x)^(b-1) F(1-b,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';1-z). 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  Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First
 The time now is Tue Mar 26, 2019 5:12 am | All times are GMT Forum index » Science and Technology » Math » num-analysis
 Jump to: Select a forum-------------------Forum index|___Science and Technology    |___Math    |   |___Research    |   |___num-analysis    |   |___Symbolic    |   |___Combinatorics    |   |___Probability    |   |   |___Prediction    |   |       |   |___Undergraduate    |   |___Recreational    |       |___Physics    |   |___Research    |   |___New Theories    |   |___Acoustics    |   |___Electromagnetics    |   |___Strings    |   |___Particle    |   |___Fusion    |   |___Relativity    |       |___Chem    |   |___Analytical    |   |___Electrochem    |   |   |___Battery    |   |       |   |___Coatings    |       |___Engineering        |___Control        |___Mechanics        |___Chemical

 Topic Author Forum Replies Last Post Similar Topics Generating function for Mathieu functions cosmicstring@gmail.com Math 1 Fri Jul 21, 2006 8:39 am Choice function over finite sets Peter Webb Math 5 Fri Jul 21, 2006 3:28 am Function from Taylor series? Nathan Urban Research 1 Thu Jul 20, 2006 12:48 am Function not in L_1 {[0,1]}, but satisfies ...? atkrunner@hotmail.com Math 12 Thu Jul 20, 2006 12:46 am a basic question concerning zeta-function/zeta-zeroes Gottfried Helms Math 4 Sun Jul 16, 2006 10:25 am