This is a really ignorant attempt at understanding covid19. I have no experience in these type of simulations or analyzing this kind of data. This repos contains programs that do modeling and plotting
- Python 3 installation that includes common libraries such as numpy and matplotlib.
- ffmpeg - Only useful for generating movies from the simulations
This repo does several things.
- It plots and fits the Itallian covid-19 data from the national government. E.g.
python3 ./src/plot_italy_data.py option_to_plot italy_data_file [log-lin] [index]
option_to_plot :
'hosp_w_sympt' : Hospitalized w/ Symptoms
'icu' : Intensive Care Units
'total_hosp' : All Hospitalized
'home_isolation': Home Isolation
'total_positive': All Positive
'new_positive' : New Positive
'discharged' : Discharged
'dead' : Dead
'total_cases' : Total Cases
'swabs' : Swabs
italy_data_file : the path to the dpc-covid19-ita-andamento-nazionale.csv
[log-lin or lin-lin] : optional, plot y axis in natural log, if straight line
then experiencing exponential growth. If not specified,
log-lin assumed
[slice_index] : for fitting, e.g.
if = -10, it will fit the last 10 points
if = 10, it will fit the first 10 points
- It plots the country cases (see John Hopkins' data) as a function of time. E.g.
python3 ./src/plot_jhu_data.py country log-lin slice_index
country : See time_series_covid19_confirmed_global.csv
for coutries to plot options
log-lin : required, plot y axis in natural log, if fit is
straight line then experiencing exponential growth.
My hope is to someday implement other to be fit types
(e.g. lin-lin)
slice_index : required, for fitting, e.g.
if = -10, it will fit the last 10 points
if = 10, it will fit the first 10 points
- It plots several countries' death data (see John Hopkins' data) showing 1 day and 3 day doubling times. Motivated by NYT plot. E.g.
python src/plot_country_deaths.py
- An Ising inspired model of infection. It is a 1D model. This was my first attempt at modeling infectious spread. With an infectious agent, it can infect any other agent in the 1D model. This non-local behavior is obviously realistic, yet is fun anyways.
python3 ./src/simulation_1D.py R0 inc_time infect_time
R0 : How many people on average person infects
inc_time : Incubation time (days)
infect_time : Time after infection person becomes infectious
- A fun little toy program that emulates the type of plotting / simulations done in Simulating an Epidemic - YouTube.
python3 ./src/simulating_agent_model_2D.py [quarantine]
[quarantine] : optional, puts infected in quarantine symptoms present
After running, create a movie via :
ffmpeg -framerate 4 -pattern_type glob -i 'tmp/*.png' -c:v libx264 out.mp4
- Strategies for mitigating an influenza pandemic
- Impact of non-pharmaceutical interventions (NPIs) to reduce COVID- 19 mortality and healthcare demand
- Italian Department of Civil Protection
- Institute for Health Metrics and Evaluation
- Estimating the asymptomatic proportion of coronavirus disease 2019 (COVID-19) cases on board the Diamond Princess cruise ship
- Simulating an Epidemic - YouTube