Example usage for org.apache.commons.math.stat.descriptive DescriptiveStatistics apply

List of usage examples for org.apache.commons.math.stat.descriptive DescriptiveStatistics apply

Introduction

In this page you can find the example usage for org.apache.commons.math.stat.descriptive DescriptiveStatistics apply.

Prototype

public double apply(UnivariateStatistic stat) 

Source Link

Document

Apply the given statistic to the data associated with this set of statistics.

Usage

From source file:cs.cirg.cida.components.SynopsisTableModel.java

@Override
public Object getValueAt(int rowIndex, int columnIndex) {
    if (columnIndex == 0) {
        return experiments.get(rowIndex).getName();
    }/*  w  w  w .ja  v a  2  s .c  om*/
    if (columnIndex % 3 == 1) {
        DescriptiveStatistics descriptiveStatistics = experiments.get(rowIndex)
                .getBottomRowStatistics(variables.get((columnIndex - 1) / 3));
        return descriptiveStatistics.getMean();
    }
    if (columnIndex % 3 == 2) {
        DescriptiveStatistics descriptiveStatistics = experiments.get(rowIndex)
                .getBottomRowStatistics(variables.get((columnIndex - 1) / 3));
        return descriptiveStatistics.apply(new Median());
    }
    DescriptiveStatistics descriptiveStatistics = experiments.get(rowIndex)
            .getBottomRowStatistics(variables.get((columnIndex - 1) / 3));
    return descriptiveStatistics.getStandardDeviation();
}