Remove TODO comment as this seems numerically robust enough.  The same two-pass
algorithm is used in Haskell's "statistics" package.
This commit is contained in:
Jason Davies 2011-05-11 16:52:37 +01:00
Родитель c9add727b4
Коммит 1e8c12067b
2 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -142,8 +142,8 @@ d3.stats.quantiles = function(d, quantiles) {
return ~~q === q ? (d[q] + d[q + 1]) / 2 : d[Math.round(q)];
});
};
// TODO: replace with more stable algorithm.
// Sample variance.
// Unbiased estimate of a sample's variance.
// Also known as the sample variance, where the denominator is n - 1.
d3.stats.variance = function(x) {
var mean = d3.stats.mean(x),
n = x.length,

Просмотреть файл

@ -1,5 +1,5 @@
// TODO: replace with more stable algorithm.
// Sample variance.
// Unbiased estimate of a sample's variance.
// Also known as the sample variance, where the denominator is n - 1.
d3.stats.variance = function(x) {
var mean = d3.stats.mean(x),
n = x.length,