Re: [R] R accuracy

From: Don MacQueen <macq_at_llnl.gov>
Date: Thu 24 Mar 2005 - 02:40:19 EST

Try

   signif(m,8)

At 1:03 AM -0800 3/23/05, Anthony Landrevie wrote:
>Hello,
>
>I am trying to test the precision of R on datasets from The
>Statistical Reference Datasets Project
>http://www.itl.nist.gov/div898/strd/index.html and I don't manage to
>understand how R is storing its results.
>
>For example, I calculate a mean on the michelso dataset (100 values) and find:
>
>> m=mean(michel)
>> m
> V1
>299.8524
>> print(m,digits=15)
> V1
>299.8524
>
>> print(m,digits=22)
> V1
>299.85239999999993
>
>
>The certified value of the mean is 299.85240, so I try
>
>
>> print(m-299.8524)
> V1
>-5.684342e-14
>
>> print(m-299.8524,digits=15)
> V1
>-5.68434188608080e-14
>
>Does it have a sens to print with more than 15 signifiant digits?
>Why is the difference not equal to zero?
>
>I am using R 2.0.1 under Windows XP.
>
>Regards,
>
>Anthony Landrevie
>
>
>---------------------------------
>
>
> [[alternative HTML version deleted]]
>
>______________________________________________
>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

-- 
--------------------------------------
Don MacQueen
Environmental Protection Department
Lawrence Livermore National Laboratory
Livermore, CA, USA

______________________________________________
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 Thu Mar 24 02:46:30 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:30:55 EST