GiulioRossetti / ndlib

Network Diffusion Library - (for NetworkX and iGraph)
http://ndlib.readthedocs.io/
BSD 2-Clause "Simplified" License
277 stars 80 forks source link

Weird Way to update the Infection Status of SI model #227

Closed FeynmanDNA closed 2 years ago

FeynmanDNA commented 2 years ago

in ndlib/models/epidemics/SEISModel.py, in the commit https://github.com/GiulioRossetti/ndlib/commit/f80b1448db339fac6fa1cb63c093e714cd7add4a#diff-81ae80e5ab1d17420f19b47e51b93b8999cee1ad70db53e2aff5309ad3cd8899 the beta * num_infected_neighbors was changed into a 1 - (1-beta)**num_infected_neighbors.

I am wondering why was there such a change in the formula? The probability of beta should be linearly scaled with the number of infected neighbors right? Thanks for the hard work!

FeynmanDNA commented 2 years ago

Hi i went through the past issues and discovered that this beta vs num_infected_neighbors have been discussed before

But I kind of agree with https://github.com/GiulioRossetti/ndlib/issues/96#issuecomment-491229424 the beta is probability of getting the infection per I->S link right?

If we adopt the 1 - (1-beta)**num_infected_neighbors, then what is the definition of beta? thanks!

GiulioRossetti commented 2 years ago

It is not weird at all.

This is the probability of getting infected considering multiple independent contacts with infected individuals (each contact with prob beta of passing the infection).

FeynmanDNA commented 2 years ago

i see.

but is the previous approach linearly scaling the beta with num of infected neighbors wrong? Quite a number of publications use that calculation method, for example your 2018 publication "Diffusive Phenomena in Dynamic Networks: A Data-Driven Study": image

GiulioRossetti commented 2 years ago

That's likely a typo.

Let's say that a linear scaling is not correct because it doesn't guarantee that the final probably value lies in [0,1]. Moreover, it doesn't model the independence of multiple infection sources.

FeynmanDNA commented 2 years ago

i see. thank you very much for the clarification!