[Rd] qunif() behavior with Inf arguments (PR#8958)

carnellr at battelle.org carnellr at battelle.org
Sun Jun 11 06:03:10 CEST 2006


Full_Name: Rob Carnell
Version: 2.3.0
OS: Windows XP sp 2
Submission from: (NULL) (131.167.72.220)


Thank you for all you work on R project!

I noticed the following behavior today.  It is what I believe to be an
inconsistency.

> qunif(.5, 0, Inf)
[1] Inf
> qunif(.5, -Inf, 1)
[1] NaN
Warning message:
NaNs produced in: qunif(p, min, max, lower.tail, log.p) 

I believe they should yield the same result, which is whatever you feel most
appropriate.  I think that arguments can be made for either.

The lower.tail parameter does not change the result.

> qunif(.5, 0, Inf, lower.tail=FALSE)
[1] Inf
> qunif(.5, -Inf, 1, lower.tail=FALSE)
[1] NaN
Warning message:
NaNs produced in: qunif(p, min, max, lower.tail, log.p) 

As a side note..

> qunif(.5, -Inf, Inf)
[1] NaN
Warning message:
NaNs produced in: qunif(p, min, max, lower.tail, log.p) 
 
which seems to be an appropriate result.

Of course, it is possible that I don't understand the reasons for this behavior,
but I can't find anyone who can explain it or any documentation for it.  S-Plus
7.0 does the following as well:

> qunif(0.5, 0, Inf)
[1] Inf
> qunif(0.5,  - Inf, 1)
[1] NA
> qunif(0.5,  - Inf, Inf)
[1] NA


Rob



More information about the R-devel mailing list