|
I've been trying to get this response posted since
Friday morning. Acting on Jean Snow's (the list administrator)
advice I'm trying it having deleted some of the header information from
prior notes.
Yes, the FUZZBITS option was
added in Release 17. In releases 11-16, if you want the same results as you got
on releases up through 10, which all used the native Fortran rounding function DNINT
without any adjustments, equivalent to using 0 bits for fuzz, you can use the following
expression in place of RND to round non-negative values of a variable
x:
compute x_rounded = trunc(x) + (x - trunc(x) >= .5).
If the numbers involved can be negative, then you can use: compute x_rounded = ((-1)**(x < 0)) * (trunc(abs(x)) + (abs(x) - trunc(abs(x)) >= .5).
The second expression simply replicates the first on absolute values of x and then multiplies them by -1 if the original number was negative and 1 if it wasn't.
To Richard Ristow's question about changes over versions, general computations haven't changed, but the RND and TRUNC functions, which used simply the native Fortran functions with no fuzz accomodations, have been changed multiple times. In releases up through 10, SPSS used those native functions unaltered. That meant that the internal binary floating point number was compared with the cutpoint x.5 or x.0, for RND or TRUNC, and if it was less than the cutpoint, the rounding or truncation went down. Nothing was done to accomodate the possibility that the computed number was slightly smaller due to precision issues. We got many complaints from people who had numbers rounding down that would have rounded up if computed with infinite precision.So beginning with Release 11, we tried to accomodate those concerns. In Releases 11-16 you have several different attempts to accomodate complaints and expectations about rounding behavior, all of which essentially boiled down to us chasing our tails, as it's impossible to implement a solution that will produce what everyone wants under all circumstances. So in Release 17 we added the FUZZBITS option, assigning what we think is a reasonable default, and giving the user the ability to control things. The bottom line on this is that any time you make equality comparisons involving numbers computed using finite precision, you need to be careful. The loss of precision typically associated with computations in SPSS/PASW Statistics and other packages is typically small and inconsequential for most purposes, but when you impose cutpoints or make equality comparisons, it matters and you have to be careful. David Nichols On Behalf Of Peck, Jon Sent: Thursday, June 25, 2009 10:21 AM Subject: Re: [SPSSX-L] Rounding in different SPSS Versions Sorry, but I don't know the answer. I'd guess that the
info in the help for the oldest version it discusses would be the
closest. |
| Free forum by Nabble | Edit this page |
