public MeanVarianceAccumulator meanVariance() {
        MeanVarianceAccumulator acc = new MeanVarianceAccumulator();

        for (int i = 0; i < elements.length; i++) {
            acc.observe(get(i));
        }

        return acc;
    }
@Test
    public void testMeanVariance() {
        DenseVector d = new DenseVector(new double[] {1, -2, 3, -4, 5, -5, 4, -3, 2, -1});
        MeanVarianceAccumulator mva = d.meanVariance();
        Assertions.assertEquals(12.222222222, mva.getVariance(), 0.000001);
        Assertions.assertEquals(3.4960294939, mva.getStdDev(), 0.000001);
        Assertions.assertEquals(0.0,mva.getMean(), 0.000001);
        Assertions.assertEquals(5,mva.getMax(), 0.000001);
        Assertions.assertEquals(-5,mva.getMin(), 0.000001);
    }