MultinomialTest Class 
Namespace: Accord.Statistics.Testing
The MultinomialTest type exposes the following members.
Name  Description  

MultinomialTest(Int32) 
Creates a new Multinomial test.
 
MultinomialTest(Double, Int32) 
Creates a new Multinomial test.
 
MultinomialTest(Int32, Double) 
Creates a new Multinomial test.
 
MultinomialTest(Int32, Int32) 
Creates a new Multinomial test.
 
MultinomialTest(Double, Int32, Double) 
Creates a new Multinomial test.
 
MultinomialTest(Int32, Int32, Double) 
Creates a new Multinomial test.

Name  Description  

CriticalValue 
Gets the critical value for the current significance level.
(Inherited from HypothesisTestTDistribution.)  
DegreesOfFreedom 
Gets the degrees of freedom for the ChiSquare distribution.
(Inherited from ChiSquareTest.)  
HypothesizedProportions 
Gets the hypothesized population proportions.
 
ObservedProportions 
Gets the observed sample proportions.
 
PValue 
Gets the Pvalue associated with this test.
(Inherited from HypothesisTestTDistribution.)  
Significant 
Gets whether the null hypothesis should be rejected.
(Inherited from HypothesisTestTDistribution.)  
Size 
Gets the significance level for the
test. Default value is 0.05 (5%).
(Inherited from HypothesisTestTDistribution.)  
Statistic 
Gets the test statistic.
(Inherited from HypothesisTestTDistribution.)  
StatisticDistribution 
Gets the distribution associated
with the test statistic.
(Inherited from HypothesisTestTDistribution.)  
Tail 
Gets the test type.
(Inherited from HypothesisTestTDistribution.) 
Name  Description  

Compute(Double, Int32) 
Computes the ChiSquare Test.
(Inherited from ChiSquareTest.)  
Compute(Int32, Double, Double) 
Computes the Multinomial test.
 
Equals  Determines whether the specified object is equal to the current object. (Inherited from Object.)  
Finalize  Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)  
GetHashCode  Serves as the default hash function. (Inherited from Object.)  
GetType  Gets the Type of the current instance. (Inherited from Object.)  
MemberwiseClone  Creates a shallow copy of the current Object. (Inherited from Object.)  
OnSizeChanged 
Called whenever the test significance level changes.
(Inherited from HypothesisTestTDistribution.)  
PValueToStatistic 
Converts a given pvalue to a test statistic.
(Inherited from ChiSquareTest.)  
StatisticToPValue 
Converts a given test statistic to a pvalue.
(Inherited from ChiSquareTest.)  
ToString 
Converts the numeric PValue of this test to its equivalent string representation.
(Inherited from HypothesisTestTDistribution.)  
ToString(String, IFormatProvider) 
Converts the numeric PValue of this test to its equivalent string representation.
(Inherited from HypothesisTestTDistribution.) 
Name  Description  

HasMethod 
Checks whether an object implements a method with the given name.
(Defined by ExtensionMethods.)  
IsEqual  Compares two objects for equality, performing an elementwise comparison if the elements are vectors or matrices. (Defined by Matrix.)  
ToT  Overloaded.
Converts an object into another type, irrespective of whether
the conversion can be done at compile time or not. This can be
used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.)  
ToT  Overloaded.
Converts an object into another type, irrespective of whether
the conversion can be done at compile time or not. This can be
used to convert generic types to numeric types during runtime.
(Defined by Matrix.) 
In statistics, the multinomial test is the test of the null hypothesis that the parameters of a multinomial distribution equal specified values. The test can be approximated using a chisquare distribution.
References:
The following example is based on the example available on About.com Statistics, An Example of ChiSquare Test for a Multinomial Experiment By Courtney Taylor.
In this example, we would like to test if a die is fair. For this, we will be rolling the die 600 times, annotating the result every time the die falls. In the end, we got a one 106 times, a two 90 times, a three 98 times, a four 102 times, a five 100 times and a six 104 times:
int[] sample = { 106, 90, 98, 102, 100, 104 }; // If the die was fair, we should note that we would be expecting the // probabilities to be all equal to 1 / 6: double[] hypothesizedProportion = { // 1 2 3 4 5 6 1 / 6.0, 1 / 6.0, 1 / 6.0, 1 / 6.0, 1 / 6.0, 1 / 6.0, }; // Now, we create our test using the samples and the expected proportion MultinomialTest test = new MultinomialTest(sample, hypothesizedProportion); double chiSquare = test.Statistic; // 1.6 bool significant = test.Significant; // false
Since the test didn't come up significant, it means that we don't have enough evidence to to reject the null hypothesis that the die is fair.