Example usage for org.apache.commons.math3.stat.descriptive.summary SumOfLogs SumOfLogs

List of usage examples for org.apache.commons.math3.stat.descriptive.summary SumOfLogs SumOfLogs

Introduction

In this page you can find the example usage for org.apache.commons.math3.stat.descriptive.summary SumOfLogs SumOfLogs.

Prototype

public SumOfLogs() 

Source Link

Document

Create a SumOfLogs instance

Usage

From source file:org.apereo.portal.events.aggr.JpaStatisticalSummaryTest.java

@Ignore
@Test/*from  ww  w.  ja v  a  2  s .com*/
public void testSummaryStatisticsJson() throws Exception {
    final SecondMoment secondMoment = new SecondMoment();
    final Sum sum = new Sum();
    final SumOfSquares sumsq = new SumOfSquares();
    final Min min = new Min();
    final Max max = new Max();
    final SumOfLogs sumLog = new SumOfLogs();

    final Random r = new Random(0);
    for (int i = 0; i < 10; i++) {
        final int nextInt = r.nextInt(100000000);
        secondMoment.increment(nextInt);
        sum.increment(nextInt);
        sumsq.increment(nextInt);
        min.increment(nextInt);
        max.increment(nextInt);
        sumLog.increment(nextInt);
    }

    testStorelessUnivariateStatistic(secondMoment, 7.513432791665536E15);
    testStorelessUnivariateStatistic(sum, 6.01312177E8);
    testStorelessUnivariateStatistic(sumsq, 4.3671066212513456E16);
    testStorelessUnivariateStatistic(min, 2116447.0);
    testStorelessUnivariateStatistic(max, 8.5505948E7);
    testStorelessUnivariateStatistic(sumLog, 175.91713800250577);
}

From source file:org.apereo.portal.events.aggr.stat.JpaStatisticalSummary.java

private SumOfLogs _getSumLog() {
    if (this.sumLog == null) {
        this.sumLog = new SumOfLogs();
    }//from  w w w .jav a2 s  .  co  m
    return this.sumLog;
}