I have a simple function with has "x <- rpois(1,4)" as its first step.
When I call this function repeatedly, I get believable values of x for a
while, but as soon as x=0 for one of the calls, it is ALWAYS equal to 0 for
the next however many calls (I have tried over 50). But if I execute the
statement "runif(1)" (for kicks, I decided to try "waking up" the random
number generator) at the command line and then call this function again,
it's back to normal, producing non-zero values for x again! What gives??
I have noticed unexpected strings of zeros in other situations as well,
some not even involving number generation. For example, I have a function
which generates "pch" plot labels according to values of a certain vector.
Sometimes it generates a sequence of "0" labels when there aren't any 0's
in the vector. Anyone else experience this behavior?
I'm running S-Plus 4.0 Rel. 3 in Win95 with 128 Mb RAM, and I have
replicated this behavior several times. (And by the way, the probability
of a Poisson rate 4 variate being 0 is less than 2%).
Thanks in advance for any clues to this mystery,
John
---------------------------------------------------------------
| John Castelloe phone: (319)335-2009 |
| Computer RA fax: (319)335-3017 |
| Dept. of Statistics web: http://www.stat.uiowa.edu/~jcaste |
| University of Iowa office: 269 SH |
---------------------------------------------------------------
-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news