Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C Programming
Poisson distribution for a newbie
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Martin Ambuhl, post: 2449412"] Your question has nothing to do with the C programming language. Even so, I will provide you with some of the information that you should have already, WARNING! Everything that follows is off-topic. a) It's "Poisson", not "poison" b) The Poisson distribution is not "a bell shaped curve". A Poisson distribution is given by Pr(X = x) = exp(-lambda) * pow(lambda,x) / factorial(x) There is *one* external parameter, lambda The mean and variance of the distribution are each lambda, the skewness is 1/sqrt(lambda), and the kurtosis is 3+1/lambda. The distribution is most easily computed by an iterative procedure, since Pr(X = 0) = exp(-lambda) and Pr(X = x) = Pr(X = x-1) * lambda / x; You want to compute this once, filling an array with the cumulative values, and using rand() to obtain a value to compare against this array. So if x = rand()/(1. + RAND_MAX); and if x > cum_freq_array[i-1] and x <= cum_freq_array[i] then there were i events in the time period. Since this is not a C issue, I make no claim that any of the above is correct. Check it yourself.[/i] [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C Programming
Poisson distribution for a newbie
Top