Remove trailing spaces.
This commit is contained in:
parent
ce98d00852
commit
941b13f8ed
|
@ -181,7 +181,7 @@ public class GTestTest {
|
|||
// expected
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testUnmatchedArrays() {
|
||||
final long[] observed = { 0, 1, 2, 3 };
|
||||
|
@ -200,7 +200,7 @@ public class GTestTest {
|
|||
// expected
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testNegativeObservedCounts() {
|
||||
final long[] observed = { 0, 1, 2, -3 };
|
||||
|
@ -217,9 +217,9 @@ public class GTestTest {
|
|||
Assert.fail("negative observed count, NotPositiveException expected");
|
||||
} catch (NotPositiveException ex) {
|
||||
// expected
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testZeroExpectedCounts() {
|
||||
final long[] observed = { 0, 1, 2, -3 };
|
||||
|
@ -231,7 +231,7 @@ public class GTestTest {
|
|||
// expected
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testBadAlpha() {
|
||||
final long[] observed = { 0, 1, 2, 3 };
|
||||
|
@ -248,9 +248,9 @@ public class GTestTest {
|
|||
Assert.fail("zero expected count, NotStrictlyPositiveException expected");
|
||||
} catch (OutOfRangeException ex) {
|
||||
// expected
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testScaling() {
|
||||
final long[] observed = {9, 11, 10, 8, 12};
|
||||
|
|
|
@ -38,11 +38,11 @@ public class MannWhitneyUTestTest {
|
|||
* x <- c(19, 22, 16, 29, 24)
|
||||
* y <- c(20, 11, 17, 12)
|
||||
* wilcox.test(x, y, alternative = "two.sided", mu = 0, paired = FALSE, exact = FALSE, correct = FALSE)
|
||||
* W = 17, p-value = 0.08641
|
||||
* W = 17, p-value = 0.08641
|
||||
*/
|
||||
final double x[] = {19, 22, 16, 29, 24};
|
||||
final double y[] = {20, 11, 17, 12};
|
||||
|
||||
|
||||
Assert.assertEquals(17, testStatistic.mannWhitneyU(x, y), 1e-10);
|
||||
Assert.assertEquals(0.08641, testStatistic.mannWhitneyUTest(x, y), 1e-5);
|
||||
}
|
||||
|
@ -75,14 +75,14 @@ public class MannWhitneyUTestTest {
|
|||
} catch (NullArgumentException ex) {
|
||||
// expected
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
testStatistic.mannWhitneyUTest(null, null);
|
||||
Assert.fail("x and y is null (asymptotic), NullArgumentException expected");
|
||||
} catch (NullArgumentException ex) {
|
||||
// expected
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* x or y is null
|
||||
*/
|
||||
|
@ -92,7 +92,7 @@ public class MannWhitneyUTestTest {
|
|||
} catch (NullArgumentException ex) {
|
||||
// expected
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
testStatistic.mannWhitneyUTest(new double[] { 1.0 }, null);
|
||||
Assert.fail("y is null (exact), NullArgumentException expected");
|
||||
|
@ -100,7 +100,7 @@ public class MannWhitneyUTestTest {
|
|||
// expected
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testBigDataSet() {
|
||||
double[] d1 = new double[1500];
|
||||
|
@ -112,7 +112,7 @@ public class MannWhitneyUTestTest {
|
|||
double result = testStatistic.mannWhitneyUTest(d1, d2);
|
||||
Assert.assertTrue(result > 0.1);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testBigDataSetOverflow() {
|
||||
// MATH-1145
|
||||
|
|
|
@ -530,7 +530,7 @@ public class TestUtilsTest {
|
|||
Assert.assertEquals(FastMath.sqrt(5734.343), TestUtils.rootLogLikelihoodRatio(1000, 1000, 1000, 100000), 0.001);
|
||||
Assert.assertEquals(FastMath.sqrt(5714.932), TestUtils.rootLogLikelihoodRatio(1000, 1000, 1000, 99000), 0.001);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testKSOneSample() throws Exception {
|
||||
final NormalDistribution unitNormal = new NormalDistribution(0d, 1d);
|
||||
|
@ -539,7 +539,7 @@ public class TestUtilsTest {
|
|||
Assert.assertEquals(0.3172069207622391, TestUtils.kolmogorovSmirnovTest(unitNormal, sample), tol);
|
||||
Assert.assertEquals(0.0932947561266756, TestUtils.kolmogorovSmirnovStatistic(unitNormal, sample), tol);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testKSTwoSample() throws Exception {
|
||||
final double tol = KolmogorovSmirnovTestTest.TOLERANCE;
|
||||
|
@ -554,6 +554,6 @@ public class TestUtilsTest {
|
|||
final double d = TestUtils.kolmogorovSmirnovStatistic(smallSample1, smallSample2);
|
||||
Assert.assertEquals(0.5, d, tol);
|
||||
Assert
|
||||
.assertEquals(0.105577085453247, TestUtils.exactP(d, smallSample1.length,smallSample2.length, false), tol);
|
||||
.assertEquals(0.105577085453247, TestUtils.exactP(d, smallSample1.length,smallSample2.length, false), tol);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,28 +42,28 @@ public class WilcoxonSignedRankTestTest {
|
|||
*/
|
||||
final double x[] = {1.83, 0.50, 1.62, 2.48, 1.68, 1.88, 1.55, 3.06, 1.30};
|
||||
final double y[] = {0.878, 0.647, 0.598, 2.05, 1.06, 1.29, 1.06, 3.14, 1.29};
|
||||
|
||||
|
||||
/* EXACT:
|
||||
* wilcox.test(x, y, alternative = "two.sided", mu = 0, paired = TRUE, exact = TRUE, correct = FALSE)
|
||||
* V = 40, p-value = 0.03906
|
||||
*
|
||||
*
|
||||
* Corresponds to the value obtained in R.
|
||||
*/
|
||||
Assert.assertEquals(40, testStatistic.wilcoxonSignedRank(x, y), 1e-10);
|
||||
Assert.assertEquals(0.03906, testStatistic.wilcoxonSignedRankTest(x, y, true), 1e-5);
|
||||
|
||||
Assert.assertEquals(0.03906, testStatistic.wilcoxonSignedRankTest(x, y, true), 1e-5);
|
||||
|
||||
/* ASYMPTOTIC:
|
||||
* wilcox.test(x, y, alternative = "two.sided", mu = 0, paired = TRUE, exact = FALSE, correct = FALSE)
|
||||
* V = 40, p-value = 0.03815
|
||||
*
|
||||
* This is not entirely the same due to different corrects,
|
||||
*
|
||||
* This is not entirely the same due to different corrects,
|
||||
* e.g. http://mlsc.lboro.ac.uk/resources/statistics/wsrt.pdf
|
||||
* and src/library/stats/R/wilcox.test.R in the R source
|
||||
*/
|
||||
Assert.assertEquals(40, testStatistic.wilcoxonSignedRank(x, y), 1e-10);
|
||||
Assert.assertEquals(0.0329693812, testStatistic.wilcoxonSignedRankTest(x, y, false), 1e-10);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testWilcoxonSignedRankInputValidation() {
|
||||
/*
|
||||
|
@ -74,19 +74,19 @@ public class WilcoxonSignedRankTestTest {
|
|||
final double[] y1 = new double[30];
|
||||
final double[] y2 = new double[31];
|
||||
for (int i = 0; i < 30; ++i) {
|
||||
x1[i] = x2[i] = y1[i] = y2[i] = i;
|
||||
x1[i] = x2[i] = y1[i] = y2[i] = i;
|
||||
}
|
||||
|
||||
|
||||
// Exactly 30 is okay
|
||||
//testStatistic.wilcoxonSignedRankTest(x1, y1, true);
|
||||
|
||||
//testStatistic.wilcoxonSignedRankTest(x1, y1, true);
|
||||
|
||||
try {
|
||||
testStatistic.wilcoxonSignedRankTest(x2, y2, true);
|
||||
Assert.fail("More than 30 samples and exact chosen, NumberIsTooLargeException expected");
|
||||
} catch (NumberIsTooLargeException ex) {
|
||||
// expected
|
||||
}
|
||||
|
||||
|
||||
/* Samples must be present, i.e. length > 0
|
||||
*/
|
||||
try {
|
||||
|
@ -132,7 +132,7 @@ public class WilcoxonSignedRankTestTest {
|
|||
} catch (DimensionMismatchException ex) {
|
||||
// expected
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* x and y is null
|
||||
*/
|
||||
|
@ -142,14 +142,14 @@ public class WilcoxonSignedRankTestTest {
|
|||
} catch (NullArgumentException ex) {
|
||||
// expected
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
testStatistic.wilcoxonSignedRankTest(null, null, false);
|
||||
Assert.fail("x and y is null (asymptotic), NullArgumentException expected");
|
||||
} catch (NullArgumentException ex) {
|
||||
// expected
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* x or y is null
|
||||
*/
|
||||
|
@ -159,21 +159,21 @@ public class WilcoxonSignedRankTestTest {
|
|||
} catch (NullArgumentException ex) {
|
||||
// expected
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
testStatistic.wilcoxonSignedRankTest(null, new double[] { 1.0 }, false);
|
||||
Assert.fail("x is null (asymptotic), NullArgumentException expected");
|
||||
} catch (NullArgumentException ex) {
|
||||
// expected
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
testStatistic.wilcoxonSignedRankTest(new double[] { 1.0 }, null, true);
|
||||
Assert.fail("y is null (exact), NullArgumentException expected");
|
||||
} catch (NullArgumentException ex) {
|
||||
// expected
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
testStatistic.wilcoxonSignedRankTest(new double[] { 1.0 }, null, false);
|
||||
Assert.fail("y is null (asymptotic), NullArgumentException expected");
|
||||
|
|
Loading…
Reference in New Issue