Statistics model element

Statistics stores a number of double values and computes descriptive statistics out of them.

The element is just an object of the DescriptiveStatistics class in the Apache Common numerics library.

Usage

To add a statistics element to your model, simply drag the icon element to the list of your model elements.

A call to the element method void addValue(double value) adds a double value to the dataset.

A call to the element method void clear() clears all data previously added.

The element provides several methods to retrieve descriptive statistics out of the data added. Here are just two of them:

A complete list of the methods provided can be found in the DescriptiveStatistics class web page.

Example of use

statistics.clear(); // Make sure the dataset is empty
statistics.addValue(1);
statistics.addValue(1);
statistics.addValue(1);
statistics.addValue(2);
_println("Mean = "+statistics.getMean()); // prints: Mean = 1.25
_println("Variance = "+statistics.getVariance()); // prints: Variance = 0.25