Package org.apache.commons.math3.stat.descriptive.summary

Examples of org.apache.commons.math3.stat.descriptive.summary.Sum.evaluate()


        for (int i = 0; i < length; i++) {
            values[i] = start + i;
        }

        Variance variance = new Variance(false);
        return variance.evaluate(values);
    }
}
View Full Code Here


        for (int i = 0; i < length; i++) {
            values[i] = start + i;
        }

        Variance variance = new Variance();
        return variance.evaluate(values);
    }
}
View Full Code Here

        for (int i = 0; i < length; i++) {
            values[i] = start + i;
        }

        Variance variance = new Variance(false);
        return variance.evaluate(values);
    }
}
View Full Code Here

        double              values[] = new double[ count ];

        for ( int i = 0; i < count; i++)
        { values[ i ] = ((Double)arraylist.get(i)).doubleValue(); }

        return median.evaluate( values );
    }

    /**
     * <p>
     * Format a double as a percentage, suitable for printing.
View Full Code Here

    Percentile distribution = new Percentile();
    distribution.setData(values);
    double[] percentiles = new double[MAX_NUMERIC_SPLITS];
    for (int i = 0 ; i < percentiles.length; i++) {
      double p = 100.0 * ((i + 1.0) / (MAX_NUMERIC_SPLITS + 1.0));
      percentiles[i] = distribution.evaluate(p);
    }
    return percentiles;
  }

  private static double[] chooseCategoricalSplitPoints(double[] values) {
View Full Code Here

    @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);
View Full Code Here

        if (test(values, begin, length)) {
            Sum sum = new Sum();
            double sampleSize = length;

            // Compute initial estimate using definitional formula
            double xbar = sum.evaluate(values, begin, length) / sampleSize;

            // Compute correction factor in second pass
            double correction = 0;
            for (int i = begin; i < begin + length; i++) {
                correction += values[i] - xbar;
View Full Code Here

                           final int begin, final int length) throws MathIllegalArgumentException {
        if (test(values, weights, begin, length)) {
            Sum sum = new Sum();

            // Compute initial estimate using definitional formula
            double sumw = sum.evaluate(weights,begin,length);
            double xbarw = sum.evaluate(values, weights, begin, length) / sumw;

            // Compute correction factor in second pass
            double correction = 0;
            for (int i = begin; i < begin + length; i++) {
View Full Code Here

        if (test(values, weights, begin, length)) {
            Sum sum = new Sum();

            // Compute initial estimate using definitional formula
            double sumw = sum.evaluate(weights,begin,length);
            double xbarw = sum.evaluate(values, weights, begin, length) / sumw;

            // Compute correction factor in second pass
            double correction = 0;
            for (int i = begin; i < begin + length; i++) {
                correction += weights[i] * (values[i] - xbarw);
View Full Code Here

        if (test(values, begin, length)) {
            Sum sum = new Sum();
            double sampleSize = length;

            // Compute initial estimate using definitional formula
            double xbar = sum.evaluate(values, begin, length) / sampleSize;

            // Compute correction factor in second pass
            double correction = 0;
            for (int i = begin; i < begin + length; i++) {
                correction += values[i] - xbar;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.