@SuppressWarnings("unused") private static int shlosserJackknifeEstimator(int nRows,int sampleSize,ReaderColumnSelection sampleRowsReader){
  HashMap<DblArray,Integer> valsCount=getValCounts(sampleRowsReader);
  double nBar=((double)sampleSize) / valsCount.size();
  double u=0;
  for (  int cnt : valsCount.values()) {
    u+=Math.pow(cnt - nBar,2);
  }
  u/=nBar;
  if (sampleSize != usedSampleSize)   computeCriticalValue(sampleSize);
  if (u < uniformityCriticalValue) {
    return smoothedJackknifeEstimator(nRows,sampleSize,sampleRowsReader,valsCount);
  }
 else {
    return shlosserEstimator(nRows,sampleSize,sampleRowsReader,valsCount);
  }
}

@ SuppressWarnings ( "unused" ) private static int shlosserJackknifeEstimator ( int nRows , int sampleSize , ReaderColumnSelection sampleRowsReader ) { HashMap < DblArray , Integer > valsCount = getValCounts ( sampleRowsReader ) ; double nBar = ( ( double ) sampleSize ) / valsCount . size ( ) ; double u = 0 ; for ( int cnt : valsCount . values ( ) ) { u += Math . pow ( cnt - nBar , 2 ) ; } u /= nBar ; if ( sampleSize != usedSampleSize ) computeCriticalValue ( sampleSize ) ; if ( u < uniformityCriticalValue ) { return smoothedJackknifeEstimator ( nRows , sampleSize , sampleRowsReader , valsCount ) ; } else { return shlosserEstimator ( nRows , sampleSize , sampleRowsReader , valsCount ) ; } }
peter j . haas , jeffrey f . naughton , s . seshadri , and lynne stokes . 1995 . sampling - based estimation of the number of distinct values of an attribute . vldb ' 95 , section 5 . 2 , recommended estimator by the authors
