diff --git a/src/test/java/org/apache/commons/math/stat/StatUtilsTest.java b/src/test/java/org/apache/commons/math/stat/StatUtilsTest.java index 905f772b9..1b1d74155 100644 --- a/src/test/java/org/apache/commons/math/stat/StatUtilsTest.java +++ b/src/test/java/org/apache/commons/math/stat/StatUtilsTest.java @@ -424,46 +424,46 @@ public final class StatUtilsTest extends TestCase { } - /** - * Run the test with the values 50 and 100 and assume standardized values - */ + /** + * Run the test with the values 50 and 100 and assume standardized values + */ - public void testNormalize1() { - double sample[] = { 50, 100 }; - double expectedSample[] = { -25 / Math.sqrt(1250), 25 / Math.sqrt(1250) }; - double[] out = StatUtils.normalize(sample); - for (int i = 0; i < out.length; i++) { - assertEquals(out[i], expectedSample[i]); - } + public void testNormalize1() { + double sample[] = { 50, 100 }; + double expectedSample[] = { -25 / Math.sqrt(1250), 25 / Math.sqrt(1250) }; + double[] out = StatUtils.normalize(sample); + for (int i = 0; i < out.length; i++) { + assertEquals(out[i], expectedSample[i]); + } - } + } - /** - * Run with 77 random values, assuming that the outcome has a mean of 0 and a standard deviation of 1 with a - * precision of 1E-10. - */ + /** + * Run with 77 random values, assuming that the outcome has a mean of 0 and a standard deviation of 1 with a + * precision of 1E-10. + */ - public void testNormalize2() { - // create an sample with 77 values - int length = 77; - double sample[] = new double[length]; - for (int i = 0; i < length; i++) { - sample[i] = Math.random(); - } - // normalize this sample - double standardizedSample[] = StatUtils.normalize(sample); + public void testNormalize2() { + // create an sample with 77 values + int length = 77; + double sample[] = new double[length]; + for (int i = 0; i < length; i++) { + sample[i] = Math.random(); + } + // normalize this sample + double standardizedSample[] = StatUtils.normalize(sample); - DescriptiveStatistics stats = new DescriptiveStatistics(); - // Add the data from the array - for (int i = 0; i < length; i++) { - stats.addValue(standardizedSample[i]); - } - // the calculations do have a limited precision - double distance = 1E-10; - // check the mean an standard deviation - assertEquals(0.0, stats.getMean(), distance); - assertEquals(1.0, stats.getStandardDeviation(), distance); + DescriptiveStatistics stats = new DescriptiveStatistics(); + // Add the data from the array + for (int i = 0; i < length; i++) { + stats.addValue(standardizedSample[i]); + } + // the calculations do have a limited precision + double distance = 1E-10; + // check the mean an standard deviation + assertEquals(0.0, stats.getMean(), distance); + assertEquals(1.0, stats.getStandardDeviation(), distance); - } + } }