[R] Reduced Numerical Precision in 1.2.x?

Jeff_Lischer@mksinst.com Jeff_Lischer at mksinst.com
Wed Jan 31 13:56:56 CET 2001


I have noticed a definite loss of numerical precision going from 1.1.1 to
1.2.x under both Windows 98 and NT4 on x86 architecture. I noticed the
difference when using the abcnon() function in the bootstrap package, but I
think you could see the problem in any routine that involves subtracting
relatively large numbers from each other.

For the case I am looking at (see code below), the abcnon parameters bhat
and cq should exactly equal 0.0. Version 1.1.1 did calculate these
parameters to be close to 0.0, but for versions 1.2.x the errors increase
as the size of the problem incresases:

|----------------------+---------------+---------------|
|Case                  |Version 1.1.1  |Version 1.2.x  |
|                      |               |               |
|----------------------+---------------+---------------|
|test2.abc(10,20,10)   |bhat = 5.6e-10 |bhat = 5.5e-9  |
|                      |cq = 7.9e-7    |cq = -1.6e-6   |
|----------------------+---------------+---------------|
|test2.abc(200,400,200)|bhat = 0       |bhat = -2.2e-6 |
|                      |cq = 0         |cq = -2.9e-1   |
|----------------------+---------------+---------------|
|test2.abc(400,800,400)|bhat = 0       |bhat = -6.7e-6 |
|                      |cq = 0         |cq = -2.8e0    |
|----------------------+---------------+---------------|



In this last case, the confidence limits being calculated by abcnon  in
Version 1.2.x become meaningless because of the buildup of errors. I have
received some feedback that this problem also occurs on some Linux systems
(LinuxPPC) , but not on others (RedHat 7.0).

Code:

# main function to calculate confidence limits based on ABC method
test2.abc <- function(W,T,L) {
   # Create arrays with correct number of wins, ties, and losses
   w <- rep(1.0,W)
   t <- rep(0.5,T)
   l <- rep(0.0,L)
   N <- W + T + L
   # Call abcnon with the mean as the function being used
   test2.out <<- abcnon(c(w,t,l),function(p,x) {sum(p*x)/sum(p)},
                   alpha = c(0.025, 0.975))
   print(c(test2.out$stats$bhat))
   print(c(test2.out$constants$cq))
   print("Estimated 95% Limits")
   test2.out$limits
}

______________________________
D. Jeffrey Lischer, Ph.D.
Principal Mechanical Engineer
MKS Instruments, Inc.
E-Mail: Jeff_Lischer at mksinst.com


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list