public static double variance(DoubleTuple t, double mean)
    {
        int d = t.getSize();
        double variance = 0;
        for (int i=0; i<d; i++)
        {
            double difference = t.get(i) - mean;
            variance += difference * difference;
        }
        return variance / (d - 1);
    }
public static double variance ( DoubleTuple t , double mean ) { int d = t . getSize ( ) ; double variance = 0 ; for ( int i = 0 ; i < d ; i ++ ) { double difference = t . get ( i ) - mean ; variance += difference * difference ; } return variance / ( d - 1 ) ; }
Returns the bias-corrected sample variance of the given tuple.

@param t The input tuple
@param mean The mean, which may have been computed before with
{@link #arithmeticMean(DoubleTuple)}
@return The variance