Generating summary statistics from multiple distributions

In this recipe, we will be creating an AggregateSummaryStatistics instance to accumulate the overall statistics and SummaryStatistics for the sample data.

How to do it...

  1. Create a method that takes two double array arguments. Each array will contain two different sets of data:
            public void getAggregateStats(double[] values1, double[] 
              values2){ 
    
  2. Create an object of class AggregateSummaryStatistics:
            AggregateSummaryStatistics aggregate = new  
            AggregateSummaryStatistics(); 
    
  3. To generate summary statistics from the two distributions, create two objects of the SummaryStatistics class:
     SummaryStatistics firstSet = aggregate.createContributingStatistics(); SummaryStatistics secondSet = aggregate.createContributingStatistics(); ...

Get Java Data Science Cookbook now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.