From carnellr at battelle.org  Sun Jun 11 06:03:10 2006
From: carnellr at battelle.org (carnellr at battelle.org)
Date: Sun, 11 Jun 2006 06:03:10 +0200 (CEST)
Subject: [Rd] qunif() behavior with Inf arguments (PR#8958)
Message-ID: <20060611040310.DF26B19FE8@slim.kubism.ku.dk>

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



[Rd] qunif() behavior with Inf arguments (PR#8958)
carnellr at battelle.org