@Override public MultivariateTable toDiscrete(){
  if (discreteCache == null) {
    MultivariateTable.Builder probs=new MultivariateTable.Builder();
    double incr=1.0 / samples.size();
    for (    Assignment sample : samples) {
      Assignment trimmed=sample.getTrimmed(variables);
      probs.incrementRow(trimmed,incr);
    }
    discreteCache=probs.build();
  }
  return discreteCache;
}

@ Override public MultivariateTable toDiscrete ( ) { if ( discreteCache == null ) { MultivariateTable . Builder probs = new MultivariateTable . Builder ( ) ; double incr = 1.0 / samples . size ( ) ; for ( Assignment sample : samples ) { Assignment trimmed = sample . getTrimmed ( variables ) ; probs . incrementRow ( trimmed , incr ) ; } discreteCache = probs . build ( ) ; } return discreteCache ; }
returns a discrete representation of the empirical distribution .
