Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Simulating number of occurrence Neg Binomial
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
Pete sherer

Posts: 78
Registered: 9/4/07
Simulating number of occurrence Neg Binomial
Posted: Apr 25, 2013 10:15 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi,
I have a question regarding how to simulate the number of random occurrence for tornado outbreak.

Say if I have mean annual occurrence rate of 0.3, I can put that parameter in Poisson and simulate the number of outcome for 100k years.
nSims = 100000;
lambda=0.3;
nOcc=poissrnd(lambda,[nSims, 1]);
sum(nOcc)/nSims % close to input lambda

I read that I can also simulate the random number of occurrence using negative binomial. My question is what R parameter should be. Below I use 1, but clearly the average number is way too large compared to lambda.
nOcc= nbinrnd( 1,lambda, nSims, 1);
sum(nOcc)/nSims

ans = 2.3341 % on average we will see 2.3 Tornado per year?

Do I understand it correctly?



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.