Skip to content

bug with var(rep(1e30, 3)) (PR#1228)

1 message · Peter Dalgaard

#
Prof Brian Ripley <ripley@stats.ox.ac.uk> writes:
Hmm. Which algorithms are there? Surely almost any kind of provisional
means subtraction could avoid the the extreme case where the mean of a
bunch of identical numbers is different from all of them, but will it
also improve precision in the general case?

Essentially our current algorithm in cov.c is

xm<- sum(x)/n
v <- 1/(n-1)*sum((x-xm)^2)