protected double dCalc(ContinuousDistribution cd){
  double max=0;
  for (int i=0; i < v.length(); i++) {
    if (v.get(i) >= cd.min() && v.get(i) <= cd.max()) {
      double tmp=(i + 1.0) / v.length() - cd.cdf(v.get(i));
      max=Math.max(max,Math.abs(tmp));
    }
 else {
      max=Math.max(max,Math.abs((i + 1.0) / v.length()));
    }
  }
  return max;
}

protected double dCalc ( ContinuousDistribution cd ) { double max = 0 ; for ( int i = 0 ; i < v . length ( ) ; i ++ ) { if ( v . get ( i ) >= cd . min ( ) && v . get ( i ) <= cd . max ( ) ) { double tmp = ( i + 1.0 ) / v . length ( ) - cd . cdf ( v . get ( i ) ) ; max = Math . max ( max , Math . abs ( tmp ) ) ; } else { max = Math . max ( max , Math . abs ( ( i + 1.0 ) / v . length ( ) ) ) ; } } return max ; }
calculates the d statistic for comparison against a continous distribution
