@Override public double[] sample(){
  double[] centre=points[sampler.nextInt(points.length)];
  double[] newPoint=new double[bandwidths.length];
  double total=0.0;
  double shift=0.0;
  for (int i=0; i < centre.length; i++) {
    newPoint[i]=(sampler.nextGaussian() * samplingDeviation[i]) + centre[i];
    total+=newPoint[i];
    if (newPoint[i] < shift) {
      shift=newPoint[i];
    }
  }
  if (isBounded) {
    for (int i=0; i < centre.length; i++) {
      newPoint[i]=(newPoint[i] - shift) / (total - shift * centre.length);
    }
  }
  return newPoint;
}

@ Override public double [ ] sample ( ) { double [ ] centre = points [ sampler . nextInt ( points . length ) ] ; double [ ] newPoint = new double [ bandwidths . length ] ; double total = 0.0 ; double shift = 0.0 ; for ( int i = 0 ; i < centre . length ; i ++ ) { newPoint [ i ] = ( sampler . nextGaussian ( ) * samplingDeviation [ i ] ) + centre [ i ] ; total += newPoint [ i ] ; if ( newPoint [ i ] < shift ) { shift = newPoint [ i ] ; } } if ( isBounded ) { for ( int i = 0 ; i < centre . length ; i ++ ) { newPoint [ i ] = ( newPoint [ i ] - shift ) / ( total - shift * centre . length ) ; } } return newPoint ; }
samples from the kernel density function , first picking one of the point , and then deviating from it according to a gaussian centered around it
