code: public static double varianceDoublematrixColumn( double[][] matrix, int column, double mean )
  
      {
  
          double variance;
  
          variance = 0;
  
          for( int i = 0; i < matrix.length; i++ ) {
              variance += (matrix[i][column] - mean) * (matrix[i][column] - mean);
          }
  
          return variance / matrix.length;
  
      }
docs: Return the variance of a column of a matrix.
  
  @param matrix matrix of the value to calculate.
  @param column index of the column to calculate the variance.
  @param mean the mean value of the column.
  @return variance.