Browse Source

Distributions: increase Brent root-finder accuracy in Beta, F and Student-T inverse CDF to adapt to fixed Brent behavior

cuda
Christoph Ruegg 12 years ago
parent
commit
52c6379cc4
  1. 2
      src/Numerics/Distributions/Beta.cs
  2. 2
      src/Numerics/Distributions/FisherSnedecor.cs
  3. 2
      src/Numerics/Distributions/StudentT.cs

2
src/Numerics/Distributions/Beta.cs

@ -653,7 +653,7 @@ namespace MathNet.Numerics.Distributions
throw new ArgumentException(Resources.InvalidDistributionParameters);
}
return Brent.FindRoot(x => SpecialFunctions.BetaRegularized(a, b, x) - p, 0.0, 1.0, accuracy: 1e-8);
return Brent.FindRoot(x => SpecialFunctions.BetaRegularized(a, b, x) - p, 0.0, 1.0, accuracy: 1e-12);
}
/// <summary>

2
src/Numerics/Distributions/FisherSnedecor.cs

@ -406,7 +406,7 @@ namespace MathNet.Numerics.Distributions
return Brent.FindRoot(
x => SpecialFunctions.BetaRegularized(d1/2.0, d2/2.0, d1*x/(d1*x + d2)) - p,
0, 1000, accuracy: 1e-8);
0, 1000, accuracy: 1e-12);
}
/// <summary>

2
src/Numerics/Distributions/StudentT.cs

@ -510,7 +510,7 @@ namespace MathNet.Numerics.Distributions
var h = freedom/(freedom + (k*k));
var ib = 0.5*SpecialFunctions.BetaRegularized(freedom/2.0, 0.5, h);
return x <= location ? ib - p : 1.0 - ib - p;
}, -800, 800, accuracy: 1e-8);
}, -800, 800, accuracy: 1e-12);
}
/// <summary>

Loading…
Cancel
Save