From e0e7292324604478142c2596507b45967e65244a Mon Sep 17 00:00:00 2001 From: bbieniek Date: Tue, 17 Feb 2015 15:58:20 +0100 Subject: [PATCH] When DF parameter was high, the CDF returned NaN value. This was resolved by using the GammaLowerRegularized function straight from the CDF instead of division and multipliciation by Gamma function. --- src/Numerics/Distributions/ChiSquared.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Numerics/Distributions/ChiSquared.cs b/src/Numerics/Distributions/ChiSquared.cs index 53a2a7ba..4076a090 100644 --- a/src/Numerics/Distributions/ChiSquared.cs +++ b/src/Numerics/Distributions/ChiSquared.cs @@ -356,7 +356,7 @@ namespace MathNet.Numerics.Distributions throw new ArgumentException(Resources.InvalidDistributionParameters); } - return SpecialFunctions.GammaLowerIncomplete(freedom/2.0, x/2.0)/SpecialFunctions.Gamma(freedom/2.0); + return SpecialFunctions.GammaLowerRegularized(freedom/2.0, x/2.0); } ///