Skip to content
Prev 132635 / 398506 Next

Numerical precision problem

On 21/12/2007 2:52 PM, C.Rosa at lse.ac.uk wrote:
No, the limitations are inherent in the floating point representation 
that R uses.
In this particular case, it's easy:  make use of the symmetry of the 
distribution.  If you want the 1-epsilon quantile of a normal with mean 
mu, find the epsilon quantile, and reflect it through mu:

mu <- 3
-qnorm(1e-30, mean=-mu)

More generally, you can make use of the log.p argument to the quantile 
functions, and the fact that log(1-epsilon) is close to -epsilon:

qnorm(-1e-30, mean=mu, log.p=TRUE)

Duncan Murdoch