Package org.apache.commons.math.stat.descriptive.rank

Examples of org.apache.commons.math.stat.descriptive.rank.Percentile


      int i = 0;
      for (Measurement measurement : measurements) {
        weightedValues[i] = measurement.value().magnitude() / measurement.weight();
        i++;
      }
      Percentile percentile = new Percentile();
      percentile.setData(weightedValues);
      DescriptiveStatistics descriptiveStatistics = new DescriptiveStatistics(weightedValues);
      String unit = Iterables.getOnlyElement(units);
      stdout.printf(
          "  %s%s: min=%.2f, 1st qu.=%.2f, median=%.2f, mean=%.2f, 3rd qu.=%.2f, max=%.2f%n",
          entry.getKey(), unit.isEmpty() ? "" : "(" + unit + ")",
          descriptiveStatistics.getMin(), percentile.evaluate(25),
          percentile.evaluate(50), descriptiveStatistics.getMean(),
          percentile.evaluate(75), descriptiveStatistics.getMax());
    }

    instrumentSpecs.add(trial.instrumentSpec());
    Scenario scenario = trial.scenario();
    vmSpecs.add(scenario.vmSpec());


     * @param p the requested percentile (scaled from 0 - 100)
     * @return An estimate for the pth percentile of the stored data
     * values
     */
    public double getPercentile(double p) {
        return apply(new Percentile(p));
    }

     * @param p the requested percentile (scaled from 0 - 100)
     * @return An estimate for the pth percentile of the stored data
     * values
     */
    public double getPercentile(double p) {
        return apply(new Percentile(p));
    }

        protected void addLatency(double latency) {
            rawData.add(latency);
        }

        protected void compute() {
            Percentile percentile = new Percentile();
            double[] rawDataAsArray = clearRawDataAndGetAsArray();
            if (null != rawDataAsArray && rawDataAsArray.length != 0) {
                sampleSize = rawDataAsArray.length;
                percentile.setData(rawDataAsArray);
                percentile_99_5 = percentile.evaluate(99.5);
                percentile_99 = percentile.evaluate(99);
                percentile_90 = percentile.evaluate(90);
                median = Math.max(1d, percentile.evaluate(50));
                max = StatUtils.max(rawDataAsArray);
                mean = new Mean().evaluate(rawDataAsArray);
                stddev = new StandardDeviation().evaluate(rawDataAsArray);
            }
            computedData.set(getCopyOfComputedData());

public class TimeGeneratorTest {

    @Test
    public void testRandomGenerator() {
       
        Percentile p = new Percentile(35);
        p.setData(new double[]{35});
        System.out.println(p.evaluate(5));
       
        Map<String, Object> data = new HashMap<String, Object>();
        data.put(SimulationConstants.DISTRIBUTION_TYPE, "random");
        data.put(SimulationConstants.MIN, 500L);
        data.put(SimulationConstants.MAX, 40000L);

TOP

Related Classes of org.apache.commons.math.stat.descriptive.rank.Percentile

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.