Re: Applying Poisson methods
- From: Richard Ulrich <Rich.Ulrich@xxxxxxxxxxx>
- Date: Wed, 12 Oct 2005 14:25:26 -0400
HAZARD. waste of time.
On Wed, 12 Oct 2005 01:59:47 EDT, "\"Luis A. Afonso\""
<licas_@xxxxxxxxxxx> wrote:
> Mr.Ulrich, please
>
> What you did? (I am astonished, astonished, astonished!)
> As far as I could see, you wrote a program using MY algorithm, not YOURS.
It is certainly not your algorithm. Are you unable to read code?
It follows my comment, from October 7 --
====
My main Posting point was that the Uniform distribution might
be what was needed. In this case, it is not required, but it
still is a possible option. Now that the OP has offered detail,
75 clients per hour, here is how to generate (say) 1000 hours
of Poisson data before you do anything more.
Set up a vector for Hours(0..999).
1) Take a random number times 1000; truncate to integer J.
2) Increment Hours(J) by 1.
3) Repeat 75 thousand times.
"Hours" will have 1000 elements with an average of 75.
====
This, the one a gave the detailed algorithm for, is the one
I had in mind when I ventured an estimate about timings.
I see that what I posted later could leave it ambiguous,
concerning which algorithm I was pointing to. But the
"preliminary setup time" before doing randomization
would be the only *necessary* difference between your
use of an inverse CDF and mine. So that should not be
any issue. I'm all in favor of computing the cumulative
CDF as you show, so long as it does not break.
This further demonstrates the problems *you* create by
inadequate citing.
> We, the Readers do not have need to prove that this is a completely adequate one!
> Is YOUR. Method that YOU described as follows:
> ***Do you really want to simulate the Poisson counts directly? There's probably a better way, but I immediately think of reversing the Normal approximation to the Poisson (using the square root of the counts).*** (quoting from 10//05)
> ***Using the square root approximation is not great, but it could serve when the N is large enough that Licas's answer will break.*** (from 10/7/05)
> ***Well, no one suggested using that. I did suggest, twice, explicitly, using the square root approximation. That's the one that says, "Square root of Poisson is distributed approximately normally, with SD= 0.5".*** (from 10/8/06)
Here is how to generate the CDF from the normal approximation
to the Poisson, for lambda=75:
1) Take the square root of 75, to save as a constant M.
- For each integer, do something like this example for 75.
2) Take the T= square root of 75.5, which is the upper limit
of (74.5,75.5).
3) Compute z= 2* (sqrt(T) - M) ; it is "times 2" because the SD= 0.5.
4) Obtain the CDF or "p-value" for z. For 75, this is slightly
more than 0.50.
5) Do the same for all values within a reasonable z range.
Of course, it would also be possible to use the inverse-normal
"on the fly", and I don't know what the trade-off would be for
speed. Solve the equation above for T:
1) Obtain a random z (normal deviate).
2) Divide z by 2, and add to M.
3) Square that to get T; round off to the nearest integer.
- I hope that I didn't get careless with the logic or
screw it up with typos.
>
> DID I BECOME MAD?
Are you crazy? Yes, some; at least, in the internet "persona"
that you present. The normal person is not so rude, so often.
The normal person has a better has a better picture of
how much or how little he knows about a subject.
--
Rich Ulrich, wpilib@xxxxxxxx
http://www.pitt.edu/~wpilib/index.html
.
- References:
- Applying Poisson methods
- From: Curious
- Applying Poisson methods
- Prev by Date: Re: The illusion of the bootstrap technique
- Next by Date: Re: beginner's question about using R
- Previous by thread: Re: Applying Poisson methods
- Next by thread: Re: Applying Poisson methods
- Index(es):
Relevant Pages
|