huilisabrina / covid-19-simul

Efficient simulation and graphical modeling of Covid-19 spread
1 stars 0 forks source link

Monte Carlo Simulations #4

Open huilisabrina opened 4 years ago

huilisabrina commented 4 years ago

Hi guys @smwu @intekhab8 @beancamille ,

Some updates on the Monte Carlo simulation! I've drawn a schema of the workflow below (I really like thinking about these things in a chart! :)

Note that the three scripts (highlighted in red) have just been uploaded to the repo. Please take a look at monte_carlo.bash, which is what the following is illustrating, and let me know if you have any questions.

The new network_update_GF_monte_carlo.py is re-written based on network_update_GF.py so that the arguments from command line can be parsed out. It's like a mini software that we can call and use. All the parameters have default values so you can easily test it. It's very easy to do single runs using this script as well, just use the section called "SINGLE RUN". I've tested this using the single call, and attached those output to this post below.

My goal is to incorporate the changes that Inte or any of you will be making to network_update_GF.py back into this new script. For example, I'd change the default parameter values to whatever Inte found to be reasonable. And add the modified S_flow function to that one-to-many infections can occur per time step.

Monte_Carlo_Sim

Essentially, we can use a table (.csv file) to "dictate" what the input to each Monte Carlo run looks like. The bash script will parse out one row of the following table at a time, and run the simulation pipeline.

The output files (for each run) will look like the following:

Also, note that we can have duplicated rows in the "params_sim" file, so that there will be runs with identical parameters (with potentially different outcomes due to the inherent probabilistic nature of the updating functions).