You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Sébastien Brisard (Created JIRA)" <ji...@apache.org> on 2012/02/04 07:33:53 UTC

[jira] [Created] (MATH-738) Incomplete beta function I(x, a, b) is inaccurate for large values of a and/or b

Incomplete beta function I(x, a, b) is inaccurate for large values of a and/or b
--------------------------------------------------------------------------------

                 Key: MATH-738
                 URL: https://issues.apache.org/jira/browse/MATH-738
             Project: Commons Math
          Issue Type: Bug
    Affects Versions: 3.1, 4.0
            Reporter: Sébastien Brisard


This was first reported in MATH-718. The result of the current implementation of the incomplete beta function I(x, a, b) is inaccurate when a and/or b are large-ish. 

I've skimmed through [slatec|http://www.netlib.org/slatec/fnlib/betai.f], GSL, [Boost|http://www.boost.org/doc/libs/1_38_0/libs/math/doc/sf_and_dist/html/math_toolkit/special/sf_beta/ibeta_function.html] as well as NR. At first sight, neither uses the same method to compute this function. I think [TOMS-708|http://www.netlib.org/toms/708] is probably the best option.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (MATH-738) Incomplete beta function I(x, a, b) is inaccurate for large values of a and/or b

Posted by "Sébastien Brisard (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-738?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13500603#comment-13500603 ] 

Sébastien Brisard commented on MATH-738:
----------------------------------------

In {{r1411387}}, implemented {{Gamma.logGammaSum}}, which maps (a, b) to log(Gamma(a + b)).
                
> Incomplete beta function I(x, a, b) is inaccurate for large values of a and/or b
> --------------------------------------------------------------------------------
>
>                 Key: MATH-738
>                 URL: https://issues.apache.org/jira/browse/MATH-738
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 3.0
>            Reporter: Sébastien Brisard
>            Assignee: Sébastien Brisard
>              Labels: special-functions
>             Fix For: 3.1, 4.0
>
>
> This was first reported in MATH-718. The result of the current implementation of the incomplete beta function I(x, a, b) is inaccurate when a and/or b are large-ish. 
> I've skimmed through [slatec|http://www.netlib.org/slatec/fnlib/betai.f], GSL, [Boost|http://www.boost.org/doc/libs/1_38_0/libs/math/doc/sf_and_dist/html/math_toolkit/special/sf_beta/ibeta_function.html] as well as NR. At first sight, neither uses the same method to compute this function. I think [TOMS-708|http://www.netlib.org/toms/708] is probably the best option.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (MATH-738) Incomplete beta function I(x, a, b) is inaccurate for large values of a and/or b

Posted by "Sébastien Brisard (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-738?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13503506#comment-13503506 ] 

Sébastien Brisard commented on MATH-738:
----------------------------------------

In {{r1413366}}, implemented Gamma.logGammaMinusLogGammaSum, which maps (a, b) to log[Γ(b) / Γ(a + b)].
                
> Incomplete beta function I(x, a, b) is inaccurate for large values of a and/or b
> --------------------------------------------------------------------------------
>
>                 Key: MATH-738
>                 URL: https://issues.apache.org/jira/browse/MATH-738
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 3.0
>            Reporter: Sébastien Brisard
>            Assignee: Sébastien Brisard
>              Labels: special-functions
>             Fix For: 3.1, 4.0
>
>
> This was first reported in MATH-718. The result of the current implementation of the incomplete beta function I(x, a, b) is inaccurate when a and/or b are large-ish. 
> I've skimmed through [slatec|http://www.netlib.org/slatec/fnlib/betai.f], GSL, [Boost|http://www.boost.org/doc/libs/1_38_0/libs/math/doc/sf_and_dist/html/math_toolkit/special/sf_beta/ibeta_function.html] as well as NR. At first sight, neither uses the same method to compute this function. I think [TOMS-708|http://www.netlib.org/toms/708] is probably the best option.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (MATH-738) Incomplete beta function I(x, a, b) is inaccurate for large values of a and/or b

Posted by "Sébastien Brisard (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-738?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13287199#comment-13287199 ] 

Sébastien Brisard commented on MATH-738:
----------------------------------------

Here are the results of some error tests I've carried out, based on reference values computed with Maxima and 64 decimal digits. The statistics correspond to errors in ulps.

{noformat}
***** a = 1.0, b = 1.0 *****
SummaryStatistics:
n: 129
min: 0.0
max: 9.0
mean: 3.9534883720930214
geometric mean: 0.0
variance: 5.700944767441859
sum of squares: 2746.0
standard deviation: 2.38766512883232
sum of logs: -Infinity

***** a = 1.0, b = 10.0 *****
SummaryStatistics:
n: 129
min: 0.0
max: 55.0
mean: 7.08527131782946
geometric mean: 0.0
variance: 217.3911094961241
sum of squares: 34302.0
standard deviation: 14.744189007745529
sum of logs: -Infinity

***** a = 1.0, b = 100.0 *****
SummaryStatistics:
n: 129
min: 0.0
max: 134.0
mean: 2.139534883720932
geometric mean: 0.0
variance: 203.46475290697674
sum of squares: 26634.0
standard deviation: 14.264107154216724
sum of logs: -Infinity

***** a = 10.0, b = 1.0 *****
SummaryStatistics:
n: 129
min: 0.0
max: 233.0
mean: 40.00000000000001
geometric mean: 0.0
variance: 923.1249999999999
sum of squares: 324560.0
standard deviation: 30.38297220483868
sum of logs: -Infinity

***** a = 10.0, b = 10.0 *****
SummaryStatistics:
n: 129
min: 0.0
max: 116.0
mean: 29.131782945736425
geometric mean: 0.0
variance: 729.1465600775194
sum of squares: 202808.0
standard deviation: 27.00271393911211
sum of logs: -Infinity

***** a = 10.0, b = 100.0 *****
SummaryStatistics:
n: 129
min: 0.0
max: 105.0
mean: 7.891472868217045
geometric mean: 0.0
variance: 495.05062984496084
sum of squares: 71400.0
standard deviation: 22.24973325334398
sum of logs: -Infinity

***** a = 100.0, b = 1.0 *****
SummaryStatistics:
n: 129
min: 0.0
max: 474.0
mean: 162.31007751937983
geometric mean: 0.0
variance: 8511.274194525193
sum of squares: 4487891.5
standard deviation: 92.25656721624317
sum of logs: -Infinity

***** a = 100.0, b = 10.0 *****
SummaryStatistics:
n: 129
min: 0.0
max: 364.0
mean: 113.30232558139537
geometric mean: 0.0
variance: 6252.290697674416
sum of squares: 2456320.0
standard deviation: 79.0714278211442
sum of logs: -Infinity

***** a = 100.0, b = 100.0 *****
SummaryStatistics:
n: 129
min: 0.0
max: 1447.0
mean: 464.9999999999998
geometric mean: 0.0
variance: 221595.28124999997
sum of squares: 5.6257221E7
standard deviation: 470.7390797989901
sum of logs: -Infinity
{noformat}

The situation is not too bad, but values claimed by [BOOST|http://www.boost.org/doc/libs/1_39_0/libs/math/doc/sf_and_dist/html/math_toolkit/special/sf_beta/ibeta_function.html] are much better. So it might be worth having a look at the implementation proposed in TOMS-708.
                
> Incomplete beta function I(x, a, b) is inaccurate for large values of a and/or b
> --------------------------------------------------------------------------------
>
>                 Key: MATH-738
>                 URL: https://issues.apache.org/jira/browse/MATH-738
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 3.1, 4.0
>            Reporter: Sébastien Brisard
>            Assignee: Sébastien Brisard
>              Labels: special-functions
>
> This was first reported in MATH-718. The result of the current implementation of the incomplete beta function I(x, a, b) is inaccurate when a and/or b are large-ish. 
> I've skimmed through [slatec|http://www.netlib.org/slatec/fnlib/betai.f], GSL, [Boost|http://www.boost.org/doc/libs/1_38_0/libs/math/doc/sf_and_dist/html/math_toolkit/special/sf_beta/ibeta_function.html] as well as NR. At first sight, neither uses the same method to compute this function. I think [TOMS-708|http://www.netlib.org/toms/708] is probably the best option.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Comment Edited] (MATH-738) Incomplete beta function I(x, a, b) is inaccurate for large values of a and/or b

Posted by "Sébastien Brisard (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-738?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13483917#comment-13483917 ] 

Sébastien Brisard edited comment on MATH-738 at 10/25/12 6:10 AM:
------------------------------------------------------------------

Hi Thomas,
thanks for proposing your help. Please wait a little, as I have already implemented some more methods, not yet committed.
For the time being, I'm working on a Java app to automatically assess the accuracy of implementation of special functions. I need to write a small README to explain how it works, then I'll commit the whole lot. I also have reimplemented logBeta. I will provide all these soon, but I am drowned in work for the time being.

I'll try to commit next weekend. Thanks for your patience!

BTW: be careful with TOMS code, which is copyrighted. I based my implementations on the NSWC library, which is very (very) similar, as it's the same author, but is not copyrighted.
                
      was (Author: celestin):
    Hi Thomas,
thanks for proposing your help. Please wait a little, as I have already implemented some more methods, not yet committed.
For the time being, I'm working on a Java app to automatically assess the accuracy of implementation of special functions. I need to write a small README to explain how it works, then I'll commit the whole lot. I also have reimplemented logBeta. I will provide all these soon, but I am drowned in work for the time being.
Thanks for your patience!
                  
> Incomplete beta function I(x, a, b) is inaccurate for large values of a and/or b
> --------------------------------------------------------------------------------
>
>                 Key: MATH-738
>                 URL: https://issues.apache.org/jira/browse/MATH-738
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 3.0
>            Reporter: Sébastien Brisard
>            Assignee: Sébastien Brisard
>              Labels: special-functions
>             Fix For: 3.1, 4.0
>
>
> This was first reported in MATH-718. The result of the current implementation of the incomplete beta function I(x, a, b) is inaccurate when a and/or b are large-ish. 
> I've skimmed through [slatec|http://www.netlib.org/slatec/fnlib/betai.f], GSL, [Boost|http://www.boost.org/doc/libs/1_38_0/libs/math/doc/sf_and_dist/html/math_toolkit/special/sf_beta/ibeta_function.html] as well as NR. At first sight, neither uses the same method to compute this function. I think [TOMS-708|http://www.netlib.org/toms/708] is probably the best option.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (MATH-738) Incomplete beta function I(x, a, b) is inaccurate for large values of a and/or b

Posted by "Sébastien Brisard (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-738?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13483917#comment-13483917 ] 

Sébastien Brisard commented on MATH-738:
----------------------------------------

Hi Thomas,
thanks for proposing your help. Please wait a little, as I have already implemented some more methods, not yet committed.
For the time being, I'm working on a Java app to automatically assess the accuracy of implementation of special functions. I need to write a small README to explain how it works, then I'll commit the whole lot. I also have reimplemented logBeta. I will provide all these soon, but I am drowned in work for the time being.
Thanks for your patience!
                
> Incomplete beta function I(x, a, b) is inaccurate for large values of a and/or b
> --------------------------------------------------------------------------------
>
>                 Key: MATH-738
>                 URL: https://issues.apache.org/jira/browse/MATH-738
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 3.0
>            Reporter: Sébastien Brisard
>            Assignee: Sébastien Brisard
>              Labels: special-functions
>             Fix For: 3.1, 4.0
>
>
> This was first reported in MATH-718. The result of the current implementation of the incomplete beta function I(x, a, b) is inaccurate when a and/or b are large-ish. 
> I've skimmed through [slatec|http://www.netlib.org/slatec/fnlib/betai.f], GSL, [Boost|http://www.boost.org/doc/libs/1_38_0/libs/math/doc/sf_and_dist/html/math_toolkit/special/sf_beta/ibeta_function.html] as well as NR. At first sight, neither uses the same method to compute this function. I think [TOMS-708|http://www.netlib.org/toms/708] is probably the best option.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (MATH-738) Incomplete beta function I(x, a, b) is inaccurate for large values of a and/or b

Posted by "Sébastien Brisard (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-738?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13500067#comment-13500067 ] 

Sébastien Brisard commented on MATH-738:
----------------------------------------

Starting first with {{Beta.logBeta(double, double)}}, accuracy of the current {{r}} implementation as reported in the users guide is
|| Interval                  || Values tested                                                             || Average error  || Standard deviation  || Maximum error  ||
| 0 < x ≤ 8, 0 < y ≤ 8       | {{x[i] = i / 32, i = 1, ..., 256}}, {{y[j] = j / 32, j = 1, ..., 256}}     | 5.04 ulps       | 270.99 ulps          | 46696.0 ulps    |
| 0 < x ≤ 8, 8 < y ≤ 16      | {{x[i] = i / 32, i = 1, ..., 256}}, {{y[j] = j / 32, j = 257, ..., 512}}   | 9.75 ulps       | 149.42 ulps          | 19126.0 ulps    |
| 0 < x ≤ 8, 16 < y ≤ 256    | {{x[i] = i / 32, i = 1, ..., 256}}, {{y[j] = j, j = 17, ..., 256}}         | 357.82 ulps     | 39297.58 ulps        | 8635522.0 ulps  |
| 8 < x ≤ 16, 8 < y ≤ 16     | {{x[i] = i / 32, i = 257, ..., 512}}, {{y[j] = j / 32, j = 257, ..., 512}} | 2.37 ulps       | 13.0 ulps            | 1.9 ulps        |
| 8 < x ≤ 16, 16 < y ≤ 256   | {{x[i] = i / 32, i = 257, ..., 512}}, {{y[j] = j, j = 17, ..., 256}}       | 10.75 ulps      | 9.74 ulps            | 73.0 ulps       |
| 16 < x ≤ 256, 16 < y ≤ 256 | {{x[i] = i, i = 17, ..., 256}}, {{y[j] = j, j = 17, ..., 256}}             | 5.20 ulps       | 4.33 ulps            | 53.0 ulps       |

                
> Incomplete beta function I(x, a, b) is inaccurate for large values of a and/or b
> --------------------------------------------------------------------------------
>
>                 Key: MATH-738
>                 URL: https://issues.apache.org/jira/browse/MATH-738
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 3.0
>            Reporter: Sébastien Brisard
>            Assignee: Sébastien Brisard
>              Labels: special-functions
>             Fix For: 3.1, 4.0
>
>
> This was first reported in MATH-718. The result of the current implementation of the incomplete beta function I(x, a, b) is inaccurate when a and/or b are large-ish. 
> I've skimmed through [slatec|http://www.netlib.org/slatec/fnlib/betai.f], GSL, [Boost|http://www.boost.org/doc/libs/1_38_0/libs/math/doc/sf_and_dist/html/math_toolkit/special/sf_beta/ibeta_function.html] as well as NR. At first sight, neither uses the same method to compute this function. I think [TOMS-708|http://www.netlib.org/toms/708] is probably the best option.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (MATH-738) Incomplete beta function I(x, a, b) is inaccurate for large values of a and/or b

Posted by "Sébastien Brisard (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-738?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13503514#comment-13503514 ] 

Sébastien Brisard commented on MATH-738:
----------------------------------------

In {{r1413369}}, implemented {{Beta.bcorr(double, double)}}, an auxiliary function for the computation of {{Beta.beta(double, double)}}.
                
> Incomplete beta function I(x, a, b) is inaccurate for large values of a and/or b
> --------------------------------------------------------------------------------
>
>                 Key: MATH-738
>                 URL: https://issues.apache.org/jira/browse/MATH-738
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 3.0
>            Reporter: Sébastien Brisard
>            Assignee: Sébastien Brisard
>              Labels: special-functions
>             Fix For: 3.1, 4.0
>
>
> This was first reported in MATH-718. The result of the current implementation of the incomplete beta function I(x, a, b) is inaccurate when a and/or b are large-ish. 
> I've skimmed through [slatec|http://www.netlib.org/slatec/fnlib/betai.f], GSL, [Boost|http://www.boost.org/doc/libs/1_38_0/libs/math/doc/sf_and_dist/html/math_toolkit/special/sf_beta/ibeta_function.html] as well as NR. At first sight, neither uses the same method to compute this function. I think [TOMS-708|http://www.netlib.org/toms/708] is probably the best option.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (MATH-738) Incomplete beta function I(x, a, b) is inaccurate for large values of a and/or b

Posted by "Thomas Neidhart (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-738?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13483455#comment-13483455 ] 

Thomas Neidhart commented on MATH-738:
--------------------------------------

Could you provide the scripts/programs you used for testing as a patch?
I may be able to help with the implementation of the TOMS-708 algorithm.
                
> Incomplete beta function I(x, a, b) is inaccurate for large values of a and/or b
> --------------------------------------------------------------------------------
>
>                 Key: MATH-738
>                 URL: https://issues.apache.org/jira/browse/MATH-738
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 3.0
>            Reporter: Sébastien Brisard
>            Assignee: Sébastien Brisard
>              Labels: special-functions
>             Fix For: 3.1, 4.0
>
>
> This was first reported in MATH-718. The result of the current implementation of the incomplete beta function I(x, a, b) is inaccurate when a and/or b are large-ish. 
> I've skimmed through [slatec|http://www.netlib.org/slatec/fnlib/betai.f], GSL, [Boost|http://www.boost.org/doc/libs/1_38_0/libs/math/doc/sf_and_dist/html/math_toolkit/special/sf_beta/ibeta_function.html] as well as NR. At first sight, neither uses the same method to compute this function. I think [TOMS-708|http://www.netlib.org/toms/708] is probably the best option.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (MATH-738) Incomplete beta function I(x, a, b) is inaccurate for large values of a and/or b

Posted by "Thomas Neidhart (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-738?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13483963#comment-13483963 ] 

Thomas Neidhart commented on MATH-738:
--------------------------------------

Hi Sebastien,

that sounds very good, I am looking forward to your code and will at least review it!
                
> Incomplete beta function I(x, a, b) is inaccurate for large values of a and/or b
> --------------------------------------------------------------------------------
>
>                 Key: MATH-738
>                 URL: https://issues.apache.org/jira/browse/MATH-738
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 3.0
>            Reporter: Sébastien Brisard
>            Assignee: Sébastien Brisard
>              Labels: special-functions
>             Fix For: 3.1, 4.0
>
>
> This was first reported in MATH-718. The result of the current implementation of the incomplete beta function I(x, a, b) is inaccurate when a and/or b are large-ish. 
> I've skimmed through [slatec|http://www.netlib.org/slatec/fnlib/betai.f], GSL, [Boost|http://www.boost.org/doc/libs/1_38_0/libs/math/doc/sf_and_dist/html/math_toolkit/special/sf_beta/ibeta_function.html] as well as NR. At first sight, neither uses the same method to compute this function. I think [TOMS-708|http://www.netlib.org/toms/708] is probably the best option.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (MATH-738) Incomplete beta function I(x, a, b) is inaccurate for large values of a and/or b

Posted by "Sébastien Brisard (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-738?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13496001#comment-13496001 ] 

Sébastien Brisard commented on MATH-738:
----------------------------------------

As of {{r1407592}}, programs and data files have been committed to {{/src/test/maxima}} to assess the accuracy of the current implementation. The users guide reports on this accuracy.
                
> Incomplete beta function I(x, a, b) is inaccurate for large values of a and/or b
> --------------------------------------------------------------------------------
>
>                 Key: MATH-738
>                 URL: https://issues.apache.org/jira/browse/MATH-738
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 3.0
>            Reporter: Sébastien Brisard
>            Assignee: Sébastien Brisard
>              Labels: special-functions
>             Fix For: 3.1, 4.0
>
>
> This was first reported in MATH-718. The result of the current implementation of the incomplete beta function I(x, a, b) is inaccurate when a and/or b are large-ish. 
> I've skimmed through [slatec|http://www.netlib.org/slatec/fnlib/betai.f], GSL, [Boost|http://www.boost.org/doc/libs/1_38_0/libs/math/doc/sf_and_dist/html/math_toolkit/special/sf_beta/ibeta_function.html] as well as NR. At first sight, neither uses the same method to compute this function. I think [TOMS-708|http://www.netlib.org/toms/708] is probably the best option.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Comment Edited] (MATH-738) Incomplete beta function I(x, a, b) is inaccurate for large values of a and/or b

Posted by "Sébastien Brisard (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-738?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13503506#comment-13503506 ] 

Sébastien Brisard edited comment on MATH-738 at 11/25/12 4:46 PM:
------------------------------------------------------------------

In {{r1413366}}, implemented {{Gamma.logGammaMinusLogGammaSum(double, double)}}, which maps (a, b) to log[Γ(b) / Γ(a + b)].
                
      was (Author: celestin):
    In {{r1413366}}, implemented Gamma.logGammaMinusLogGammaSum, which maps (a, b) to log[Γ(b) / Γ(a + b)].
                  
> Incomplete beta function I(x, a, b) is inaccurate for large values of a and/or b
> --------------------------------------------------------------------------------
>
>                 Key: MATH-738
>                 URL: https://issues.apache.org/jira/browse/MATH-738
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 3.0
>            Reporter: Sébastien Brisard
>            Assignee: Sébastien Brisard
>              Labels: special-functions
>             Fix For: 3.1, 4.0
>
>
> This was first reported in MATH-718. The result of the current implementation of the incomplete beta function I(x, a, b) is inaccurate when a and/or b are large-ish. 
> I've skimmed through [slatec|http://www.netlib.org/slatec/fnlib/betai.f], GSL, [Boost|http://www.boost.org/doc/libs/1_38_0/libs/math/doc/sf_and_dist/html/math_toolkit/special/sf_beta/ibeta_function.html] as well as NR. At first sight, neither uses the same method to compute this function. I think [TOMS-708|http://www.netlib.org/toms/708] is probably the best option.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Comment Edited] (MATH-738) Incomplete beta function I(x, a, b) is inaccurate for large values of a and/or b

Posted by "Sébastien Brisard (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-738?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13500067#comment-13500067 ] 

Sébastien Brisard edited comment on MATH-738 at 11/19/12 7:15 AM:
------------------------------------------------------------------

Starting first with {{Beta.logBeta(double, double)}}, accuracy of the current {{r}} implementation as reported in the users guide is
|| Interval                  || Values tested                                                             || Average error  || Standard deviation  || Maximum error  ||
| 0 < x ≤ 8, 0 < y ≤ 8       | x[i] = i / 32, i = 1, ..., 256, y[j] = j / 32, j = 1, ..., 256     | 5.04 ulps       | 270.99 ulps          | 46696.0 ulps    |
| 0 < x ≤ 8, 8 < y ≤ 16      | x[i] = i / 32, i = 1, ..., 256, y[j] = j / 32, j = 257, ..., 512   | 9.75 ulps       | 149.42 ulps          | 19126.0 ulps    |
| 0 < x ≤ 8, 16 < y ≤ 256    | x[i] = i / 32, i = 1, ..., 256, y[j] = j, j = 17, ..., 256         | 357.82 ulps     | 39297.58 ulps        | 8635522.0 ulps  |
| 8 < x ≤ 16, 8 < y ≤ 16     | x[i] = i / 32, i = 257, ..., 512, y[j] = j / 32, j = 257, ..., 512 | 2.37 ulps       | 13.0 ulps            | 1.9 ulps        |
| 8 < x ≤ 16, 16 < y ≤ 256   | x[i] = i / 32, i = 257, ..., 512, y[j] = j, j = 17, ..., 256       | 10.75 ulps      | 9.74 ulps            | 73.0 ulps       |
| 16 < x ≤ 256, 16 < y ≤ 256 | x[i] = i, i = 17, ..., 256, y[j] = j, j = 17, ..., 256             | 5.20 ulps       | 4.33 ulps            | 53.0 ulps       |

                
      was (Author: celestin):
    Starting first with {{Beta.logBeta(double, double)}}, accuracy of the current {{r}} implementation as reported in the users guide is
|| Interval                  || Values tested                                                             || Average error  || Standard deviation  || Maximum error  ||
| 0 < x ≤ 8, 0 < y ≤ 8       | {{x[i] = i / 32, i = 1, ..., 256}}, {{y[j] = j / 32, j = 1, ..., 256}}     | 5.04 ulps       | 270.99 ulps          | 46696.0 ulps    |
| 0 < x ≤ 8, 8 < y ≤ 16      | {{x[i] = i / 32, i = 1, ..., 256}}, {{y[j] = j / 32, j = 257, ..., 512}}   | 9.75 ulps       | 149.42 ulps          | 19126.0 ulps    |
| 0 < x ≤ 8, 16 < y ≤ 256    | {{x[i] = i / 32, i = 1, ..., 256}}, {{y[j] = j, j = 17, ..., 256}}         | 357.82 ulps     | 39297.58 ulps        | 8635522.0 ulps  |
| 8 < x ≤ 16, 8 < y ≤ 16     | {{x[i] = i / 32, i = 257, ..., 512}}, {{y[j] = j / 32, j = 257, ..., 512}} | 2.37 ulps       | 13.0 ulps            | 1.9 ulps        |
| 8 < x ≤ 16, 16 < y ≤ 256   | {{x[i] = i / 32, i = 257, ..., 512}}, {{y[j] = j, j = 17, ..., 256}}       | 10.75 ulps      | 9.74 ulps            | 73.0 ulps       |
| 16 < x ≤ 256, 16 < y ≤ 256 | {{x[i] = i, i = 17, ..., 256}}, {{y[j] = j, j = 17, ..., 256}}             | 5.20 ulps       | 4.33 ulps            | 53.0 ulps       |

                  
> Incomplete beta function I(x, a, b) is inaccurate for large values of a and/or b
> --------------------------------------------------------------------------------
>
>                 Key: MATH-738
>                 URL: https://issues.apache.org/jira/browse/MATH-738
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 3.0
>            Reporter: Sébastien Brisard
>            Assignee: Sébastien Brisard
>              Labels: special-functions
>             Fix For: 3.1, 4.0
>
>
> This was first reported in MATH-718. The result of the current implementation of the incomplete beta function I(x, a, b) is inaccurate when a and/or b are large-ish. 
> I've skimmed through [slatec|http://www.netlib.org/slatec/fnlib/betai.f], GSL, [Boost|http://www.boost.org/doc/libs/1_38_0/libs/math/doc/sf_and_dist/html/math_toolkit/special/sf_beta/ibeta_function.html] as well as NR. At first sight, neither uses the same method to compute this function. I think [TOMS-708|http://www.netlib.org/toms/708] is probably the best option.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (MATH-738) Incomplete beta function I(x, a, b) is inaccurate for large values of a and/or b

Posted by "Sébastien Brisard (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-738?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13507653#comment-13507653 ] 

Sébastien Brisard commented on MATH-738:
----------------------------------------

In {{r1415853}}, committed new implementation of {{Beta.logBeta(double, double)}}. The accuracy of the new implementation is reported in the table below. This change of the code leads to the deprecation of {{Beta.logBeta(double, double, double, int)}}, as the computation is no longer iterative.

|| Interval                  || Values tested                                                     || Average error  || Standard deviation  || Maximum error  ||
| 0 < x ≤ 8, 0 < y ≤ 8       | x[i] = i / 32, i = 1, ..., 256, y[j] = j / 32, j = 1, ..., 256     | 1.80 ulps       | 81.08 ulps           | 14031.0 ulps    |
| 0 < x ≤ 8, 8 < y ≤ 16      | x[i] = i / 32, i = 1, ..., 256, y[j] = j / 32, j = 257, ..., 512   | 0.50 ulps       | 3.64 ulps            | 694.0 ulps      |
| 0 < x ≤ 8, 16 < y ≤ 256    | x[i] = i / 32, i = 1, ..., 256, y[j] = j, j = 17, ..., 256         | 1.04 ulps       | 139.32 ulps          | 34509.0 ulps    |
| 8 < x ≤ 16, 8 < y ≤ 16     | x[i] = i / 32, i = 257, ..., 512, y[j] = j / 32, j = 257, ..., 512 | 0.35 ulps       | 0.48 ulps            | 2.0 ulps        |
| 8 < x ≤ 16, 16 < y ≤ 256   | x[i] = i / 32, i = 257, ..., 512, y[j] = j, j = 17, ..., 256       | 0.31 ulps       | 0.47 ulps            | 2.0 ulps        |
| 16 < x ≤ 256, 16 < y ≤ 256 | x[i] = i, i = 17, ..., 256, y[j] = j, j = 17, ..., 256             | 0.35 ulps       | 0.49 ulps            | 2.0 ulps        |

                
> Incomplete beta function I(x, a, b) is inaccurate for large values of a and/or b
> --------------------------------------------------------------------------------
>
>                 Key: MATH-738
>                 URL: https://issues.apache.org/jira/browse/MATH-738
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 3.0
>            Reporter: Sébastien Brisard
>            Assignee: Sébastien Brisard
>              Labels: special-functions
>             Fix For: 3.2, 4.0
>
>
> This was first reported in MATH-718. The result of the current implementation of the incomplete beta function I(x, a, b) is inaccurate when a and/or b are large-ish. 
> I've skimmed through [slatec|http://www.netlib.org/slatec/fnlib/betai.f], GSL, [Boost|http://www.boost.org/doc/libs/1_38_0/libs/math/doc/sf_and_dist/html/math_toolkit/special/sf_beta/ibeta_function.html] as well as NR. At first sight, neither uses the same method to compute this function. I think [TOMS-708|http://www.netlib.org/toms/708] is probably the best option.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (MATH-738) Incomplete beta function I(x, a, b) is inaccurate for large values of a and/or b

Posted by "Gilles (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MATH-738?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gilles updated MATH-738:
------------------------

    Fix Version/s:     (was: 3.1)
                   3.2
    
> Incomplete beta function I(x, a, b) is inaccurate for large values of a and/or b
> --------------------------------------------------------------------------------
>
>                 Key: MATH-738
>                 URL: https://issues.apache.org/jira/browse/MATH-738
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 3.0
>            Reporter: Sébastien Brisard
>            Assignee: Sébastien Brisard
>              Labels: special-functions
>             Fix For: 3.2, 4.0
>
>
> This was first reported in MATH-718. The result of the current implementation of the incomplete beta function I(x, a, b) is inaccurate when a and/or b are large-ish. 
> I've skimmed through [slatec|http://www.netlib.org/slatec/fnlib/betai.f], GSL, [Boost|http://www.boost.org/doc/libs/1_38_0/libs/math/doc/sf_and_dist/html/math_toolkit/special/sf_beta/ibeta_function.html] as well as NR. At first sight, neither uses the same method to compute this function. I think [TOMS-708|http://www.netlib.org/toms/708] is probably the best option.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (MATH-738) Incomplete beta function I(x, a, b) is inaccurate for large values of a and/or b

Posted by "Gilles (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MATH-738?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gilles updated MATH-738:
------------------------

    Affects Version/s:     (was: 4.0)
                           (was: 3.1)
                       3.0
        Fix Version/s: 4.0
                       3.1
    
> Incomplete beta function I(x, a, b) is inaccurate for large values of a and/or b
> --------------------------------------------------------------------------------
>
>                 Key: MATH-738
>                 URL: https://issues.apache.org/jira/browse/MATH-738
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 3.0
>            Reporter: Sébastien Brisard
>            Assignee: Sébastien Brisard
>              Labels: special-functions
>             Fix For: 3.1, 4.0
>
>
> This was first reported in MATH-718. The result of the current implementation of the incomplete beta function I(x, a, b) is inaccurate when a and/or b are large-ish. 
> I've skimmed through [slatec|http://www.netlib.org/slatec/fnlib/betai.f], GSL, [Boost|http://www.boost.org/doc/libs/1_38_0/libs/math/doc/sf_and_dist/html/math_toolkit/special/sf_beta/ibeta_function.html] as well as NR. At first sight, neither uses the same method to compute this function. I think [TOMS-708|http://www.netlib.org/toms/708] is probably the best option.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira