CanvasClean.CanvasClean.SignificantlyDifferent C# (CSharp) Метод

SignificantlyDifferent() статический приватный Метод

Determine if two Poisson counts are unlikely to have come from the same distribution.
static private SignificantlyDifferent ( float a, float b ) : bool
a float First count to compare.
b float Second count to compare.
Результат bool
        static bool SignificantlyDifferent(float a, float b)
        {
            double mu = ((double)a + (double)b) / 2;

            if (a + b == 0)
                return false;

            // Calculate Chi-Squared statistic
            double da = (double)a - mu;
            double db = (double)b - mu;
            double chi2 = (da * da + db * db) / mu;

            // Is Chi-Squared greater than the 99th percentile of the Chi-Squared distribution with 1 degree of fredom?
            if (chi2 > 6.635)
                return true;

            return false;
        }