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...
- 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){
- Create an object of class
AggregateSummaryStatistics
:AggregateSummaryStatistics aggregate = new AggregateSummaryStatistics();
- 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 books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.