[R] number point under-flow

2004-02-04 Thread Arne.Muller
Hello,

I've come across the following situation in R-1.8.1 (compile + running under
RedHat 7.1):

 phyper(24, 514, 5961-514, 53, lower.tail=T)
[1] 1
 phyper(24, 514, 5961-514, 53, lower.tail=F)
[1] -1.037310e-11

I'd expect the later to be 0 or some very small positive number. Is this a
number under-flow of the calculation? Do you think I'm safe if I just set the
result to 0 in these cases?

kind regards,

Arne

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] number point under-flow

2004-02-04 Thread Roger D. Peng
Did you compile with gcc-2.96?  I think there were some 
problems with the floating point arithmetic with that 
compiler (at least for the earlier versions released by Red 
Hat).

-roger

[EMAIL PROTECTED] wrote:
Hello,

I've come across the following situation in R-1.8.1 (compile + running under
RedHat 7.1):

phyper(24, 514, 5961-514, 53, lower.tail=T)
[1] 1

phyper(24, 514, 5961-514, 53, lower.tail=F)
[1] -1.037310e-11

I'd expect the later to be 0 or some very small positive number. Is this a
number under-flow of the calculation? Do you think I'm safe if I just set the
result to 0 in these cases?
	kind regards,

	Arne

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] number point under-flow

2004-02-04 Thread Arne.Muller
Hi,

yes, I did compile it with gcc 2.96 ... . Do you've an estimate on how bad
this error is, e.g. how much it effects the calculations in R?

kind regards,

Arne

 -Original Message-
 From: Roger D. Peng [mailto:[EMAIL PROTECTED]
 Sent: 04 February 2004 14:49
 To: Muller, Arne PH/FR
 Cc: [EMAIL PROTECTED]
 Subject: Re: [R] number point under-flow
 
 
 Did you compile with gcc-2.96?  I think there were some 
 problems with the floating point arithmetic with that 
 compiler (at least for the earlier versions released by Red 
 Hat).
 
 -roger
 
 [EMAIL PROTECTED] wrote:
  Hello,
  
  I've come across the following situation in R-1.8.1 
 (compile + running under
  RedHat 7.1):
  
  
 phyper(24, 514, 5961-514, 53, lower.tail=T)
  
  [1] 1
  
 phyper(24, 514, 5961-514, 53, lower.tail=F)
  
  [1] -1.037310e-11
  
  I'd expect the later to be 0 or some very small positive 
 number. Is this a
  number under-flow of the calculation? Do you think I'm safe 
 if I just set the
  result to 0 in these cases?
  
  kind regards,
  
  Arne
  
  __
  [EMAIL PROTECTED] mailing list
  https://www.stat.math.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide! 
 http://www.R-project.org/posting-guide.html
  


__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] number point under-flow

2004-02-04 Thread Uwe Ligges
Roger D. Peng wrote:

Did you compile with gcc-2.96?  I think there were some problems with 
the floating point arithmetic with that compiler (at least for the 
earlier versions released by Red Hat).
Not (solely) a gcc-2.96 bug, since we get

  phyper(24, 514, 5961-514, 53, lower.tail=F)
[1] -3.325784e-12
on Windows compiled with gcc-3.3.1

Uwe Ligges


-roger

[EMAIL PROTECTED] wrote:

Hello,

I've come across the following situation in R-1.8.1 (compile + running 
under
RedHat 7.1):


phyper(24, 514, 5961-514, 53, lower.tail=T)


[1] 1

phyper(24, 514, 5961-514, 53, lower.tail=F)


[1] -1.037310e-11

I'd expect the later to be 0 or some very small positive number. Is 
this a
number under-flow of the calculation? Do you think I'm safe if I just 
set the
result to 0 in these cases?

kind regards,

Arne

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] number point under-flow

2004-02-04 Thread Bob Wheeler
It's not the compiler. pghyper() in SuppDists does the same thing. Its 
just rounding error. Set the result to 0 if it bothers you.

pghyper(24,514,53, 5961, lower.tail=F)
[1] -3.325965e-12
Roger D. Peng wrote:
Did you compile with gcc-2.96?  I think there were some problems with 
the floating point arithmetic with that compiler (at least for the 
earlier versions released by Red Hat).

-roger

[EMAIL PROTECTED] wrote:

Hello,

I've come across the following situation in R-1.8.1 (compile + running 
under
RedHat 7.1):


phyper(24, 514, 5961-514, 53, lower.tail=T)


[1] 1

phyper(24, 514, 5961-514, 53, lower.tail=F)


[1] -1.037310e-11

I'd expect the later to be 0 or some very small positive number. Is 
this a
number under-flow of the calculation? Do you think I'm safe if I just 
set the
result to 0 in these cases?

kind regards,

Arne

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html



--
Bob Wheeler --- http://www.bobwheeler.com/
ECHIP, Inc. ---
Randomness comes in bunches.
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] number point under-flow

2004-02-04 Thread Prof Brian Ripley
Try the latest patched version, as this has already been fixed.

 phyper(24, 514, 5961-514, 53, lower.tail=F)
[1] 1.084688e-13

o   [l]choose() use a more accurate formula which also slightly
improves p- and qhyper(); choose(n, k) now returns 0 instead
of NaN for k  0 or  n.



On Wed, 4 Feb 2004 [EMAIL PROTECTED] wrote:

 Hello,
 
 I've come across the following situation in R-1.8.1 (compile + running under
 RedHat 7.1):
 
  phyper(24, 514, 5961-514, 53, lower.tail=T)
 [1] 1
  phyper(24, 514, 5961-514, 53, lower.tail=F)
 [1] -1.037310e-11
 
 I'd expect the later to be 0 or some very small positive number. Is this a
 number under-flow of the calculation? Do you think I'm safe if I just set the
 result to 0 in these cases?


-- 
Brian D. Ripley,  [EMAIL PROTECTED]
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 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] number point under-flow

2004-02-04 Thread Prof Brian Ripley
Note R-patched and R-devel get more accurate answers.

On Wed, 4 Feb 2004, Uwe Ligges wrote:

 Roger D. Peng wrote:
 
  Did you compile with gcc-2.96?  I think there were some problems with 
  the floating point arithmetic with that compiler (at least for the 
  earlier versions released by Red Hat).
 
 Not (solely) a gcc-2.96 bug, since we get
 
phyper(24, 514, 5961-514, 53, lower.tail=F)
 [1] -3.325784e-12
 
 on Windows compiled with gcc-3.3.1
 
 Uwe Ligges
 
 
  -roger
  
  [EMAIL PROTECTED] wrote:
  
  Hello,
 
  I've come across the following situation in R-1.8.1 (compile + running 
  under
  RedHat 7.1):
 
 
  phyper(24, 514, 5961-514, 53, lower.tail=T)
 
 
  [1] 1
 
  phyper(24, 514, 5961-514, 53, lower.tail=F)
 
 
  [1] -1.037310e-11
 
  I'd expect the later to be 0 or some very small positive number. Is 
  this a
  number under-flow of the calculation? Do you think I'm safe if I just 
  set the
  result to 0 in these cases?
 
  kind regards,
 
  Arne
 
  __
  [EMAIL PROTECTED] mailing list
  https://www.stat.math.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide! 
  http://www.R-project.org/posting-guide.html
 
  
  __
  [EMAIL PROTECTED] mailing list
  https://www.stat.math.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide! 
  http://www.R-project.org/posting-guide.html
 
 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
 
 

-- 
Brian D. Ripley,  [EMAIL PROTECTED]
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 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html