popVariance property

num popVariance

Returns the variance of this list, assuming this list is a population.

See variance for the assumption that this list is a sample.

Implementation

num get popVariance {
  num totvar = 0;
  var avg = mean;
  for (var i in this) {
    totvar += pow(i-avg, 2);
  }
  return totvar/length;
}