User Tools

Site Tools


documentation:easy_statistics_on_a_list_of_values

Easy statistics on a list of values

To do statistics on a list of values, you can use the ListOfValue class in capsis.lib.math.

Example:

 
Collection cells = ((Samsa2Plot) stand.getPlot ()).getCells (cellIds);
 
ListOfValues lov = new ListOfValues (cells) {
	@Override
	public double getValue (Object o) {
		Samsa2Cell cell = (Samsa2Cell) o;
		return mp.getCellRelativeHorizontalEnergy(cell);
	}
};
 
double mean = lov.getArithmeticMean());
double geometricMean = lov.getGeometricMean ();
double variance = lov.getPopulationVariance ();
double sd = lov.getStandardDeviation ();
double skewness = lov.getSkewness ();
double sum = lov.getSum ();
double min = lov.getMin ();
double max = lov.getMax ();
 
 
(...)
documentation/easy_statistics_on_a_list_of_values.txt ยท Last modified: 2021/12/13 09:28 by 127.0.0.1