* @param sigma standard deviation
* @return
*/
public FunctionV1 kernelDensityEstimation(double sigma){
try{
FunctionV1 fn= new ConstantFunction(0);
Iterator<Double> it= cs.keySet().iterator();
while(it.hasNext()){
Double v= it.next();
Integer f= cs.get(v);
double coeff= (double) f.intValue()/size();
fn= fn.add( (new NormalDistribution( v.doubleValue(), sigma)).
multiply(new ConstantFunction(coeff)) );
}
return fn;
}catch(FunctionException e){
e.printStackTrace();
return null;