Giter VIP home page Giter VIP logo

Comments (3)

dmb2 avatar dmb2 commented on July 23, 2024 1

The README says:

Heterogeneous populations: Nodes can be assigned different values for a given parameter by passing a list of values (with length = number of nodes) for that parameter in the constructor.

It doesn't seem like I have control over which nodes get assigned which values, just that I can control the fraction of nodes with a particular unique value.

I've got three graphs:
G_a, G_b, and G_s

Representing A (normal), B (vulnerable) and S (staff). I build the total graph G in the following way:

#join up G_a, G_s and G_b into a master graph
G = nx.union(G_a,G_s)
G = nx.union(G,G_b)

Then I loop over G and add edges between G_s and G_a and edges between G_s and G_b.

Then I run the following:

trials=100
fatalities=[]
for _ in range(trials):
    model = smodel.SEIRSNetworkModel(G=G, beta=0.2, sigma=1/5.2, gamma=1/12.39, initE=1,mu_I=[0.0018]*G.order())
    model.run(T=300,print_interval=0)
    fatalities.append(model.numF[-1])
print(sum(fatalities)/trials)
model.figure_basic(plot_percentages=False)
model.figure_infections(plot_percentages=False)

I want to figure out how to assign different mu_I for different ages. For instance, if I have the following age data about a population of 1000 people:

pop={'0-19':5,'20-44':300,'45-54':400,'55-64':200,'65-74':60,'75-84':30,'>85':5}

What I want is my graph to have a mu_I with 5 nodes for the <19 age group, another mu_I with 300 nodes for the 20-44 group and so on. If I didn't care about how these ages were structured, I could just make a list:
mu_I = [0.0]*5 + [0.1]*300 ...

However, I want to study how the Staff interact with the two populations.

Also: what are the units for mu_I? The other units are in reciprocal days and are relatively easy to check against other results. I put in a value of 0.035 as a high value for the mortality rate of 3.5% and my simulation said that 1/3 of the population would die. The documentation says this is the mortality rate per unit time, but there isn't good data for a daily mortality rate being reported.

Can you help me take data from here: https://www.cdc.gov/nchs/nvss/vsrr/covid19/index.htm and convert it to a good mu value?

from seirsplus.

ryansmcgee avatar ryansmcgee commented on July 23, 2024

Hello, yes our package should work for your use case. You can pass any network (in the form of a networkx model or adjacency matrix) into the network. This package doesn't generate networks, but as long as you can specify your desired networks using your own code you can them simulate the epidemic model on your networks of choice. You can also assign different parameter values to different nodes, for example if you wanted your A, B, or S populations to have different properties. Feel free to message me if you have any questions or issues setting up your scenarios!

from seirsplus.

dmb2 avatar dmb2 commented on July 23, 2024

After reading the code, it appears that for the case of modeling a heterogeneous network of individuals where their interactions can be grouped as described cannot be modeled by this code without careful bookkeeping of how the adjacency matrix is stored and how the individual parameters for those members is kept track of.

I have figured out a way to do my modelling without relying on the structure of the graph, and use the posterior numbers to project out the number of affected staff and residents. This is less than ideal since in these situations staff have many more interactions than residents have with each other.

from seirsplus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.