Git Product home page Git Product logo

madrid's Introduction

MADRID

Introduction

This repository contains the minimal code for the simulations in the manuscript: "Assessing the effectiveness of perimeter lockdowns as a response to epidemics at the urban scale: the case of Madrid" (under peer-review)

In this paper we built an epidemiological SIR metapopulation model with the ability to implement perimeter lockdowns, inspired by the case of Madrid, Spain, during September 2020. As such, our metapopulation model consists of 21 subpopulations, the official administrative regions of the city of Madrid, and the mobility model connecting those subpopulations is informed with real mobility flows from the city based on a reference period during February 2020. A standard SIR epidemic dynamics is run at every subpopulation. A risk threshold set, so that whenever the 14-day cumulative incidence rate is surpassed locally (in a certain district), mobility in-and-out of the affected area is totally banned, and also some further transmission reduction is achieved within. This behavioral response tries to emulate the strategy followed by Madrid's health authories during the aforementioned period of the COVID-19 epidemic.

The code hosted here is minimal because it contains the data and the model used for the manuscript's main results, but at the moment some pipeflow scripts for organizing the simulations output and plotting routines lack (hopefully, I will upload them after tidying them up). Apart from the basic model and related utilies, the scripts for figure 1 and figure 2 in the manuscript are present, and also a basic example and plotting scripts that allows the user to explore the system's global dynamics.

Setup

The model requires the basic standard packages such as NumPy and Pandas. It also requires Pickle for output results storage and input data for some plots, and datetime.

Basic Usage

Assuming all the required packages are correctly installed, and the full madrid directory (subdirectories and files) has been downloaded in the home folder, then you can execute the example script by typing:


python ~/madrid/src example.py

Model parameters can be modified within the script.

In a similar fashion, you can launch plot_figure1.py and plot_figure2.py scripts:


python ~/madrid/src plot_figure1.py


python ~/madrid/src plot_figure2.py

Data

The metapopulation model uses real data for populating the patches in the system and for informing the mobility flows. The population data can be found here. The left column represents Madrid's administrative district and the right column represents 2020 population. The mobility data in human-readable format can be found here. This is a 21x21 table, where element (ij) represents the average total number of travels between district i and district j in the reference period (Feb 2020). This mobility data has been obtained through an R script (found here). Inside, the script you can find a more detailed description of the curation process.

Upgrades

In the future I hope to give a more friendly-user version of the model together with more features.

madrid's People

Contributors

phononautomata avatar

Watchers

 avatar

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.