ryansmcgee / seirsplus

Models of SEIRS epidemic dynamics with extensions, including network-structured populations, testing, contact tracing, and social distancing.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

seirplus network heterogenous population types

dmb2 opened this issue · comments

commented

I'm trying to model SEIR situations that occur in nursing homes, cruise ships, and prisons where there is close contact between residents/inmates and staff contact between separate populations.

Specifically, I'm interested in the following:

If there are two separate populations A and B from the beginning, and the only thing common between them is a staff population S, how long does it take for an infection to spread from A to B given control over how densely connected the S graph is to A and B

If B is a more vulnerable population, what are the clinical outcomes in the following situations:

  • A and B co-mingle with a staff population connected to both A and B
  • A and B are separated with S being the only common branches

Is this the type of thing that the SIER plus framework can handle? I don't mind taking a stab at implementing a Gilllespie style implementation of this myself, but if SIER plus can do this off-the shelf it would help a lot.

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!

commented

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?

commented

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.