Browse Source

BetaRegularized Fix - Issue 491 (#497)

* BetaRegularize Fix Issue 491

Changed the number of iterations for the loop from 140 to 100,000. This
brought the result from
MathNet.Numerics.SpecialFunctions.BetaRegularized(6985172036240.918,
5029323866093.4609, 0.581395348837209); to 0.5101 which is inline with
the results in R(0.5) and Mathematica(0.495).
pull/473/merge
Elias Abou Jaoude 9 years ago
committed by Christoph Ruegg
parent
commit
944ea5f0b9
  1. 2
      src/Numerics/SpecialFunctions/Beta.cs

2
src/Numerics/SpecialFunctions/Beta.cs

@ -146,7 +146,7 @@ namespace MathNet.Numerics
d = 1.0/d;
var h = d;
for (int m = 1, m2 = 2; m <= 140; m++, m2 += 2)
for (int m = 1, m2 = 2; m <= 50000; m++, m2 += 2)
{
var aa = m*(b - m)*x/((qam + m2)*(a + m2));
d = 1.0 + (aa*d);

Loading…
Cancel
Save