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

Examples of org.apache.commons.math.stat.descriptive.moment.Variance

Note that adding values using increment or incrementAll and then executing getResult will sometimes give a different, less accurate, result than executing evaluate with the full array of values. The former approach should only be used when the full array of values is not available.

The "population variance" ( sum((x_i - mean)^2) / n ) can also be computed using this statistic. The isBiasCorrected property determines whether the "population" or "sample" value is returned by the evaluate and getResult methods. To compute population variances, set this property to false.

Note that this implementation is not synchronized. If multiple threads access an instance of this class concurrently, and at least one of the threads invokes the increment() or clear() method, it must be synchronized externally.

@version $Revision: 1006299 $ $Date: 2010-10-10 16:47:17 +0200 (dim. 10 oct. 2010) $

        double[] values = new double[length];
        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[length];
        for (int i = 0; i < length; i++) {
            values[i] = start + i;
        }

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

        double[] values = new double[length];
        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[length];
        for (int i = 0; i < length; i++) {
            values[i] = start + i;
        }

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

     *
     * @return the variance
     */
    public double getVariance() {
        if (varianceImpl == variance) {
            return new Variance(secondMoment).getResult();
        } else {
            return varianceImpl.getResult();
        }
    }
View Full Code Here

        double[] values = new double[length];
        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[length];
        for (int i = 0; i < length; i++) {
            values[i] = start + i;
        }

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

        double[] values = new double[length];
        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[length];
        for (int i = 0; i < length; i++) {
            values[i] = start + i;
        }

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

TOP

Related Classes of org.apache.commons.math.stat.descriptive.moment.Variance

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.