Examples of Sum


Examples of org.apache.commons.math3.stat.descriptive.summary.Sum

        sumLogImpl  = new StorelessUnivariateStatistic[k];
        geoMeanImpl = new StorelessUnivariateStatistic[k];
        meanImpl    = new StorelessUnivariateStatistic[k];

        for (int i = 0; i < k; ++i) {
            sumImpl[i]     = new Sum();
            sumSqImpl[i]   = new SumOfSquares();
            minImpl[i]     = new Min();
            maxImpl[i]     = new Max();
            sumLogImpl[i= new SumOfLogs();
            geoMeanImpl[i] = new GeometricMean();
View Full Code Here

Examples of org.apache.commons.math3.stat.descriptive.summary.Sum

     *  parameters are not valid
     */
    @Override
    public double evaluate(final double[] values,final int begin, final int length) {
        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

Examples of org.apache.commons.math3.stat.descriptive.summary.Sum

     * @since 2.1
     */
    public double evaluate(final double[] values, final double[] weights,
                           final int begin, final int length) {
        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

Examples of org.apache.commons.math3.stat.descriptive.summary.Sum

            }
        }

        int dfwg = 0;
        double sswg = 0;
        Sum totsum = new Sum();
        SumOfSquares totsumsq = new SumOfSquares();
        int totnum = 0;

        for (double[] data : categoryData) {

            Sum sum = new Sum();
            SumOfSquares sumsq = new SumOfSquares();
            int num = 0;

            for (int i = 0; i < data.length; i++) {
                double val = data[i];

                // within category
                num++;
                sum.increment(val);
                sumsq.increment(val);

                // for all categories
                totnum++;
                totsum.increment(val);
                totsumsq.increment(val);
            }
            dfwg += num - 1;
            double ss = sumsq.getResult() - sum.getResult() * sum.getResult() / num;
            sswg += ss;
        }
        double sst = totsumsq.getResult() - totsum.getResult() *
            totsum.getResult()/totnum;
        double ssbg = sst - sswg;
View Full Code Here

Examples of org.apache.imperius.spl.parser.expressions.impl.Sum

           
           
            Expression collection = new BasicCollectionExpression(vbytes,null);
           
            v.add(collection);
            Expression es1 = new Sum(v,true);
            v.clear();
            assertTrue(((Number)es1.evaluate()).floatValue()==(float)79.560005);

           
        } catch (SPLException e) {
            fail("Received evaluation exception " + e.getMessage());
        } catch (Exception e) {
View Full Code Here

Examples of org.apache.openejb.math.stat.descriptive.summary.Sum

     *  parameters are not valid
     */
    @Override
    public double evaluate(final double[] values,final int begin, final int length) {
        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

Examples of org.apache.openejb.math.stat.descriptive.summary.Sum

     * @since 2.1
     */
    public double evaluate(final double[] values, final double[] weights,
                           final int begin, final int length) {
        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

Examples of org.apache.openejb.math.stat.descriptive.summary.Sum

     *                                  parameters are not valid
     */
    @Override
    public double evaluate(final double[] values, final int begin, final int length) {
        if (test(values, begin, length)) {
            final Sum sum = new Sum();
            final double sampleSize = length;

            // Compute initial estimate using definitional formula
            final 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

Examples of org.apache.openejb.math.stat.descriptive.summary.Sum

     * @since 2.1
     */
    public double evaluate(final double[] values, final double[] weights,
                           final int begin, final int length) {
        if (test(values, weights, begin, length)) {
            final Sum sum = new Sum();

            // Compute initial estimate using definitional formula
            final double sumw = sum.evaluate(weights, begin, length);
            final 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

Examples of org.apache.pig.builtin.SUM

            func = new DoubleSum();
        } else if ("sum(int)".equalsIgnoreCase(agg) ||
            "sum(long)".equalsIgnoreCase(agg)) {
            func = new LongSum();
        } else if ("sum(bytearray)".equalsIgnoreCase(agg)) {
            func = new SUM();
        } else if ("avg(double)".equalsIgnoreCase(agg)) {
            func = new DoubleAvg();
        } else if ("avg(float)".equalsIgnoreCase(agg)) {
            func = new FloatAvg();
        } else if ("avg(long)".equalsIgnoreCase(agg)) {
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.