public class DistributionTest
extends java.lang.Object
Constructor and Description |
---|
DistributionTest() |
Modifier and Type | Method and Description |
---|---|
static double[] |
ansari_bradley_test(double[] x,
double[] y,
boolean force_exact)
Return the two-sided test of Ansari-Bradley.
|
static double[] |
ansari_bradley_test(double[] x,
double[] y,
boolean force_exact,
TestKind kind)
Ansari-Bradley test.
|
static double[] |
bartlett_test(double[] x,
int[] group)
Bartlett's test
|
static double[] |
binomial_test(int n_success,
int n,
double p,
TestKind kind)
Binomial test
|
static double[] |
diptest_presorted(double[] x)
Perform Hartigan's dip test, assuming the minimum test statistics D is zero.
|
static double[] |
diptest(double[] x)
Perform Hartigan's dip test, assuming the minimum test statistics D is zero.
|
static double[] |
fligner_test(double[] x,
int[] group)
Fligner-Killeen test
|
static double[] |
kolmogorov_smirnov_test(double[] X,
double[] Y)
Compute the Kolmogorov-Smirnov test to test between two distribution, two-sided, exact p-value.
|
static double[] |
kolmogorov_smirnov_test(double[] X,
double[] Y,
boolean isExact)
Compute the Kolmogorov-Smirnov test to test between two distribution, two-sided.
|
static double[] |
kolmogorov_smirnov_test(double[] X,
double[] Y,
TestKind kind)
Compute the Kolmogorov-Smirnov test to test between two distribution, exact p-value.
|
static double[] |
kolmogorov_smirnov_test(double[] X,
double[] Y,
TestKind kind,
boolean isExact)
Compute the Kolmogorov-Smirnov test to test between two distribution.
|
static double[] |
kolmogorov_smirnov_test(double[] X,
GenericDistribution dist)
Compute the Kolmogorov-Smirnov test to test between X and a known reference distribution, two-sided, exact p-value.
|
static double[] |
kolmogorov_smirnov_test(double[] X,
GenericDistribution dist,
boolean isExact)
Compute the Kolmogorov-Smirnov test to test between X and a known reference distribution, two-sided.
|
static double[] |
kolmogorov_smirnov_test(double[] X,
GenericDistribution dist,
TestKind kind)
Compute the Kolmogorov-Smirnov test to test between X and a known reference distribution, exact p-value.
|
static double[] |
kolmogorov_smirnov_test(double[] X,
GenericDistribution dist,
TestKind kind,
boolean isExact)
Compute the Kolmogorov-Smirnov test to test between X and a known reference distribution.
|
static double[] |
kruskal_wallis_test(double[] x,
int[] group)
Kruskal-Wallis test
|
static void |
main(java.lang.String[] args) |
static double[] |
mann_whitney_u_test(double[] x,
double[] y,
double mu,
boolean correction,
boolean paired,
TestKind kind)
Mann-Whitney-U test
|
static double[] |
mood_test(double[] x,
double[] y)
Performs Mood's two-sample test for a difference in scale parameters.
|
static double[] |
mood_test(double[] x,
double[] y,
TestKind kind)
Performs Mood's two-sample test for a difference in scale parameters.
|
static double[] |
poisson_test(int num_events,
double time,
double rate,
TestKind kind)
Performs an exact test of a simple null hypothesis about the rate parameter in Poisson distribution
|
static double[] |
poisson_test(int num_events1,
int num_events2,
double time1,
double time2,
double r,
TestKind kind)
Comparison of Poisson rates
|
static double[] |
t_test_paired(double[] x,
double[] y,
double mu,
TestKind kind)
Paired t-test
|
static double[] |
t_test(double[] x,
double[] y,
double mu,
boolean pool_var,
TestKind kind)
Two sample t-test
|
static double[] |
t_test(double[] x,
double mu,
TestKind kind)
One-sample t-test
|
static double[] |
var_test(double[] x,
double[] y,
double ratio,
TestKind kind)
Performs an F test to compare the variances of two samples from normal populations.
|
static double[] |
var_test(double[] x,
double[] y,
TestKind kind)
Performs an F test to compare the variances of two samples from normal populations.
|
static double[] |
wilcoxon_test(double[] x,
double mu,
boolean correction,
TestKind kind)
One-sample Wilcoxon test.
|
public static final double[] kolmogorov_smirnov_test(double[] X, double[] Y)
X
- an array with length of nXY
- an array with length of nYpublic static final double[] kolmogorov_smirnov_test(double[] X, double[] Y, boolean isExact)
X
- an array with length of nXY
- an array with length of nYisExact
- whether the p-value should be computed with the exact method or not (takes a long time). If there are ties, this option is ignored.public static final double[] kolmogorov_smirnov_test(double[] X, double[] Y, TestKind kind)
X
- an array with length of nXY
- an array with length of nYkind
- the kind of test {LOWER, GREATER, TWO_SIDED}public static final double[] kolmogorov_smirnov_test(double[] X, double[] Y, TestKind kind, boolean isExact)
X
- an array with length of nXY
- an array with length of nYkind
- the kind of test {LOWER, GREATER, TWO_SIDED}isExact
- whether the p-value should be computed with the exact method or not (takes a long time). If there are ties, this option is ignored.public static final double[] kolmogorov_smirnov_test(double[] X, GenericDistribution dist)
X
- an array with length of nXdist
- reference distributionpublic static final double[] kolmogorov_smirnov_test(double[] X, GenericDistribution dist, TestKind kind)
X
- an array with length of nXdist
- reference distributionkind
- the kind of test {LOWER, GREATER, TWO_SIDED}public static final double[] kolmogorov_smirnov_test(double[] X, GenericDistribution dist, boolean isExact)
X
- an array with length of nXdist
- reference distributionisExact
- whether the p-value should be computed with the exact method or not (takes a long time). If there are ties, this option is ignored.public static final double[] kolmogorov_smirnov_test(double[] X, GenericDistribution dist, TestKind kind, boolean isExact)
X
- an array with length of nXdist
- reference distributionkind
- the kind of test {LOWER, GREATER, TWO_SIDED}isExact
- whether the p-value should be computed with the exact method or not (takes a long time). If there are ties, this option is ignored.public static final double[] ansari_bradley_test(double[] x, double[] y, boolean force_exact)
x
- the original xy
- the original yforce_exact
- Set to true if you want exact answer. The default behavior is that
if there are ties or either the length of x or the length of y is at least 50.public static final double[] ansari_bradley_test(double[] x, double[] y, boolean force_exact, TestKind kind)
x
- the original xy
- the original yforce_exact
- Set to true if you want exact answer. The default behavior is that
if there are ties or either the length of x or the length of y is at least 50.kind
- the kind of test {LOWER, GREATER, TWO_SIDED}public static final double[] mood_test(double[] x, double[] y)
x
- y
- public static final double[] mood_test(double[] x, double[] y, TestKind kind)
x
- y
- kind
- the kind of test {LOWER, GREATER, TWO_SIDED}public static final double[] var_test(double[] x, double[] y, TestKind kind)
x
- y
- kind
- the kind of test {LOWER, GREATER, TWO_SIDED}public static final double[] var_test(double[] x, double[] y, double ratio, TestKind kind)
x
- y
- ratio
- the hypothesized ratio of the population variances of x and y.kind
- the kind of test {LOWER, GREATER, TWO_SIDED}public static final double[] wilcoxon_test(double[] x, double mu, boolean correction, TestKind kind)
x
- mu
- correction
- set to true if continuity correction is desired. Only matters
if x has zeroes or tieskind
- the kind of test {LOWER, GREATER, TWO_SIDED}public static final double[] mann_whitney_u_test(double[] x, double[] y, double mu, boolean correction, boolean paired, TestKind kind)
x
- y
- mu
- correction
- set to true if continuity correction is desired. Only matters
then there are tiespaired
- set to true for paired test (which reduces to Wilcoxon test)kind
- the kind of test {LOWER, GREATER, TWO_SIDED}public static final double[] t_test(double[] x, double mu, TestKind kind)
x
- mu
- kind
- the kind of test {LOWER, GREATER, TWO_SIDED}public static final double[] t_test_paired(double[] x, double[] y, double mu, TestKind kind)
x
- y
- mu
- kind
- the kind of test {LOWER, GREATER, TWO_SIDED}public static final double[] t_test(double[] x, double[] y, double mu, boolean pool_var, TestKind kind)
x
- y
- mu
- pool_var
- set to true if the variance should be pooled. Only matters when paired == falsekind
- the kind of test {LOWER, GREATER, TWO_SIDED}public static final double[] binomial_test(int n_success, int n, double p, TestKind kind)
n_success
- The number of successesn
- The total number of trialsp
- Expected probabilitykind
- the kind of test {LOWER, GREATER, TWO_SIDED}public static final double[] bartlett_test(double[] x, int[] group)
x
- group
- an array of group indices. Observation in x that belongs in the same group must have the same index.public static final double[] fligner_test(double[] x, int[] group)
x
- group
- an array of group indices. Observation in x that belongs in the same group must have the same index.public static final double[] kruskal_wallis_test(double[] x, int[] group)
x
- group
- an array of group indices. Observation in x that belongs in the same group must have the same index.public static final double[] poisson_test(int num_events, double time, double rate, TestKind kind)
num_events
- number of events.time
- time base for event count.rate
- hypothesized ratekind
- the kind of test {LOWER, GREATER, TWO_SIDED}public static final double[] poisson_test(int num_events1, int num_events2, double time1, double time2, double r, TestKind kind)
num_events1
- number of events for the treatment.num_events2
- number of events for control.time1
- time base for event count for treatment.time2
- time base for event count for control.kind
- the kind of test {LOWER, GREATER, TWO_SIDED}public static final double[] diptest(double[] x)
x
- Can be of any order. If x is already sorted, use diptest_presorted to save some time.public static final double[] diptest_presorted(double[] x)
x
- MUST BE SORTED in order to output the right result. This routine will NOT check for order!public static final void main(java.lang.String[] args)