springer-math / Mathematics-of-Epidemics-on-Networks

Source code accompanying 'Mathematics of Epidemics on Networks' by Kiss, Miller, and Simon http://www.springer.com/us/book/9783319508047 . Documentation for the software package is at https://epidemicsonnetworks.readthedocs.io/en/latest/
MIT License
150 stars 61 forks source link

SIR on Weighted Networks #57

Closed crinix16 closed 4 years ago

crinix16 commented 4 years ago

Hello,

I looked through the documentation but could not find what I am looking for. I want to run SIR model on weighted networks, where transmission rate is the edge weight, rather than simply constant for whole graph/simulation. This way I will be able to control the probability for different nodes/edges. Is there a model/way that already exists within EoN?

Thank you.

joelmiller commented 4 years ago

Hi

Yes - this is possible. Take a look at this example for the SIS case: https://epidemicsonnetworks.readthedocs.io/en/latest/examples/SIS_weighted.html

You'll need to set a transmission_weight, as well as tau (it looks like you want tau=1).

In the documentation: https://epidemicsonnetworks.readthedocs.io/en/latest/functions/EoN.fast_SIR.html#EoN.fast_SIR

Transmission_weight string (default None) the label for a weight given to the edges. transmission rate is G.adj[i][j][transmission_weight]*tau

There are also ways to allow you to make the transmission rate between two nodes be a function you create for those two nodes (and recovery rate as well). That's a bit more involved:

https://epidemicsonnetworks.readthedocs.io/en/latest/functions/EoN.fast_nonMarkov_SIR.html#EoN.fast_nonMarkov_SIR