Study about accuracy of statistical software, incl. Octave

Marco Caliari marco.caliari at univr.it
Wed Mar 25 10:57:42 CDT 2009


Dear all,

please do not consider the results in the paper reliable. Here is my test
with R 2.5.1

> v <- 10000000.2
> x <- c(10000000.1,10000000.3)
> v <- c(v,rep(x, times = 500))
> sqrt(var(v))
[1] 0.1
> options(digits=16)
> sqrt(var(v))
[1] 0.1000000005587935

Octave gives 1.00000000558841e-01, same number of correct digits.
Nevertheless, I think there is space for improving accuracy
of mean, std, var, ...

Best regards,

Marco

On Tue, 24 Mar 2009, John W. Eaton wrote:

> On 24-Mar-2009, Marco Caliari wrote:
>
> | > What do you mean by "exact mean" here? I don't think any of the three
> | > numbers are exactly representable in IEEE floating-point. It would be
> | > better to choose numbers that have an exact representation, such as
> | > 1e7 + 0.25, 1e7 + 0.5, 1.7 + 0.75 or such. Otherwise, you can't avoid
> | > introducing errors just by writing these numbers.
> |
> | I agree with you, Jaroslav. On the other hand, in the paper it is
> | written that R can compute the standard deviation with 15 correct digits.
> | Actually, Octave can compute the mean with 14 correct digits and with 15
> | correct digits with the patch I sent. The standard deviation with 8
> | correct digits.
>
> Since R is free software, we should be able to do just as well.  Have
> you looked at precisely what it does?
>
> jwe
>


More information about the Help-octave mailing list