Class TestUtils
- java.lang.Object
-
- org.apache.commons.math.stat.inference.TestUtils
-
public class TestUtils extends Object
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
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static double
chiSquare(double[] expected, long[] observed)
static double
chiSquare(long[][] counts)
static double
chiSquareDataSetsComparison(long[] observed1, long[] observed2)
static double
chiSquareTest(double[] expected, long[] observed)
static boolean
chiSquareTest(double[] expected, long[] observed, double alpha)
static double
chiSquareTest(long[][] counts)
static boolean
chiSquareTest(long[][] counts, double alpha)
static double
chiSquareTestDataSetsComparison(long[] observed1, long[] observed2)
static boolean
chiSquareTestDataSetsComparison(long[] observed1, long[] observed2, double alpha)
static ChiSquareTest
getChiSquareTest()
Deprecated.2.2 will be removed in 3.0static OneWayAnova
getOneWayAnova()
Deprecated.2.2 will be removed in 3.0static TTest
getTTest()
Deprecated.2.2 will be removed in 3.0static UnknownDistributionChiSquareTest
getUnknownDistributionChiSquareTest()
Deprecated.2.2 will be removed in 3.0static double
homoscedasticT(double[] sample1, double[] sample2)
static double
homoscedasticT(StatisticalSummary sampleStats1, StatisticalSummary sampleStats2)
static double
homoscedasticTTest(double[] sample1, double[] sample2)
static boolean
homoscedasticTTest(double[] sample1, double[] sample2, double alpha)
static double
homoscedasticTTest(StatisticalSummary sampleStats1, StatisticalSummary sampleStats2)
static double
oneWayAnovaFValue(Collection<double[]> categoryData)
static double
oneWayAnovaPValue(Collection<double[]> categoryData)
static boolean
oneWayAnovaTest(Collection<double[]> categoryData, double alpha)
static double
pairedT(double[] sample1, double[] sample2)
static double
pairedTTest(double[] sample1, double[] sample2)
static boolean
pairedTTest(double[] sample1, double[] sample2, double alpha)
static void
setChiSquareTest(ChiSquareTest chiSquareTest)
Deprecated.2.2 will be removed in 3.0 - not compatible with use from multiple threadsstatic void
setChiSquareTest(TTest chiSquareTest)
Deprecated.2.2 will be removed in 3.0 - not compatible with use from multiple threadsstatic void
setOneWayAnova(OneWayAnova oneWayAnova)
Deprecated.2.2 will be removed in 3.0 - not compatible with use from multiple threadsstatic void
setUnknownDistributionChiSquareTest(UnknownDistributionChiSquareTest unknownDistributionChiSquareTest)
Deprecated.2.2 will be removed in 3.0 - not compatible with use from multiple threadsstatic double
t(double[] sample1, double[] sample2)
static double
t(double mu, double[] observed)
static double
t(double mu, StatisticalSummary sampleStats)
static double
t(StatisticalSummary sampleStats1, StatisticalSummary sampleStats2)
static double
tTest(double[] sample1, double[] sample2)
static boolean
tTest(double[] sample1, double[] sample2, double alpha)
static double
tTest(double mu, double[] sample)
static boolean
tTest(double mu, double[] sample, double alpha)
static double
tTest(double mu, StatisticalSummary sampleStats)
static boolean
tTest(double mu, StatisticalSummary sampleStats, double alpha)
static double
tTest(StatisticalSummary sampleStats1, StatisticalSummary sampleStats2)
static boolean
tTest(StatisticalSummary sampleStats1, StatisticalSummary sampleStats2, double alpha)
-
-
-
Method Detail
-
setChiSquareTest
@Deprecated public static void setChiSquareTest(TTest chiSquareTest)
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 public static TTest 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 public static void setChiSquareTest(ChiSquareTest chiSquareTest)
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 public static ChiSquareTest 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 public static UnknownDistributionChiSquareTest 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 public static void setOneWayAnova(OneWayAnova oneWayAnova)
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 public static OneWayAnova 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:
TTest.homoscedasticT(double[], double[])
-
homoscedasticT
public static double homoscedasticT(StatisticalSummary sampleStats1, StatisticalSummary sampleStats2) throws IllegalArgumentException
-
homoscedasticTTest
public static boolean homoscedasticTTest(double[] sample1, double[] sample2, double alpha) throws IllegalArgumentException, MathException
-
homoscedasticTTest
public static double homoscedasticTTest(double[] sample1, double[] sample2) throws IllegalArgumentException, MathException
-
homoscedasticTTest
public static double homoscedasticTTest(StatisticalSummary sampleStats1, StatisticalSummary sampleStats2) throws IllegalArgumentException, MathException
-
pairedT
public static double pairedT(double[] sample1, double[] sample2) throws IllegalArgumentException, MathException
- Throws:
IllegalArgumentException
MathException
- See Also:
TTest.pairedT(double[], double[])
-
pairedTTest
public static boolean pairedTTest(double[] sample1, double[] sample2, double alpha) throws IllegalArgumentException, MathException
-
pairedTTest
public static double pairedTTest(double[] sample1, double[] sample2) throws IllegalArgumentException, MathException
- Throws:
IllegalArgumentException
MathException
- See Also:
TTest.pairedTTest(double[], double[])
-
t
public static double t(double mu, double[] observed) throws IllegalArgumentException
- Throws:
IllegalArgumentException
- See Also:
TTest.t(double, double[])
-
t
public static double t(double mu, StatisticalSummary sampleStats) throws IllegalArgumentException
-
t
public static double t(double[] sample1, double[] sample2) throws IllegalArgumentException
- Throws:
IllegalArgumentException
- See Also:
TTest.t(double[], double[])
-
t
public static double t(StatisticalSummary sampleStats1, StatisticalSummary sampleStats2) throws IllegalArgumentException
-
tTest
public static boolean tTest(double mu, double[] sample, double alpha) throws IllegalArgumentException, MathException
- Throws:
IllegalArgumentException
MathException
- See Also:
TTest.tTest(double, double[], double)
-
tTest
public static double tTest(double mu, double[] sample) throws IllegalArgumentException, MathException
- Throws:
IllegalArgumentException
MathException
- See Also:
TTest.tTest(double, double[])
-
tTest
public static boolean tTest(double mu, StatisticalSummary sampleStats, double alpha) throws IllegalArgumentException, MathException
-
tTest
public static double tTest(double mu, StatisticalSummary sampleStats) throws IllegalArgumentException, MathException
-
tTest
public static boolean tTest(double[] sample1, double[] sample2, double alpha) throws IllegalArgumentException, MathException
- Throws:
IllegalArgumentException
MathException
- See Also:
TTest.tTest(double[], double[], double)
-
tTest
public static double tTest(double[] sample1, double[] sample2) throws IllegalArgumentException, MathException
- Throws:
IllegalArgumentException
MathException
- See Also:
TTest.tTest(double[], double[])
-
tTest
public static boolean tTest(StatisticalSummary sampleStats1, StatisticalSummary sampleStats2, double alpha) throws IllegalArgumentException, MathException
-
tTest
public static double tTest(StatisticalSummary sampleStats1, StatisticalSummary sampleStats2) throws IllegalArgumentException, MathException
-
chiSquare
public static double chiSquare(double[] expected, long[] observed) throws IllegalArgumentException
- Throws:
IllegalArgumentException
- See Also:
ChiSquareTest.chiSquare(double[], long[])
-
chiSquare
public static double chiSquare(long[][] counts) throws IllegalArgumentException
- Throws:
IllegalArgumentException
- See Also:
ChiSquareTest.chiSquare(long[][])
-
chiSquareTest
public static boolean chiSquareTest(double[] expected, long[] observed, double alpha) throws IllegalArgumentException, MathException
-
chiSquareTest
public static double chiSquareTest(double[] expected, long[] observed) throws IllegalArgumentException, MathException
-
chiSquareTest
public static boolean chiSquareTest(long[][] counts, double alpha) throws IllegalArgumentException, MathException
-
chiSquareTest
public static double chiSquareTest(long[][] counts) throws IllegalArgumentException, MathException
- Throws:
IllegalArgumentException
MathException
- See Also:
ChiSquareTest.chiSquareTest(long[][])
-
chiSquareDataSetsComparison
public static double chiSquareDataSetsComparison(long[] observed1, long[] observed2) throws IllegalArgumentException
- Throws:
IllegalArgumentException
- Since:
- 1.2
- See Also:
UnknownDistributionChiSquareTest.chiSquareDataSetsComparison(long[], long[])
-
chiSquareTestDataSetsComparison
public static double chiSquareTestDataSetsComparison(long[] observed1, long[] observed2) throws IllegalArgumentException, MathException
- Throws:
IllegalArgumentException
MathException
- Since:
- 1.2
- See Also:
UnknownDistributionChiSquareTest.chiSquareTestDataSetsComparison(long[], long[])
-
chiSquareTestDataSetsComparison
public static boolean chiSquareTestDataSetsComparison(long[] observed1, long[] observed2, double alpha) throws IllegalArgumentException, MathException
-
oneWayAnovaFValue
public static double oneWayAnovaFValue(Collection<double[]> categoryData) throws IllegalArgumentException, MathException
- Throws:
IllegalArgumentException
MathException
- Since:
- 1.2
- See Also:
OneWayAnova.anovaFValue(Collection)
-
oneWayAnovaPValue
public static double oneWayAnovaPValue(Collection<double[]> categoryData) throws IllegalArgumentException, MathException
- Throws:
IllegalArgumentException
MathException
- Since:
- 1.2
- See Also:
OneWayAnova.anovaPValue(Collection)
-
oneWayAnovaTest
public static boolean oneWayAnovaTest(Collection<double[]> categoryData, double alpha) throws IllegalArgumentException, MathException
- Throws:
IllegalArgumentException
MathException
- Since:
- 1.2
- See Also:
OneWayAnova.anovaTest(Collection,double)
-
-