function entropy(x){
  var tot = 0.0;
  var ent = 0.0;
  for (i=0;i < x.length; i++){
    tot = tot + Math.pow(x[i], 2);
  }
  for (i=0;i < x.length; i++){
    quo = Math.pow(x[i], 2) / tot;
    ent = ent + (quo * log10(quo));
  }
  var y = -ent;
  return y
}
// Returns one datapoint representing entropy.
Returns one datapoint representing entropy.
Returns one datapoint representing entropy .
function entropy(x){
  var tot = 0.0;
  var ent = 0.0;
  for (i=0;i < x.length; i++){
    tot = tot + Math.pow(x[i], 2);
  }
  for (i=0;i < x.length; i++){
    quo = Math.pow(x[i], 2) / tot;
    ent = ent + (quo * log10(quo));
  }
  var y = -ent;
  return y
}
function entropy ( x ) { var tot = 0.0 ; var ent = 0.0 ; for ( i = 0 ; i < x . length ; i ++ ) { tot = tot + Math . pow ( x [ i ] , 2 ) ; } for ( i = 0 ; i < x . length ; i ++ ) { quo = Math . pow ( x [ i ] , 2 ) / tot ; ent = ent + ( quo * log10 ( quo ) ) ; } var y = - ent ; return y }
Returns one datapoint representing entropy.
Returns one datapoint representing entropy .