Package com.inadco.hbl.math.aggregators

Examples of com.inadco.hbl.math.aggregators.OnlineMeanSummarizer.update()


    public void OnlineMeanSummarizerTest() throws Exception {
        Random rnd = new Random();
        OnlineMeanSummarizer oms = new OnlineMeanSummarizer();

        for (int i = 0; i < 10000; i++)
            oms.update(rnd.nextGaussian() * 5 + 1); // should generate mean 1,
                                                    // variance 25 or so
        Assert.assertTrue(Math.abs(oms.getMean() - 1) < 0.1);
        Assert.assertTrue(Math.sqrt(oms.getVariance()) - 25 < 5);

    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.