Example usage for org.apache.commons.math3.stat.descriptive DescriptiveStatistics getMax

List of usage examples for org.apache.commons.math3.stat.descriptive DescriptiveStatistics getMax

Introduction

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

Prototype

public double getMax() 

Source Link

Document

Returns the maximum of the available values

Usage

From source file:com.github.jessemull.microflex.stat.statdouble.MaxDoubleTest.java

/**
 * Tests well calculation.//from  w  w w.jav a 2s  .  c o m
 */
@Test
public void testWell() {

    for (PlateDouble plate : array) {

        for (WellDouble well : plate) {

            double[] input = new double[well.size()];
            int index = 0;

            for (double bd : well) {
                input[index++] = bd;
                ;
            }

            DescriptiveStatistics stat = new DescriptiveStatistics(input);
            double result = Precision.round(stat.getMax(), precision);
            double returned = Precision.round(max.well(well), precision);

            assertTrue(result == returned);
        }
    }
}

From source file:com.github.jessemull.microflex.stat.statinteger.MaxIntegerTest.java

/**
 * Tests well calculation.//  w  w  w .  j  a  v a 2s .c o  m
 */
@Test
public void testWell() {

    for (PlateInteger plate : array) {

        for (WellInteger well : plate) {

            double[] input = new double[well.size()];
            int index = 0;

            for (double bd : well) {
                input[index++] = bd;
                ;
            }

            DescriptiveStatistics stat = new DescriptiveStatistics(input);
            double result = Precision.round(stat.getMax(), precision);
            double returned = Precision.round(max.well(well), precision);

            assertTrue(result == returned);
        }
    }
}

From source file:com.github.jessemull.microflexdouble.stat.MaxTest.java

/**
 * Tests the aggregated plate statistics method using a collection.
 *///from  w w w  .  j  a  va  2 s  . co  m
@Test
public void testAggregatedPlateCollection() {

    List<Plate> collection = Arrays.asList(array);
    Map<Plate, Double> aggregatedReturnedMap = max.platesAggregated(collection);
    Map<Plate, Double> aggregatedResultMap = new TreeMap<Plate, Double>();

    for (Plate plate : collection) {

        List<Double> resultList = new ArrayList<Double>();

        for (Well well : plate) {
            resultList.addAll(well.data());
        }

        double[] inputAggregated = new double[resultList.size()];

        for (int i = 0; i < resultList.size(); i++) {
            inputAggregated[i] = resultList.get(i);
        }

        DescriptiveStatistics statAggregated = new DescriptiveStatistics(inputAggregated);
        double aggregatedResult = statAggregated.getMax();

        aggregatedResultMap.put(plate, aggregatedResult);
    }

    for (Plate plate : collection) {

        double result = Precision.round(aggregatedResultMap.get(plate), precision);
        double returned = Precision.round(aggregatedReturnedMap.get(plate), precision);

        assertTrue(result == returned);
    }
}

From source file:com.github.jessemull.microflexdouble.stat.MaxTest.java

/**
 * Tests the aggregated plate statistics method using an array.
 *//*  www. ja v a 2s. c om*/
@Test
public void testAggregatedPlateArray() {

    Map<Plate, Double> aggregatedReturnedMap = max.platesAggregated(array);
    Map<Plate, Double> aggregatedResultMap = new TreeMap<Plate, Double>();

    for (Plate plate : array) {

        List<Double> resultList = new ArrayList<Double>();

        for (Well well : plate) {
            resultList.addAll(well.data());
        }

        double[] inputAggregated = new double[resultList.size()];

        for (int i = 0; i < resultList.size(); i++) {
            inputAggregated[i] = resultList.get(i);
        }

        DescriptiveStatistics statAggregated = new DescriptiveStatistics(inputAggregated);
        double aggregatedResult = statAggregated.getMax();

        aggregatedResultMap.put(plate, aggregatedResult);
    }

    for (Plate plate : array) {

        double result = Precision.round(aggregatedResultMap.get(plate), precision);
        double returned = Precision.round(aggregatedReturnedMap.get(plate), precision);

        assertTrue(result == returned);
    }

}

From source file:com.github.jessemull.microflexinteger.stat.MaxTest.java

/**
 * Tests the aggregated plate statistics method using a collection.
 *//*from  ww w  . j  ava  2  s  .co m*/
@Test
public void testAggregatedPlateCollection() {

    List<Plate> collection = Arrays.asList(array);
    Map<Plate, Double> aggregatedReturnedMap = max.platesAggregated(collection);
    Map<Plate, Double> aggregatedResultMap = new TreeMap<Plate, Double>();

    for (Plate plate : collection) {

        List<Double> resultList = new ArrayList<Double>();

        for (Well well : plate) {
            resultList.addAll(well.toDouble());
        }

        double[] inputAggregated = new double[resultList.size()];

        for (int i = 0; i < resultList.size(); i++) {
            inputAggregated[i] = resultList.get(i);
        }

        DescriptiveStatistics statAggregated = new DescriptiveStatistics(inputAggregated);
        double aggregatedResult = statAggregated.getMax();

        aggregatedResultMap.put(plate, aggregatedResult);
    }

    for (Plate plate : collection) {

        double result = Precision.round(aggregatedResultMap.get(plate), precision);
        double returned = Precision.round(aggregatedReturnedMap.get(plate), precision);

        assertTrue(result == returned);
    }
}

From source file:com.github.jessemull.microflexinteger.stat.MaxTest.java

/**
 * Tests the aggregated plate statistics method using an array.
 *///from ww w  .j  a va  2 s .  c  om
@Test
public void testAggregatedPlateArray() {

    Map<Plate, Double> aggregatedReturnedMap = max.platesAggregated(array);
    Map<Plate, Double> aggregatedResultMap = new TreeMap<Plate, Double>();

    for (Plate plate : array) {

        List<Double> resultList = new ArrayList<Double>();

        for (Well well : plate) {
            resultList.addAll(well.toDouble());
        }

        double[] inputAggregated = new double[resultList.size()];

        for (int i = 0; i < resultList.size(); i++) {
            inputAggregated[i] = resultList.get(i);
        }

        DescriptiveStatistics statAggregated = new DescriptiveStatistics(inputAggregated);
        double aggregatedResult = statAggregated.getMax();

        aggregatedResultMap.put(plate, aggregatedResult);
    }

    for (Plate plate : array) {

        double result = Precision.round(aggregatedResultMap.get(plate), precision);
        double returned = Precision.round(aggregatedReturnedMap.get(plate), precision);

        assertTrue(result == returned);
    }

}

From source file:com.github.jessemull.microflex.stat.statdouble.MaxDoubleTest.java

/**
 * Tests the aggregated plate statistics method using a collection.
 *//* www . j  ava  2  s  . c  o m*/
@Test
public void testAggregatedPlateCollection() {

    List<PlateDouble> collection = Arrays.asList(array);
    Map<PlateDouble, Double> aggregatedReturnedMap = max.platesAggregated(collection);
    Map<PlateDouble, Double> aggregatedResultMap = new TreeMap<PlateDouble, Double>();

    for (PlateDouble plate : collection) {

        List<Double> resultList = new ArrayList<Double>();

        for (WellDouble well : plate) {
            resultList.addAll(well.data());
        }

        double[] inputAggregated = new double[resultList.size()];

        for (int i = 0; i < resultList.size(); i++) {
            inputAggregated[i] = resultList.get(i);
        }

        DescriptiveStatistics statAggregated = new DescriptiveStatistics(inputAggregated);
        double aggregatedResult = statAggregated.getMax();

        aggregatedResultMap.put(plate, aggregatedResult);
    }

    for (PlateDouble plate : collection) {

        double result = Precision.round(aggregatedResultMap.get(plate), precision);
        double returned = Precision.round(aggregatedReturnedMap.get(plate), precision);

        assertTrue(result == returned);
    }
}

From source file:com.github.jessemull.microflex.stat.statdouble.MaxDoubleTest.java

/**
 * Tests the aggregated plate statistics method using an array.
 *///from  www. j  a  v  a  2  s  .c  om
@Test
public void testAggregatedPlateArray() {

    Map<PlateDouble, Double> aggregatedReturnedMap = max.platesAggregated(array);
    Map<PlateDouble, Double> aggregatedResultMap = new TreeMap<PlateDouble, Double>();

    for (PlateDouble plate : array) {

        List<Double> resultList = new ArrayList<Double>();

        for (WellDouble well : plate) {
            resultList.addAll(well.data());
        }

        double[] inputAggregated = new double[resultList.size()];

        for (int i = 0; i < resultList.size(); i++) {
            inputAggregated[i] = resultList.get(i);
        }

        DescriptiveStatistics statAggregated = new DescriptiveStatistics(inputAggregated);
        double aggregatedResult = statAggregated.getMax();

        aggregatedResultMap.put(plate, aggregatedResult);
    }

    for (PlateDouble plate : array) {

        double result = Precision.round(aggregatedResultMap.get(plate), precision);
        double returned = Precision.round(aggregatedReturnedMap.get(plate), precision);

        assertTrue(result == returned);
    }

}

From source file:com.github.jessemull.microflex.stat.statinteger.MaxIntegerTest.java

/**
 * Tests the aggregated plate statistics method using a collection.
 *//*  w  w w .  jav  a2 s  .  com*/
@Test
public void testAggregatedPlateCollection() {

    List<PlateInteger> collection = Arrays.asList(array);
    Map<PlateInteger, Double> aggregatedReturnedMap = max.platesAggregated(collection);
    Map<PlateInteger, Double> aggregatedResultMap = new TreeMap<PlateInteger, Double>();

    for (PlateInteger plate : collection) {

        List<Double> resultList = new ArrayList<Double>();

        for (WellInteger well : plate) {
            resultList.addAll(well.toDouble());
        }

        double[] inputAggregated = new double[resultList.size()];

        for (int i = 0; i < resultList.size(); i++) {
            inputAggregated[i] = resultList.get(i);
        }

        DescriptiveStatistics statAggregated = new DescriptiveStatistics(inputAggregated);
        double aggregatedResult = statAggregated.getMax();

        aggregatedResultMap.put(plate, aggregatedResult);
    }

    for (PlateInteger plate : collection) {

        double result = Precision.round(aggregatedResultMap.get(plate), precision);
        double returned = Precision.round(aggregatedReturnedMap.get(plate), precision);

        assertTrue(result == returned);
    }
}

From source file:com.github.jessemull.microflex.stat.statinteger.MaxIntegerTest.java

/**
 * Tests the aggregated plate statistics method using an array.
 *///  ww w. j  a va  2 s. com
@Test
public void testAggregatedPlateArray() {

    Map<PlateInteger, Double> aggregatedReturnedMap = max.platesAggregated(array);
    Map<PlateInteger, Double> aggregatedResultMap = new TreeMap<PlateInteger, Double>();

    for (PlateInteger plate : array) {

        List<Double> resultList = new ArrayList<Double>();

        for (WellInteger well : plate) {
            resultList.addAll(well.toDouble());
        }

        double[] inputAggregated = new double[resultList.size()];

        for (int i = 0; i < resultList.size(); i++) {
            inputAggregated[i] = resultList.get(i);
        }

        DescriptiveStatistics statAggregated = new DescriptiveStatistics(inputAggregated);
        double aggregatedResult = statAggregated.getMax();

        aggregatedResultMap.put(plate, aggregatedResult);
    }

    for (PlateInteger plate : array) {

        double result = Precision.round(aggregatedResultMap.get(plate), precision);
        double returned = Precision.round(aggregatedReturnedMap.get(plate), precision);

        assertTrue(result == returned);
    }

}