question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Complex vs Simple Gillespie in Non-pharmaceutical intervention situations

See original GitHub issue

Thanks a lot for this very useful module!

I have started working with it and I was wondering if you could possibly help me deciding which simulation function is the best for what I want to do. I have few questions also regarding visualizations.

I am trying to build a high fidelity model by using a SIR/SEIR model along with a custom model that generates beliefs over e.g. social distancing, mask-wearing etc. In other words each node will have a property (e.g. belief that masks are good, thus high probability for wearing a mask which results in lower transmission rate) that will get updated according to a behavioral model (e.g. opinion model, Bayesian model, etc) and it will use information of the neighboring nodes. Then the simulation will return the counts of S,I,R, and the number of masked/unmasked people.

I would like to be able to use node properties to handle when someone wears mask or not - e.g. if majority of surrounding nodes believe in masks). I would also like to use this external behavioral model to define when someone’s belief changes at the same timestep that the Gillespie model runs the simulation.

From what I have understood, the most flexible function for running simulations on networks that your module has is the Gillespie_complex_contagion. Do you think that I need this function or the simple version of it? Shall I assign the ‘Mask wearing’ as a node property or status (such as S,I,R)?

Also I am not 100% sure about their differences (complex vs simple) especially these parts:

Initially intended for a complex contagion.  However, this can allow influence
from any nodes, not just immediate neighbors.

and

This does not handle complex contagions. It assumes that when an individual changes status either he/she has received a “transmission” from a single neighbor or he/she is changing status independently of any neighbors

I see from the examples also that you are adding additional networks (specifying self transitions, or node-to-node transitions along with custom functions when you are using the simple version but not when you are using the complex version)

If you could elaborate more on how actually you calculate transmission in each function would be great (if you need to use math to show me how a transmission is estimated in the two different cases please do!). I read a notebook with another example of yours in DynamicProcessesOnNetworks repo but still it is not clear to me.

It seems to me that the problem I am dealing with is like having 2 “diseases” (or 2 networks), one is the opinion and how it propagates and changes the mask wearing probability and the other is the actual infection which is affected by the transmission rate of the nodes. I have already looked at your 2 diseases example but I am not sure if this is the best approach. Mainly I am thinking to use either the simple or complex Gillespie function with some custom functions. Any help would be great!

For graphics: I tried to use **nx_kwargs (e.g. node_size, edgecolors='black') and although the node size changes nodes appear always without outline (strangely as from the code it seems that the animation function draws nodes and edges separately). I would like to have different colors or even alphas (for example indicating the probability that a node is believing in mask wearing).

I have seen the effort that you have put in the module and documentation and in any case that this leads to any publication or presentation I will cite your work as I really appreciate it.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
joelmillercommented, Jul 28, 2020

I’ll try to come back to this in a day or so with an example of a complex contagion. I thought I’d created one, but I don’t see it in the documentation.

0reactions
ConstantinosMcommented, Aug 1, 2020

It is fine Joel! I really appreciate your help. Yes please if you could get an example with non trivial state transitions would be great. I have seen the example you mentioned and another example that you have with complex_contagion but they do not account for complex transitions as my example above (e.g. from state A you can get to state B or C with some probability).

As a start I would like to have a rule similar to the one I have in my example. So someone will update his current probability of wearing a mask (node attribute) according to the weighted average of probabilities of wearing a mask of his close neighbors. I know that this is a monotonic function that eventually will convert everyone into a mask wearer but for now it is fine. I can try different rules later if I have an initial model that can work on. In my example I initialized the mask probability attribute from a uniform and this also can be changed as well to reflect various other characteristics (e.g. education, political affiliation etc)

Thank you again so much!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Non‐pharmacological interventions for perceptual disorders ...
Two of these trials compared active to placebo intervention. ... can affect these simple and complex perceptual abilities.
Read more >
Non-pharmaceutical interventions and the emergence of ...
We show how the strength and timing of NPIs, along with the life-history characteristics of the variant, affect its emergence and impact on...
Read more >
Nonpharmaceutical Interventions (NPIs) | CDC
Nonpharmaceutical Interventions (NPIs) are actions, apart from getting vaccinated and taking medicine, that people and communities can take to help slow the ...
Read more >
Generalised Gillespie Algorithms for Simulations in a Rule ...
In this section, we consider different examples of rule-based epidemiological models and simulate them based on the stochastic algorithms in ...
Read more >
Methodological Differences in Clinical Trials Evaluating ...
Finally, nonpharmacological treatment is usually complex and difficult to ... In situations in which care providers could influence the success of the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found