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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Reduced Numerical Precision in 1.2.x?
2 messages · Jeff_Lischer@mksinst.com, Brian Ripley
On Wed, 31 Jan 2001 Jeff_Lischer at mksinst.com wrote:
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.
Did you use exactly the same compiler? If you used the pre-compiled versions you are almost certainly attributing this to the wrong cause, so please compile it yourself before making such statements, and do check that you have read the CHANGES file.
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.
Any badly-written routine, therefore? Rounding error is a fact of life, and I think your code is relying on its absence. I find the code in package boot to be a great deal more trustworthy than that in bootstrap.
Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._