public static void standardize(double[] array) {
        double mu = mean(array);
        double sigma = sd(array);

        if (isZero(sigma)) {
            logger.warn("array has variance of 0.");
            return;
        }

        for (int i = 0; i < array.length; i++) {
            array[i] = (array[i] - mu) / sigma;
        }
    }
@Test
    public void testStandardize() {
        System.out.println("standardize");
        double[] data = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0};
        MathEx.standardize(data);
        assertEquals(0, MathEx.mean(data), 1E-7);
        assertEquals(1, MathEx.sd(data), 1E-7);
    }