Class Stats
java.lang.Object
microsim.dev.statistics.Stats
Statistics over a collection of data.
Note that results are cached, for example calling
stats.sum();
stats.sum();
stats.mean();
calculates the sum of elements only once and reuses the results in subsequent calls and to compute the mean.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleaverageLast(int window) Average of the lastwindowterms.intcount()The number of values.org.apache.commons.math3.stat.descriptive.DescriptiveStatisticsCreate aDescriptiveStatisticsobject, use this if you need to access more statistical quantities (e.g. percentiles) than the one directly provided byStats.doublemax()The maximum value.doublemean()The average of all values.doublemin()The minimum value.doublesum()The sum of all values.Convenience method to work with theSupplierAPI.doublevariance()The variance of all values (this is the "biased" empirical variance).
-
Constructor Details
-
Stats
-
-
Method Details
-
supplier
-
count
public int count()The number of values. -
min
public double min()The minimum value. -
max
public double max()The maximum value. -
sum
public double sum()The sum of all values. -
mean
public double mean()The average of all values. -
variance
public double variance()The variance of all values (this is the "biased" empirical variance). -
averageLast
public double averageLast(int window) Average of the lastwindowterms. -
descrStats
public org.apache.commons.math3.stat.descriptive.DescriptiveStatistics descrStats()Create aDescriptiveStatisticsobject, use this if you need to access more statistical quantities (e.g. percentiles) than the one directly provided byStats.
-