Class TestUtils
java.lang.Object
org.apache.commons.math.stat.inference.TestUtils
A collection of static methods to create inference test instances or to
perform inference tests.
The set methods are not compatible with using the class in multiple threads, and have therefore been deprecated (along with the getters). The setters and getters will be removed in version 3.0.
- Since:
- 1.1
-
Method Summary
Modifier and TypeMethodDescriptionstatic doublechiSquare(double[] expected, long[] observed) static doublechiSquare(long[][] counts) static doublechiSquareDataSetsComparison(long[] observed1, long[] observed2) static doublechiSquareTest(double[] expected, long[] observed) static booleanchiSquareTest(double[] expected, long[] observed, double alpha) static doublechiSquareTest(long[][] counts) static booleanchiSquareTest(long[][] counts, double alpha) static doublechiSquareTestDataSetsComparison(long[] observed1, long[] observed2) static booleanchiSquareTestDataSetsComparison(long[] observed1, long[] observed2, double alpha) static ChiSquareTestDeprecated.2.2 will be removed in 3.0static OneWayAnovaDeprecated.2.2 will be removed in 3.0static TTestgetTTest()Deprecated.2.2 will be removed in 3.0Deprecated.2.2 will be removed in 3.0static doublehomoscedasticT(double[] sample1, double[] sample2) static doublehomoscedasticT(StatisticalSummary sampleStats1, StatisticalSummary sampleStats2) static doublehomoscedasticTTest(double[] sample1, double[] sample2) static booleanhomoscedasticTTest(double[] sample1, double[] sample2, double alpha) static doublehomoscedasticTTest(StatisticalSummary sampleStats1, StatisticalSummary sampleStats2) static doubleoneWayAnovaFValue(Collection<double[]> categoryData) static doubleoneWayAnovaPValue(Collection<double[]> categoryData) static booleanoneWayAnovaTest(Collection<double[]> categoryData, double alpha) static doublepairedT(double[] sample1, double[] sample2) static doublepairedTTest(double[] sample1, double[] sample2) static booleanpairedTTest(double[] sample1, double[] sample2, double alpha) static voidsetChiSquareTest(ChiSquareTest chiSquareTest) Deprecated.2.2 will be removed in 3.0 - not compatible with use from multiple threadsstatic voidsetChiSquareTest(TTest chiSquareTest) Deprecated.2.2 will be removed in 3.0 - not compatible with use from multiple threadsstatic voidsetOneWayAnova(OneWayAnova oneWayAnova) Deprecated.2.2 will be removed in 3.0 - not compatible with use from multiple threadsstatic voidsetUnknownDistributionChiSquareTest(UnknownDistributionChiSquareTest unknownDistributionChiSquareTest) Deprecated.2.2 will be removed in 3.0 - not compatible with use from multiple threadsstatic doublet(double[] sample1, double[] sample2) static doublet(double mu, double[] observed) static doublet(double mu, StatisticalSummary sampleStats) static doublet(StatisticalSummary sampleStats1, StatisticalSummary sampleStats2) static doubletTest(double[] sample1, double[] sample2) static booleantTest(double[] sample1, double[] sample2, double alpha) static doubletTest(double mu, double[] sample) static booleantTest(double mu, double[] sample, double alpha) static doubletTest(double mu, StatisticalSummary sampleStats) static booleantTest(double mu, StatisticalSummary sampleStats, double alpha) static doubletTest(StatisticalSummary sampleStats1, StatisticalSummary sampleStats2) static booleantTest(StatisticalSummary sampleStats1, StatisticalSummary sampleStats2, double alpha)
-
Method Details
-
setChiSquareTest
Deprecated.2.2 will be removed in 3.0 - not compatible with use from multiple threadsSet the (singleton) TTest instance.- Parameters:
chiSquareTest- the new instance to use- Since:
- 1.2
-
getTTest
Deprecated.2.2 will be removed in 3.0Return a (singleton) TTest instance. Does not create a new instance.- Returns:
- a TTest instance
-
setChiSquareTest
Deprecated.2.2 will be removed in 3.0 - not compatible with use from multiple threadsSet the (singleton) ChiSquareTest instance.- Parameters:
chiSquareTest- the new instance to use- Since:
- 1.2
-
getChiSquareTest
Deprecated.2.2 will be removed in 3.0Return a (singleton) ChiSquareTest instance. Does not create a new instance.- Returns:
- a ChiSquareTest instance
-
setUnknownDistributionChiSquareTest
@Deprecated public static void setUnknownDistributionChiSquareTest(UnknownDistributionChiSquareTest unknownDistributionChiSquareTest) Deprecated.2.2 will be removed in 3.0 - not compatible with use from multiple threadsSet the (singleton) UnknownDistributionChiSquareTest instance.- Parameters:
unknownDistributionChiSquareTest- the new instance to use- Since:
- 1.2
-
getUnknownDistributionChiSquareTest
Deprecated.2.2 will be removed in 3.0Return a (singleton) UnknownDistributionChiSquareTest instance. Does not create a new instance.- Returns:
- a UnknownDistributionChiSquareTest instance
-
setOneWayAnova
Deprecated.2.2 will be removed in 3.0 - not compatible with use from multiple threadsSet the (singleton) OneWayAnova instance- Parameters:
oneWayAnova- the new instance to use- Since:
- 1.2
-
getOneWayAnova
Deprecated.2.2 will be removed in 3.0Return a (singleton) OneWayAnova instance. Does not create a new instance.- Returns:
- a OneWayAnova instance
- Since:
- 1.2
-
homoscedasticT
public static double homoscedasticT(double[] sample1, double[] sample2) throws IllegalArgumentException - Throws:
IllegalArgumentException- See Also:
-
homoscedasticT
public static double homoscedasticT(StatisticalSummary sampleStats1, StatisticalSummary sampleStats2) throws IllegalArgumentException - Throws:
IllegalArgumentException- See Also:
-
homoscedasticTTest
public static boolean homoscedasticTTest(double[] sample1, double[] sample2, double alpha) throws IllegalArgumentException, MathException - Throws:
IllegalArgumentExceptionMathException- See Also:
-
homoscedasticTTest
public static double homoscedasticTTest(double[] sample1, double[] sample2) throws IllegalArgumentException, MathException - Throws:
IllegalArgumentExceptionMathException- See Also:
-
homoscedasticTTest
public static double homoscedasticTTest(StatisticalSummary sampleStats1, StatisticalSummary sampleStats2) throws IllegalArgumentException, MathException - Throws:
IllegalArgumentExceptionMathException- See Also:
-
pairedT
public static double pairedT(double[] sample1, double[] sample2) throws IllegalArgumentException, MathException - Throws:
IllegalArgumentExceptionMathException- See Also:
-
pairedTTest
public static boolean pairedTTest(double[] sample1, double[] sample2, double alpha) throws IllegalArgumentException, MathException - Throws:
IllegalArgumentExceptionMathException- See Also:
-
pairedTTest
public static double pairedTTest(double[] sample1, double[] sample2) throws IllegalArgumentException, MathException - Throws:
IllegalArgumentExceptionMathException- See Also:
-
t
- Throws:
IllegalArgumentException- See Also:
-
t
- Throws:
IllegalArgumentException- See Also:
-
t
- Throws:
IllegalArgumentException- See Also:
-
t
public static double t(StatisticalSummary sampleStats1, StatisticalSummary sampleStats2) throws IllegalArgumentException - Throws:
IllegalArgumentException- See Also:
-
tTest
public static boolean tTest(double mu, double[] sample, double alpha) throws IllegalArgumentException, MathException - Throws:
IllegalArgumentExceptionMathException- See Also:
-
tTest
public static double tTest(double mu, double[] sample) throws IllegalArgumentException, MathException - Throws:
IllegalArgumentExceptionMathException- See Also:
-
tTest
public static boolean tTest(double mu, StatisticalSummary sampleStats, double alpha) throws IllegalArgumentException, MathException - Throws:
IllegalArgumentExceptionMathException- See Also:
-
tTest
public static double tTest(double mu, StatisticalSummary sampleStats) throws IllegalArgumentException, MathException - Throws:
IllegalArgumentExceptionMathException- See Also:
-
tTest
public static boolean tTest(double[] sample1, double[] sample2, double alpha) throws IllegalArgumentException, MathException - Throws:
IllegalArgumentExceptionMathException- See Also:
-
tTest
public static double tTest(double[] sample1, double[] sample2) throws IllegalArgumentException, MathException - Throws:
IllegalArgumentExceptionMathException- See Also:
-
tTest
public static boolean tTest(StatisticalSummary sampleStats1, StatisticalSummary sampleStats2, double alpha) throws IllegalArgumentException, MathException - Throws:
IllegalArgumentExceptionMathException- See Also:
-
tTest
public static double tTest(StatisticalSummary sampleStats1, StatisticalSummary sampleStats2) throws IllegalArgumentException, MathException - Throws:
IllegalArgumentExceptionMathException- See Also:
-
chiSquare
- Throws:
IllegalArgumentException- See Also:
-
chiSquare
- Throws:
IllegalArgumentException- See Also:
-
chiSquareTest
public static boolean chiSquareTest(double[] expected, long[] observed, double alpha) throws IllegalArgumentException, MathException - Throws:
IllegalArgumentExceptionMathException- See Also:
-
chiSquareTest
public static double chiSquareTest(double[] expected, long[] observed) throws IllegalArgumentException, MathException - Throws:
IllegalArgumentExceptionMathException- See Also:
-
chiSquareTest
public static boolean chiSquareTest(long[][] counts, double alpha) throws IllegalArgumentException, MathException - Throws:
IllegalArgumentExceptionMathException- See Also:
-
chiSquareTest
- Throws:
IllegalArgumentExceptionMathException- See Also:
-
chiSquareDataSetsComparison
public static double chiSquareDataSetsComparison(long[] observed1, long[] observed2) throws IllegalArgumentException - Throws:
IllegalArgumentException- Since:
- 1.2
- See Also:
-
chiSquareTestDataSetsComparison
public static double chiSquareTestDataSetsComparison(long[] observed1, long[] observed2) throws IllegalArgumentException, MathException - Throws:
IllegalArgumentExceptionMathException- Since:
- 1.2
- See Also:
-
chiSquareTestDataSetsComparison
public static boolean chiSquareTestDataSetsComparison(long[] observed1, long[] observed2, double alpha) throws IllegalArgumentException, MathException - Throws:
IllegalArgumentExceptionMathException- Since:
- 1.2
- See Also:
-
oneWayAnovaFValue
public static double oneWayAnovaFValue(Collection<double[]> categoryData) throws IllegalArgumentException, MathException - Throws:
IllegalArgumentExceptionMathException- Since:
- 1.2
- See Also:
-
oneWayAnovaPValue
public static double oneWayAnovaPValue(Collection<double[]> categoryData) throws IllegalArgumentException, MathException - Throws:
IllegalArgumentExceptionMathException- Since:
- 1.2
- See Also:
-
oneWayAnovaTest
public static boolean oneWayAnovaTest(Collection<double[]> categoryData, double alpha) throws IllegalArgumentException, MathException - Throws:
IllegalArgumentExceptionMathException- Since:
- 1.2
- See Also:
-