org.apache.commons.math3.stat.descriptive
Class AggregateSummaryStatisticsTest

java.lang.Object
  extended by org.apache.commons.math3.stat.descriptive.AggregateSummaryStatisticsTest

public class AggregateSummaryStatisticsTest
extends Object

Test cases for AggregateSummaryStatistics


Constructor Summary
AggregateSummaryStatisticsTest()
           
 
Method Summary
protected static void assertEquals(StatisticalSummary expected, StatisticalSummary observed, double delta)
          Verifies that a StatisticalSummary and a StatisticalSummaryValues are equal up to delta, with NaNs, infinities returned in the same spots.
 void testAggregate()
          Test aggregate function by randomly generating a dataset of 10-100 values from [-100, 100], dividing it into 2-5 partitions, computing stats for each partition and comparing the result of aggregate(...) applied to the collection of per-partition SummaryStatistics with a single SummaryStatistics computed over the full sample.
 void testAggregateDegenerate()
           
 void testAggregateSpecialValues()
           
 void testAggregation()
          Tests the standard aggregation behavior
 void testAggregationConsistency()
          Verify that aggregating over a partition gives the same results as direct computation. 1) Randomly generate a dataset of 10-100 values from [-100, 100] 2) Divide the dataset it into 2-5 partitions 3) Create an AggregateSummaryStatistic and ContributingStatistics for each partition 4) Compare results from the AggregateSummaryStatistic with values returned by a single SummaryStatistics instance that is provided the full dataset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AggregateSummaryStatisticsTest

public AggregateSummaryStatisticsTest()
Method Detail

testAggregation

public void testAggregation()
Tests the standard aggregation behavior


testAggregationConsistency

public void testAggregationConsistency()
Verify that aggregating over a partition gives the same results as direct computation. 1) Randomly generate a dataset of 10-100 values from [-100, 100] 2) Divide the dataset it into 2-5 partitions 3) Create an AggregateSummaryStatistic and ContributingStatistics for each partition 4) Compare results from the AggregateSummaryStatistic with values returned by a single SummaryStatistics instance that is provided the full dataset


testAggregate

public void testAggregate()
Test aggregate function by randomly generating a dataset of 10-100 values from [-100, 100], dividing it into 2-5 partitions, computing stats for each partition and comparing the result of aggregate(...) applied to the collection of per-partition SummaryStatistics with a single SummaryStatistics computed over the full sample.


testAggregateDegenerate

public void testAggregateDegenerate()

testAggregateSpecialValues

public void testAggregateSpecialValues()

assertEquals

protected static void assertEquals(StatisticalSummary expected,
                                   StatisticalSummary observed,
                                   double delta)
Verifies that a StatisticalSummary and a StatisticalSummaryValues are equal up to delta, with NaNs, infinities returned in the same spots. For max, min, n, values have to agree exactly, delta is used only for sum, mean, variance, std dev.



Copyright © 2003-2013 The Apache Software Foundation. All Rights Reserved.