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

MultinomialTest() public method

Creates a new Multinomial test.
public MultinomialTest ( int sampleCounts ) : System
sampleCounts int The number of occurrences for each category in the sample.
return System
        public MultinomialTest(int[] sampleCounts)
        {
            double[] hypothesizedProportions = new double[sampleCounts.Length];
            for (int i = 0; i < hypothesizedProportions.Length; i++)
                hypothesizedProportions[i] = 1.0 / hypothesizedProportions.Length;

            int sampleSize = sampleCounts.Sum();
            double[] sampleProportions = sampleCounts.Divide(sampleSize);

            Compute(sampleSize, sampleProportions, hypothesizedProportions);
        }

Same methods

MultinomialTest::MultinomialTest ( double sampleProportions, int sampleSize ) : System
MultinomialTest::MultinomialTest ( double sampleProportions, int sampleSize, double hypothesizedProportions ) : System
MultinomialTest::MultinomialTest ( int sampleCounts, double hypothesizedProportions ) : System
MultinomialTest::MultinomialTest ( int sample, int categories ) : System
MultinomialTest::MultinomialTest ( int sample, int categories, double hypothesizedProportions ) : System