Generating descriptive statistics

Descriptive statistics are used to summarize a sample and are not generally developed based on probability theories. In contrast, inferential statistics are mostly used to draw a conclusion about the population from a representative sample of it. In this recipe, we will see how we can use Java to generate descriptive statistics from small samples.

Without broadening the scope of this recipe too much, we will be focusing only on a subset of descriptive statistics listed here.

How to do it...

  1. Create a method that takes a double array as argument. The array will contain the values for which you are going to compute the descriptive statistics:
            public void getDescStats(double[] values){ 
    
  2. Create an object of the DescriptiveStatistics ...

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.