[R] Greater than 1 or less than 1?

Zhen Chen zchen at cceb.upenn.edu
Mon Jun 21 00:32:46 CEST 2004


I have problem evaluating the expression h = exp(x)/(exp(exp(x))-1) for 
large negative x. This expression is actually the probability
that y = 1 when y is a Poisson random variable truncated at 0, hence 
must satisfy 0 <= h <= 1. However, when
x < -18, I may get an h value that is  larger than 1 while the true 
value should be a quantity that is smaller than but very close to 1.
For example when x = -19, h = 1.00000000031174. I tried to use 
different form of h and none of
them give me an h value that is less than or equal to 1. I also tried 
to find patterns, but discovered none: for some x < -18, h is below 1; 
for others
h is greater than 1. Is there any trick that enables me to obtain 
theoretically correct results from this expression?

Thanks.

Zhen Chen, Ph.D.
Assistant Professor of Biostatistics
Department of Biostatistics & Epidemiology
University of Pennsylvania School of Medicine
423 Guardian Drive -- 625 Blockley Hall
Philadelphia, PA  19104-6021

voice:  215-573-8545
fax:    215-573-4865
email:  zchen at cceb.upenn.edu




More information about the R-help mailing list