Sovereign 8s.is mirror of standardgalactic/daedalus_mfp
  • R 59.3%
  • MATLAB 40.7%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-07-28 14:36:13 +01:00
input introduced covariance between mitigation measures, removed incubation periods 2026-03-02 17:25:13 +00:00
output/archetypes pulled hospital occupancy threshold from simulation data 2026-06-08 17:03:10 +01:00
plotting added figure rastering 2026-07-28 14:36:13 +01:00
resources/project split fig5ab into fig 5 and 6 2026-06-08 17:56:43 +01:00
.gitignore updated gitignore 2025-06-27 12:23:03 +01:00
daedalus_mfp.prj tidying up 2025-06-27 10:53:43 +01:00
dd_calc_contacts.m corrected comments in calc_contacts 2025-04-18 17:32:27 +01:00
dd_calc_loss.m pulled hospital occupancy threshold from simulation data 2026-06-08 17:03:10 +01:00
dd_calc_r.m code overhaul 2, esp set_disease, but no output changes 2025-01-06 20:41:01 +00:00
dd_calc_Rt.m code overhaul 2, esp set_disease, but no output changes 2025-01-06 20:41:01 +00:00
dd_main.m pulled hospital occupancy threshold from simulation data 2026-06-08 17:03:10 +01:00
dd_run_postprocessing.m bug fix in main: reverted p2 change 2026-03-06 23:00:20 +00:00
dd_run_sim.m bug fix in main: reverted p2 change 2026-03-06 23:00:20 +00:00
dd_set_country.m introduced covariance between mitigation measures, removed incubation periods 2026-03-02 17:25:13 +00:00
dd_set_disease.m removed large output file 2026-04-16 17:15:09 +01:00
dd_set_rules_elimination.m introduced threshold based ascertainment and isolation 2026-02-10 19:35:17 +00:00
dd_set_rules_noclosures.m introduced threshold based ascertainment and isolation 2026-02-10 19:35:17 +00:00
dd_set_rules_seclosures.m introduced threshold based ascertainment and isolation 2026-02-10 19:35:17 +00:00
dd_set_strategy.m amended seclosure events 2025-02-07 15:22:24 +00:00
dd_single.m pulled hospital occupancy threshold from simulation data 2026-06-08 17:03:10 +01:00
dd_single_plot.m included sample sizes, saving figures as pdfs 2026-07-21 19:50:10 +01:00
dd_store_input.m fixed bugs in input/output storage 2025-01-08 16:35:00 +00:00
dd_store_output.m pulled hospital occupancy threshold from simulation data 2026-06-08 17:03:10 +01:00
LICENSE Add MIT License to the project 2026-04-16 17:27:47 +01:00
README.md Updated Readme with shared output 2026-04-16 17:23:44 +01:00

Mitigating Future Respiratory Pandemics

This repository contains the source and replication code for the paper 'Mitigating Future Respiratory Pandemics in Low-, Middle- and High-Income Countries: A Modelling Study of Health, Economic and Educational Losses', available at https://doi.org/10.21203/rs.3.rs-9418446/v1. The Daedalus epidemiological–economic model, which generates the simulation output, is written in MATLAB but the figures are plotted using Rstudio and R.


1. System Requirements

Operating System

  • Tested on Windows 11
  • No non-standard hardware required

Software Dependencies

  • MATLAB R2024a (MathWorks)
  • R version 4.4.1
  • RStudio 2024.12.0

MATLAB Toolboxes

  • Statistics and Machine Learning Toolbox 24.1
  • Parallel Computing Toolbox 24.1

R Packages

  • dplyr (1.1.4)
  • purrr (1.0.2)
  • tidyr (1.3.1)
  • readr (2.1.5)
  • stringr (1.5.1)
  • fBasics (4052.98)
  • fitdistrplus (1.2-2)
  • forecast (8.23.0)
  • scam (1.2-18)
  • ggplot2 (3.5.2)
  • ggh4x (0.3.0)
  • ggdensity (1.0.0)
  • cowplot (1.2.0)
  • ggpattern (1.1.3)
  • patchwork (1.3.1)

2. Installation Guide

Instructions

  1. Clone or download this repository to your local machine
  2. Open MATLAB and set the working directory to the root folder of this repo
  3. Open RStudio and set the working directory to the /plotting folder within the root

Typical Installation Time

Less than 5 minutes on a standard desktop computer


3. Demo

Run the Daedalus Model (MATLAB)

The paper manuscript used 5000 sample synthetic countries per income-group archetype, which takes longer to run, so in the interest of time this demo is set to 50 sample sythetic countries.

Open MATLAB, navigate to the root directory, and run:

run('dd_main.m')

This will:

  • Load input data from /input/country_data.csv and the disease parameter files
  • Run the model
  • Save outputs to /output/archetypes/

Generate Figures (RStudio)

The figures should be plotted using the model output with 5000 samples (see below), but for the demo, previously computed output is available in the files /output/archetypes/llmic_output.zip, /output/archetypes/umic_output.zip and /output/archetypes/hic_output.zip, which should be unzipped.

Open RStudio, navigate to the /plotting directory, and run:

source("figure_2.R")

et cetera. This will:

  • Load the data from /output/archetypes/
  • Generate figures corresponding to those in the manuscript
  • Save figures to the same directory

Expected Output

  • Income-group archetype data underlying simulations /output/archetypes/LLMIC_data.csv, /output/archetypes/UMIC_data.csv and /output/archetypes/HIC_data.csv
  • Income-group-, disease- and closure-strategy-specific simulation output data, e.g., /output/archetypes/LLMIC_Influenza 2009_No Closures.csv
  • Figures: /plotting/*.png

Expected Run Time

  • Daedalus model: The demo with 50 sample sythetic countries took less than 1 hour to run on 8 cores.
  • R plotting: The figures take up to 15m to plot.

4. Instructions for Use

To run the model on the full 5000 sample synthetic countries per income-group archetype, open MATLAB, navigate to the root directory, and change line 14 to:

nsamples = 5000;

Then run:

run('dd_main.m')

as for the demo (above).

Expected Run Time

  • Daedalus model: The full 5000 sample synthetic countries per income-group archetype took approx. 16 hours on 32 cores.

License

This project is licensed under the MIT License.


Code Availability

The code is publicly available in this repository.


Notes

  • All file paths are relative and assume the repository structure described above