GithubHelp home page GithubHelp logo

ecsendmail / multiversecontagion Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 3.0 1.88 GB

HTML 72.82% R 0.01% Shell 0.01% JavaScript 26.75% Logos 0.32% Batchfile 0.01% Jupyter Notebook 0.10% Python 0.01%

multiversecontagion's People

Contributors

ecsendmail avatar ashlinrichardson avatar

Stargazers

 avatar

Watchers

 avatar  avatar

multiversecontagion's Issues

RPH estimates (Risk Per Hour)

Hi Ash:
These were computed by hand....

RPH stands for Risk Per Hour, but here's how it goes...in a Universe, if the first ten infections as recorded in the console.log took place in X hours (just find the 10th infection in Universe U and its generation number), then the metrics are either:

   10/X which is the number of infections per hour (there being X hours)
   X/10 which is the number of generations between each infection on average

So we chose this metric X/10 which is a large integer rather than a small decimal...
We have now come to call this metric "theta"

with theta-10 being the generation space for 1st ten, theta-20 for the 1st 20, etc..

Note that theta-20 can be calculated two ways:

from 1st to 20th infection and the total generations: this is Theta-20

from gen of 10th infection to gen of 20th infection / 10 = theta-20 this is an incremental theta and has some sensitivity compared to other infection spans - ie is it taking longer for the next ten, or shorter, on average? this shows us how the epidemic is moving....

These needed me to calculate them by hand, since the console.log data were not being captured, but printed out....

Ernie

Population size & transmission chains

Hi:
I will get to the line numbers later....
The answer to (2) is that the population has to be initialized, and there are variables set by reading the csv files before the initialization routines.....so if no csv files, could go straight to initialization and defaults, but this would have to be done in the code to suppress reading csv files....right now, if you go straight to clock advance, there would be faults.
The answer to (3) is that you have nailed it....I think that your algebraic definition is unnecessarily formal.....but there are some constraints:
a - no cycles ie if Link(a,b) and Link(b,c) then there the set of links L(c,a) is EMPTY
b - if a link L(a,b) means that a infects b, then b occurs only once in the entire set {L}

Ernie

On Sat, Nov 7, 2020 at 2:58 PM Richardson, Ashlin CITZ:EX [email protected] wrote:
Hi Ernie,

A few questions to help me pick this back up..

  1. could you please confirm code line numbers (relative to your latest version that's online in the repo) for the following things (if they exist in the code, whereas if some of them are calculated manually, please forward a spreadsheet which illustrates the calculation to be automated):
  • R0
  • Critical exposure times
  • Hazard radius
  • Mingle factor
  • RPH estimates

I didn't list the transmission chain aspect since (presumably) the console would show me where that is

  1. Do you have a method for varying the population size, other than manually generating input files? I wasn't clear on whether you have an existing method to "automatically" generate or revise the inputs, or randomly sample slices from them etc.

  2. Please clarify a terse definition for "chain of transmission"?
    E.g. given the ordered pairs I_i = (x_i, y_i) I_i meaning x_i infects y_i..

..a chain of transmission is a sequence:
I_1, I_2, .., I_n (i \in 1,...,n)
such that:
y_(i + 1) = x_i (\forall 1 < i < n)?

Automating counting length of chains looks fun / easy, want to check I'm clear on the details first
cheers

Ash

Hazard Radius

Hi Ash:
The Hazard Radius exists for every person...see L1062 function initPerson( )...

You will see that there are two "sizes" .....P.baseSize and P.currSize...

P.baseSize is a stochastic value from the function call stochast(VLradius,0.05) which returns the VLradius+/- 5% drawn from a random number * 5% of VLradius..

So VLradius is a global L795 set to 5
However, the GUI in the FixedUniverse view permits the use to set this value to something else eg 2.3 (real number, not just integer)...in L1612 function showPRadius

Note that this function sets the new baseSize for P but changes the new currSize to be similar to the ratio of the previous currSize to baseSize prior to resetting them....so there is a new currSize as well, whenever the VLradius is reset.

The P.currSize is determined by the viral load x base Size in the function, and is used to draw the size, as well as in determining transmission...

Is the currSize ever reset to the baseSize? or vice versa? Not at this point

Note that limits have been set in the determination of size vs viral load so that the size does not overwhelm the arena....L2218 in reSizeAll( )

Ernie

estimate Reproduction Number and Generation Time

The routine Mtabulate L2559 in simulation.js contains the calculation of R0 for the multiverse, in L2571 ff (this means following....) ....

Please note that both M.xxx (the multiverse) and U.xxxx (the Universes) each keep their own count of R0

and this is done by finding the ORANGE count (persons that have become INERT), and adding the kill=count M.susCt (the count of susceptible which have been infected by the infective transmitter....

This determination is done in P[x].susCt.......in the routine VLtransfer L1918 and the part that deals with infection is in L.1966, L 1972

If you do the math, then at the end when everyone is INERT, the total number of infectives divided by the total number of oranges is near 1...

I suppose that what I should be doing is not dividing by total number of oranges but only those oranges that have non-zero P.susct......

This is probably an error in calculation, and should be tested to see what the difference is between oranges that have no history of infection, and the total number...

Ernie

Mingle Factor

Hi Ash:
The Mingle Factor is again a global which can be reset in a number of ways. First, Mingle Factor applies to both Universes and to persons:

  1. Universes
    Each Universe in its initialization L925 function initUniv( ) has the line
    U.minglf =1
    However, in the FixedUniverse GUI, each view of a Universe (select Universe) show the specific Universe...in that view, the menu button MingleFactor can be selected, eliciting a prompt....the new minglf for that universe can be entered....this is then reduced by a factor of 10 internally (so entering 10 is the same as the default minglf =1 [don't ask why ---- this is a kludge I think]

  2. Each person in the CSV file when moving to another Universe, can have a specific mingleFactor for that person, as seen in initP L1062, where L1084 shows P.minglf = 1;

  3. When it comes time to propose a move, these two minglfactors are combined in proposeMove( ) in L1765

    sumMing = U[vU].minglf * G.minglf

so if the default of 1 and 1 holds, the total sumMing is 1, and the proposed X and Y coordinated do not change

If the Universe prompt returns 1.2 the factor is .12 and if the minglF for the person in the universe is 3 then the effect on proposed X and Y is .36......

If the prompt was 12, the final effect is 3.6 X proposed delX and delY

That's how it works at present...

Ernie

basic simulation for compartmental models

Hi @MahdiHajiabadi,
A warm up exercise @kmoselle suggested: with code available already so no need to implement from scratch...Trying the code in the article and adding some adaptation of this code to our repo would be a great resource! Possible modifications could include:

  • adding an option to run in non-interactive mode...which is a step that (to be confirmed by @ecsendmail and @kmoselle) would support the work plan

Thoughts?
cheers

Reference:

add for loops

Hi @ecsendmail @kmoselle

IF I see in the Simulation Engine things iterated explicitly (that could use a for loop but don't yet...)
e.g.

canp1
ctx1
.. canp2
ctx2
..
etc...

at
this line

Would you be OK with me rewriting those with for loops? In that case the for loop would have N=9
cheers

Ash

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.