Accord.Statistics.Testing.BowkerTest.BowkerTest C# (CSharp) Method

BowkerTest() public method

Creates a new Bowker test.
public BowkerTest ( GeneralConfusionMatrix matrix ) : System
matrix Accord.Statistics.Analysis.GeneralConfusionMatrix The contingency table to test.
return System
        public BowkerTest(GeneralConfusionMatrix matrix)
        {
            int classes = matrix.Classes;
            int[,] n = matrix.Matrix;

            double Qb = 0;

            for (int j = 0; j < classes; j++)
            {
                for (int i = 0; i < j; i++)
                {
                    double q = (n[i, j] - n[j, i]);
                    Qb += (q * q) / (n[i, j] + n[j, i]);
                }
            }

            int df = (classes * (classes - 1)) / 2;

            Compute(Qb, df);
        }
BowkerTest