search for: rpois

Displaying 20 results from an estimated 429 matches for "rpois".

2000 Nov 08
3
Strange means of numbers drawn from rpois
Dear all, I think I must be going crazy.... If I do > mean(rpois(1000000, 14)) I get: [1] 13.50420 and again: > mean(rpois(1000000, 14)) [1] 13.49896 > mean(rpois(1000000, 14)) [1] 13.50161 > mean(rpois(1000000, 15)) [1] 14.49250 > mean(rpois(1000000, 15)) [1] 14.49897 > mean(rpois(1000000, 14.5)) [1] 13.99689 > mean(rpois(1000000, 14.5)) [1] 1...
2000 Apr 30
2
rpois hangs (PR#530)
Full_Name: Kjetil Kjernsmo Version: Version 1.0.0 OS: osf1 Submission from: (NULL) (129.240.28.227) Dear all, I have come across another really strange bug in rpois. If I do > rpois(1, 1000000 * rpois(1, 10000)) sometimes it hangs, and hangs... On my XP1000 alphaev6 workstation, it seems to happen more frequently than on other machines. I started a session on an older computer, and from the start, it looks like this: > rpois(1, 1000000 * rpois(1, 10000...
2003 Aug 26
4
Viewing function source
I know I should probably RTFM for this question, but could someone tell me if R supports the idea of "viewing source" on any particular function you want to use? If I want to "view source" on the rpois() function, for example, can I do somethink like: source(rpois) To see how the function is implemented? Regards, Paul Meagher Datavore Productions 50 Wood Grove Drive Truro, Nova Scotia B2N-6Y4 1.902.895.9671 www.datavore.com
2009 Oct 06
3
rpois formula
Hi all, It's been a while since i've used R and I can't remember how to do the following: i have a = rpois (100000, x) b = rpois (100000, y) what is the code to show that a>b, b>a and a=b to show just the number of occurances? at the moment when I type a>b I get a nice long list of true or false. so i'm hoping to have the following a>b > 35000 b>a > 25000 a=b > 40000 than...
2006 Jul 27
3
bug with rpois (PR#9106)
The R poisson random generator rpois appears to have a bug for theta 10 or larger. The sample mean of the pseudo variates is too small: sample mean approx theta - 0.5. I use Version 1.1.1 (August 15, 2000) Of R on a Dell OptiPlex computer with the Windows XP Professional operating system. Has this bug been fixed in later versions?...
2020 Jan 19
2
rpois(9, 1e10)
Hello, All: ????? Consider: Browse[2]> set.seed(1) Browse[2]> rpois(9, 1e10) NAs produced[1] NA NA NA NA NA NA NA NA NA ????? Should this happen? ????? I think that for, say, lambda>1e6, rpois should return rnorm(., lambda, sqrt(lambda)). ????? For my particular Monte Carlo, I have replaced my call to rpois with a call to the following: ?rpois. &lt...
2012 Mar 16
2
Elegant Code
Hi, Can anyone help to write a more elegant version of my code? I am sure this can be put into a loop but I am having trouble creating the objects b1,b2,b3,...,etc. b1 <- rigamma(50,1,1) theta1 <- rgamma(50,0.5,(1/b1)) sim1 <- rpois(50,theta1) b2 <- rigamma(50,1,1) theta2 <- rgamma(50,0.5,(1/b2)) sim2 <- rpois(50,theta2) b3 <- rigamma(50,1,1) theta3 <- rgamma(50,0.5,(1/b3)) sim3 <- rpois(50,theta3) b4 <- rigamma(50,1,1) theta4 <- rgamma(50,0.5,(1/b4)) sim4 <- rpois(50,theta4) b5 <- rigamma(50,...
2000 Nov 08
0
Re: [R] Strange means of numbers drawn from rpois (PR#730)
Kjetil Kjernsmo <kjetil.kjernsmo@astro.uio.no> writes: > On 8 Nov 2000, Peter Dalgaard BSA wrote: > > >> > range(sapply(1:2000, function(n) mean(rpois(10000, c(15,15+1e-8))))) > >> [1] 14.8692 15.1200 > > > >AHA! Spotted, I think. > > Wow! Great, that was fast! > > >It is possible to return from rpois in step N, > >in which case the initialisations in step P are not performed in that > >invokation...
2020 Jan 19
2
rpois(9, 1e10)
On 2020-01-19 09:34, Benjamin Tyner wrote: >> ------------------------------------------------------------------------ >> Hello, All: >> >> >> ? ????? Consider: >> >> >> Browse[2]> set.seed(1) >> Browse[2]> rpois(9, 1e10) >> NAs produced[1] NA NA NA NA NA NA NA NA NA >> >> >> ? ????? Should this happen? >> >> >> ? ????? I think that for, say, lambda>1e6, rpois should return rnorm(., >> lambda, sqrt(lambda)). > But need to implement carefully; rpois shoul...
2020 Jan 19
2
rpois(9, 1e10)
So imagine rpois is changed, such that the storage mode of its return value is sometimes integer and sometimes numeric. Then imagine the case where lambda is itself a realization of a random variable. Do we really want the storage mode to inherit that randomness? On 1/19/20 10:47 AM, Avraham Adler wrote: >...
2020 Jan 23
1
[External] Re: rpois(9, 1e10)
On 1/20/20 12:33 PM, Martin Maechler wrote: > > It's really something that should be discussed (possibly not > here, .. but then I've started it here ...). > > The NEWS for R 3.0.0 contain (in NEW FEATURES) : > > * Functions rbinom(), rgeom(), rhyper(), rpois(), rnbinom(), > rsignrank() and rwilcox() now return integer (not double) > vectors. This halves the storage requirements for large > simulations. > > and what I've been suggesting is to revert this change > (svn rev r60225-6) which was purposefully and d...
2020 Jan 19
2
rpois(9, 1e10)
...".? This is part of a vignette I'm developing, available at "https://github.com/sbgraves237/Ecfun/blob/master/vignettes/time2nextNuclearWeaponState.Rmd". This includes a simulated mean of a mixture of Poissons that exceeds 2e22.? It doesn't seem unreasonable to me to have rpois output a numerics rather than integers when a number simulated exceeds .Machine$integer.max.? And it does seem to make less sense in such cases to return NAs. ?????? Alternatively, might it make sense to add another argument to rpois to give the user the choice?? E.g., an argument "bigO...
2000 Jan 14
2
Matrix output from drawing functions
Dear all, I'm a bit confused about the output from functions that generates random values, e.g. rpois. I'm using 0.65.1 on Digital UNIX alphaev6. If I say > rpois(10,5) output is not unexpectedly: [1] 4 6 5 7 6 5 2 2 5 3 but I figured that if I go: > rpois(10,1:10) I would get a 10x10 matrix as output, with random values for each of the vector elements in the row vectors, but I'm g...
2006 Jun 01
4
A coding question
Dear List: I have the follow code: y <- replicate(10,replicate(8,sum(rnorm(rpois(1,5))))) Now I need to apply the following condition to _every_ randomly generated Normal number in the code above: x - max(0,x-15) + max(0,x-90), where x represents the individual Normal numbers. In other words, the said condition needs to be applied before replicate(...(replicate(...(sum(...))...
2000 Nov 08
1
Re: [R] Strange means of numbers drawn from rpois (PR#730)
...ng stuck around 15.15 and sometimes >around 14.5. Others report no problems. Very strange. I've seen one >case where it apparently shifted from one regime to the other.) Yes, it does that here too.... The following is a verbatim excerpt from my session: > sapply(1:15, function(n) mean(rpois(1000000, n))) [1] 0.999031 2.000444 3.002296 3.997795 4.998880 5.995267 7.001894 [8] 7.999983 9.000267 9.513537 10.507142 11.502634 12.498944 13.498615 [15] 14.502410 > rpois function (n, lambda) .Internal(rpois(n, lambda)) > version _ platform alphaev6-dec-osf4.0e arch...
2020 Jan 19
2
rpois(9, 1e10)
...numbers using the standard normal approximation to the Poisson for those extreme cases.? [For a Poisson with mean = 1e6, for example, the skewness (third standardized moment) is 0.001.? At least for my purposes, that should be adequate.][1] ????? What are the negative consequences of having rpois return numerics that are always nonnegative? ????? Spencer [1]? In the code I reported before, I just changed the threshold of 1e6 to 0.5*.Machine$integer.max.? On my Mac, .Machine$integer.max = 2147483647 = 2^31 > 1e9.? That still means that a Poisson distributed pseudo-random number j...
2020 Jan 19
0
rpois(9, 1e10)
...un/blob/master/vignettes/time2nextNuclearWeaponState.Rmd" > <https://github.com/sbgraves237/Ecfun/blob/master/vignettes/time2nextNuclearWeaponState.Rmd>. > This includes a simulated mean of a mixture of Poissons that exceeds 2e22. > It doesn't seem unreasonable to me to have rpois output a numerics rather > than integers when a number simulated exceeds .Machine$integer.max. And it > does seem to make less sense in such cases to return NAs. > > > Alternatively, might it make sense to add another argument to rpois > to give the user the choice? E.g.,...
2020 Jan 20
3
[External] Re: rpois(9, 1e10)
On 1/20/20 4:26 AM, Martin Maechler wrote: > Coming late here -- after enjoying a proper weekend ;-) -- > I have been agreeing (with Spencer, IIUC) on this for a long > time (~ 3 yrs, or more?), namely that I've come to see it as a > "design bug" that rpois() {and similar} must return return typeof() "integer". > > More strongly, I'm actually pretty convinced they should return > (integer-valued) double instead of NA_integer_ and for that > reason should always return double: > Even if we have (hopefully) a native 64bit...
2020 Jan 19
0
rpois(9, 1e10)
...ndard normal approximation to the Poisson for those extreme cases. > [For a Poisson with mean = 1e6, for example, the skewness (third > standardized moment) is 0.001. At least for my purposes, that should be > adequate.][1] > > > What are the negative consequences of having rpois return numerics > that are always nonnegative? > > > Spencer > > > [1] In the code I reported before, I just changed the threshold of 1e6 to > 0.5*.Machine$integer.max. On my Mac, .Machine$integer.max = 2147483647 = > 2^31 > 1e9. That still means that a Poisso...
2020 Jan 19
0
rpois(9, 1e10)
...be integral. Would hitting everything larger than maxint or maxlonglong with floor or round fundamentally change the distribution? Well, yes, but enough that it would matter over process risk? Avi On Sun, Jan 19, 2020 at 11:20 AM Benjamin Tyner <btyner at gmail.com> wrote: > So imagine rpois is changed, such that the storage mode of its return > value is sometimes integer and sometimes numeric. Then imagine the case > where lambda is itself a realization of a random variable. Do we really > want the storage mode to inherit that randomness? > > > On 1/19/20 10:47 AM, A...