# SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.stats.test.distribution.pearson

## Class FisherExactDistribution

• All Implemented Interfaces:
ProbabilityDistribution

public class FisherExactDistribution
extends EmpiricalDistribution
Fisher's exact test distribution is, as its name states, exact, and can therefore be used regardless of the sample characteristics. It converges asymptotically to Chi-square distribution for a large and well balanced sample. For a set of small, sparse, or unbalanced data, the exact and asymptotic p-values can be quite different and may lead to opposite conclusions concerning the hypothesis of interest. The exact distribution becomes difficult to calculate with large samples or well-balanced tables, but fortunately these are precisely the conditions where the chi-square distribution is appropriate.
Wikipedia: Fisher's exact test
• ### Constructor Summary

Constructors
Constructor and Description
FisherExactDistribution(int[] rowSums, int[] colSums, int nSims)
Construct the distribution for Fisher's exact test.
FisherExactDistribution(int[] rowSums, int[] colSums, int nSims, RandomLongGenerator uniform)
Construct the distribution for Fisher's exact test.

• ### Methods inherited from class com.numericalmethod.suanshu.stats.distribution.univariate.EmpiricalDistribution

cdf, density, entropy, kurtosis, mean, median, moment, nSamples, quantile, skew, toArray, variance
• ### Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
• ### Constructor Detail

• #### FisherExactDistribution

public FisherExactDistribution(int[] rowSums,
int[] colSums,
int nSims,
RandomLongGenerator uniform)
Construct the distribution for Fisher's exact test.
Parameters:
rowSums - the row totals
colSums - the column totals
nSims - the number of simulations
uniform - a uniform random number generator
• #### FisherExactDistribution

public FisherExactDistribution(int[] rowSums,
int[] colSums,
int nSims)
Construct the distribution for Fisher's exact test.
Parameters:
rowSums - the row totals
colSums - the column totals
nSims - the number of simulations