Example usage for org.apache.commons.math3.stat.descriptive SummaryStatistics getSumOfLogs

List of usage examples for org.apache.commons.math3.stat.descriptive SummaryStatistics getSumOfLogs

Introduction

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

Prototype

public double getSumOfLogs() 

Source Link

Document

Returns the sum of the logs of the values that have been added.

Usage

From source file:org.apache.metron.common.math.stats.OnlineStatisticsProviderTest.java

public static void validateStatisticsProvider(StatisticsProvider statsProvider, SummaryStatistics summaryStats,
        DescriptiveStatistics stats) {//from  www  . j  a  v a 2  s.c  om
    //N
    Assert.assertEquals(statsProvider.getCount(), stats.getN());
    //sum
    Assert.assertEquals(statsProvider.getSum(), stats.getSum(), 1e-3);
    //sum of squares
    Assert.assertEquals(statsProvider.getSumSquares(), stats.getSumsq(), 1e-3);
    //sum of squares
    Assert.assertEquals(statsProvider.getSumLogs(), summaryStats.getSumOfLogs(), 1e-3);
    //Mean
    Assert.assertEquals(statsProvider.getMean(), stats.getMean(), 1e-3);
    //Quadratic Mean
    Assert.assertEquals(statsProvider.getQuadraticMean(), summaryStats.getQuadraticMean(), 1e-3);
    //SD
    Assert.assertEquals(statsProvider.getStandardDeviation(), stats.getStandardDeviation(), 1e-3);
    //Variance
    Assert.assertEquals(statsProvider.getVariance(), stats.getVariance(), 1e-3);
    //Min
    Assert.assertEquals(statsProvider.getMin(), stats.getMin(), 1e-3);
    //Max
    Assert.assertEquals(statsProvider.getMax(), stats.getMax(), 1e-3);

    //Kurtosis
    Assert.assertEquals(stats.getKurtosis(), statsProvider.getKurtosis(), 1e-3);

    //Skewness
    Assert.assertEquals(stats.getSkewness(), statsProvider.getSkewness(), 1e-3);
    for (double d = 10.0; d < 100.0; d += 10) {
        //This is a sketch, so we're a bit more forgiving here in our choice of \epsilon.
        Assert.assertEquals("Percentile mismatch for " + d + "th %ile", statsProvider.getPercentile(d),
                stats.getPercentile(d), 1e-2);
    }
}

From source file:org.lightjason.agentspeak.action.buildin.math.statistic.EStatisticValue.java

/**
 * returns a statistic value/* w  w  w . ja va2s.  c  o m*/
 *
 * @param p_statistic statistic object
 * @return statistic value
 */
public final double value(final SummaryStatistics p_statistic) {
    switch (this) {
    case GEOMETRICMEAN:
        return p_statistic.getGeometricMean();

    case MAX:
        return p_statistic.getMax();

    case MIN:
        return p_statistic.getMin();

    case COUNT:
        return p_statistic.getN();

    case POPULATIONVARIANCE:
        return p_statistic.getPopulationVariance();

    case QUADRATICMEAN:
        return p_statistic.getQuadraticMean();

    case SECONDMOMENT:
        return p_statistic.getSecondMoment();

    case STANDARDDEVIATION:
        return p_statistic.getStandardDeviation();

    case SUM:
        return p_statistic.getSum();

    case SUMLOG:
        return p_statistic.getSumOfLogs();

    case SUMSQUARE:
        return p_statistic.getSumsq();

    case VARIANCE:
        return p_statistic.getVariance();

    case MEAN:
        return p_statistic.getMean();

    default:
        throw new CIllegalStateException(
                org.lightjason.agentspeak.common.CCommon.languagestring(this, "unknown", this));
    }
}

From source file:org.lightjason.agentspeak.action.builtin.math.statistic.EStatisticValue.java

/**
 * returns a statistic value//w  ww.ja va2s .  c  o m
 *
 * @param p_statistic statistic object
 * @return statistic value
 */
public final double value(@Nonnull final SummaryStatistics p_statistic) {
    switch (this) {
    case GEOMETRICMEAN:
        return p_statistic.getGeometricMean();

    case MAX:
        return p_statistic.getMax();

    case MIN:
        return p_statistic.getMin();

    case COUNT:
        return p_statistic.getN();

    case POPULATIONVARIANCE:
        return p_statistic.getPopulationVariance();

    case QUADRATICMEAN:
        return p_statistic.getQuadraticMean();

    case SECONDMOMENT:
        return p_statistic.getSecondMoment();

    case STANDARDDEVIATION:
        return p_statistic.getStandardDeviation();

    case SUM:
        return p_statistic.getSum();

    case SUMLOG:
        return p_statistic.getSumOfLogs();

    case SUMSQUARE:
        return p_statistic.getSumsq();

    case VARIANCE:
        return p_statistic.getVariance();

    case MEAN:
        return p_statistic.getMean();

    default:
        throw new CIllegalStateException(
                org.lightjason.agentspeak.common.CCommon.languagestring(this, "unknown", this));
    }
}

From source file:tech.tablesaw.columns.numbers.Stats.java

private static Stats getStats(NumericColumn<?> values, SummaryStatistics summaryStatistics) {
    Stats stats = new Stats("Column: " + values.name());
    stats.min = summaryStatistics.getMin();
    stats.max = summaryStatistics.getMax();
    stats.n = summaryStatistics.getN();//from  ww  w  .  j  a  v a  2 s .c o  m
    stats.sum = summaryStatistics.getSum();
    stats.variance = summaryStatistics.getVariance();
    stats.populationVariance = summaryStatistics.getPopulationVariance();
    stats.quadraticMean = summaryStatistics.getQuadraticMean();
    stats.geometricMean = summaryStatistics.getGeometricMean();
    stats.mean = summaryStatistics.getMean();
    stats.standardDeviation = summaryStatistics.getStandardDeviation();
    stats.sumOfLogs = summaryStatistics.getSumOfLogs();
    stats.sumOfSquares = summaryStatistics.getSumsq();
    stats.secondMoment = summaryStatistics.getSecondMoment();
    return stats;
}