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

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.apache.commons.math.stat.descriptive.AggregateSummaryStatisticsTest
All Implemented Interfaces:
junit.framework.Test

public class AggregateSummaryStatisticsTest
extends junit.framework.TestCase

Test cases for AggregateSummaryStatistics


Constructor Summary
AggregateSummaryStatisticsTest()
           
 
Method Summary
protected static void assertEquals(org.apache.commons.math.stat.descriptive.StatisticalSummary expected, org.apache.commons.math.stat.descriptive.StatisticalSummary observed, double delta)
          Verifies that a StatisticalSummary and a StatisticalSummaryValues are equal up to delta, with NaNs, infinities returned in the same spots.
static junit.framework.Test suite()
          Creates and returns a Test representing all the test cases in this class
 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.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AggregateSummaryStatisticsTest

public AggregateSummaryStatisticsTest()
Method Detail

suite

public static junit.framework.Test suite()
Creates and returns a Test representing all the test cases in this class

Returns:
a Test representing all the test cases in this class

testAggregation

public void testAggregation()
Tests the standard aggregation behavior


testAggregationConsistency

public void testAggregationConsistency()
                                throws Exception
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

Throws:
Exception

testAggregate

public void testAggregate()
                   throws Exception
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.

Throws:
Exception

testAggregateDegenerate

public void testAggregateDegenerate()
                             throws Exception
Throws:
Exception

testAggregateSpecialValues

public void testAggregateSpecialValues()
                                throws Exception
Throws:
Exception

assertEquals

protected static void assertEquals(org.apache.commons.math.stat.descriptive.StatisticalSummary expected,
                                   org.apache.commons.math.stat.descriptive.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-2010 Apache Software Foundation. All Rights Reserved.