Skip to content
Prev 82124 / 398513 Next

computing the variance

Le 05.12.2005 09:53, Wang Tian Hua a ??crit :
These results are expected, it is so not a bug.
 From details section in ?var
    The denominator n - 1 is used which gives an unbiased estimator of
     the (co)variance for i.i.d. observations. (.....)

If you really want biased variance, work around :

biasedVar <- function(x, ...){
  n <- length(x)
  (n-1) / n * var(x,...)
}

Romain