[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] increase network size with poisson probability
From: |
Tamas Nepusz |
Subject: |
Re: [igraph] increase network size with poisson probability |
Date: |
Tue, 08 Feb 2011 11:35:04 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101208 Lightning/1.0b2 Thunderbird/3.1.7 |
> I would like to change this mechanism to reflect poisson probability, but I
> need a hint on how to do this. I see there's no random.poisson, but maybe the
> random.expovariate(lambd) can do the job:
The numpy.random module in Numeric Python has a poisson() function. You
can then generate a Poisson-distributed random number; however, it is up
to you to interpret this number. The Poisson distribution is discrete,
so the number you draw from the distribution cannot be compared with a
probability value (well, it can, but it does not make sense). You can
interpret it as the number of nodes to be added before moving on to the
next step, though. Or, you can make use of the fact that the *waiting
time* distribution of a Poisson process is exponential, so you can draw
a number from the exponential distribution and use it as the number of
time steps to be taken *without* adding a new node.
--
T.