cloudsim-plus-master/cloudsim-plus-master/cloudsim-plus/src/main/java/org/cloudbus/cloudsim/util/MathUtil.java
public static double variance(final List<Double> list) {
        long n = 0;
        double mean = mean(list);
        double s = 0.0;

        for(final double x : list) {
            n++;
            final double delta = x - mean;
            mean += delta / n;
            s += delta * (x - mean);
        }
        // if you want to calculate std deviation
        // of a sample change this to (s/(n-1))
        return s / (n - 1);
    }
/**
     * Gets the Variance from a list of numbers.
     *
     * @param list the list of numbers
     * @return the variance
     */
Gets the Variance from a list of numbers.
@param list the list of numbers
@return the variance
Gets the Variance from a list of numbers . @param list the list of numbers @return the variance
public static double variance(final List<Double> list) {
        long n = 0;
        double mean = mean(list);
        double s = 0.0;
        for(final double x : list) {
            n++;
            final double delta = x - mean;
            mean += delta / n;
            s += delta * (x - mean);
        }
        return s / (n - 1);
    }
public static double variance ( final List < Double > list ) { long n = 0 ; double mean = mean ( list ) ; double s = 0.0 ; for ( final double x : list ) { n ++ ; final double delta = x - mean ; mean += delta / n ; s += delta * ( x - mean ) ; } return s / ( n - 1 ) ; }
Gets the Variance from a list of numbers.
Gets the Variance from a list of numbers .
// if you want to calculate std deviation // of a sample change this to (s/(n-1))