Re: [R] Variance for Vector of Constants is STILL Not Zero

From: P Ehlers <ehlers_at_math.ucalgary.ca>
Date: Sat 18 Feb 2006 - 07:55:56 EST

Barry,
Try the latest _patched_ version. I'm on 2006-02-12, but that may already be superseded. I get var(x) = 0.

Peter Ehlers

Barry Zajdlik wrote:
> Hello all,
>
> Thanks for the responses but I am still annoyed by this seemingly simple
> problem; I recorded sessionInfo() as below.
>
> x<-rep(0.02,10)
>

>>var(x)

>
> [1] 1.337451e-35
>
>> sessionInfo()

>
> R version 2.1.0, 2005-04-18, i386-pc-mingw32
>
> attached base packages:
> [1] "methods" "stats" "graphics" "grDevices" "utils"
> "datasets"
> [7] "base"
>
>
>
> I then decided to download the latest version today but obtained the
> same result.
>
>
>>x<-rep(0.02,10)
>>var(x)

>
> [1] 1.337451e-35
>
>
>>sessionInfo()

>
> R version 2.2.1, 2005-12-20, i386-pc-mingw32
>
> attached base packages:
> [1] "methods" "stats" "graphics" "grDevices" "utils"
> "datasets"
> [7] "base"
>
>
> I Changed .Machine$double.eps to make the calculations LESS accurate.
> My thought was that if I reduced the precision, 1-eps would return 1
> instead of some number less than 1. My thought was that if eps were
> sufficiently large my sample problem would return a zero. This didn't
> happen though.
>
> Again, any thoughts would be appreciated.
>
> Regards,
> Barry Zajdlik
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Sat Feb 18 08:01:54 2006

This archive was generated by hypermail 2.1.8 : Mon 20 Feb 2006 - 14:08:40 EST