13.3.4.2 The Beta Function

13.3.4.2  The Beta Function

There is a frequently used function called the beta function that is closely related to the gamma function discussed earlier. The beta function is denoted by B(m,n) and is defined as the following.

 

                                        (15)

B(m,n) can be shown to converge for any m>0 and any n>0.

The beta function is connected to the gamma function according to the relation given below.

 

 

                                        (16)

Many integrals can be evaluated in terms of beta and gamma functions. A useful result, frequently used, is the following.

 

 

                                        (17)

This formula is valid for m>0 and n>0.

Some special values for the beta function are given below.

 

                                        (18)

                     

                     

                     

                     

                     

The following program computes the value of the beta function for a sequence of pairs of arguments given.

 Program 13.6

#!/usr/bin/perl
#!/usr/bin/perl
#beta.pl
use Math::Cephes qw (:betas);
use strict;

for (my $j = 10, my $k = 20; $j <= 100, $k <= 200;
     $j = $j + 10, $k = $k + 10){
  my $betaVal = Math::Cephes::beta ($j, $k);
  print "beta($j, $k) = $betaVal\n";
}

 

The output of this function is given below.

 

beta(10, 20) = 4.99250874063468e-09

beta(20, 30) = 1.7681885473062e-15

beta(30, 40) = 1.05394246037965e-21

beta(40, 50) = 7.51617121185538e-28

beta(50, 60) = 5.84256439064177e-34

beta(60, 70) = 4.77068553860886e-40

beta(70, 80) = 4.01922740820151e-46

beta(80, 90) = 3.45937739021208e-52

beta(90, 100) = 3.02385319165625e-58

beta(100, 110) = 2.6740239592764e-64

beta(110, 120) = 2.3860676103157e-70

beta(120, 130) = 2.14445046188729e-76

beta(130, 140) = 1.93857877864822e-82

beta(140, 150) = 1.7609569287595e-88

beta(150, 160) = 1.60611588795791e-94

beta(160, 170) = 1.46996016336776e-100

beta(170, 180) = 1.34935375284916e-106

beta(180, 190) = 1.24184863959569e-112

beta(190, 200) = 1.14550146955917e-118

 

Math::Cephes provides implementation of several variations of the beta function as well. Of these, the so-called incomplete beta function and its inverse are commonly used in statistics.