Giter Site home page Giter Site logo

colombia_mobility_series's Introduction

Process Mobility Series and Get Contact Data

Overview

This repository contains scripts designed to analyze the mobility and shelter-in-place trends during the COVID-19 pandemic, with a focus on various departments in Colombia. The primary script, get_intervention_file.ipynb, processes community contact trends using mobility and shelter-in-place data sourced from Facebook.

The contact trend curves are smoothed using the Generalized Additive Models (GAMs) provided by the pygam package.

Output Files

Outputs are saved in output_folder/interventions/ and include:

  • interventions_covid_timevarying_community_baseline.csv
  • interventions_covid_timevarying_community.csv
  • interventions_covid_timevarying_shelter.csv
  • interventions_covid_timevarying_shelter_lockdown.csv

Detailed Workflow

Initialization

  • num_forecast_days: A variable set to zero, indicating no additional days are forecasted by default. This can be adjusted to extend the prediction into the future.
  • selected_columns: Specifies the columns to be included in the final output DataFrame, focusing on dates, replication indices, shelter trends, and geographical identifiers.

Data Processing Loop

  • Iterates through each department, loading corresponding shelter trend data from CSV files.
  • Normalizes shelter trend data for consistency and prepares it for modeling.

Defining Intervention Periods

  • Pre-Christmas Period: Up to December 10, 2020. This period captures the behavior before the holiday season when movements might be less due to early pandemic responses.
  • Post-Christmas Period: Starting from December 25, 2020. This focuses on the holiday impact and subsequent behavior, which is crucial for understanding changes in sheltering due to potentially increased social interactions during the holidays.
  • Splits the dataset into two periods based on these dates for targeted analysis.

Model Fitting and Prediction

  • Fits a Generalized Additive Model (GAM) to each defined period separately to capture distinct trends.
  • Predicts shelter trends for days within each period.

Adjustments and Final Compilation

  • After combining predictions from both periods, an additional adjustment is made for a reopening phase in June 2021, multiplying trends by 1.2 to reflect increased mobility post-lockdown.
  • Values are capped to ensure they remain within plausible limits (0 to 1).
  • The final DataFrame is prepared by merging predicted trends with the appropriate dates and departmental information.

Output Preparation

  • The resulting DataFrame containing all compiled and adjusted predictions is finalized for output, capturing significant trends and interventions across time.

Intervention Periods

The script explicitly models the following periods for detailed analysis:

  • June Reopening Adjustment: From June 8, 2021, onward. This adjustment acknowledges the reopening of activities and an expected increase in mobility and lesser sheltering as restrictions may have eased.

colombia_mobility_series's People

Contributors

dvelozad 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.