Repository navigation
Modifying script for additional model run and results storage - #24
Conversation
Agent-Logs-Url: https://github.com/EpiForeSITE/idcup/sessions/6696e7c5-2826-469a-b01c-3273ef9289a1 Co-authored-by: gvegayon <893619+gvegayon@users.noreply.github.com>
…alysis qmd Agent-Logs-Url: https://github.com/EpiForeSITE/idcup/sessions/6696e7c5-2826-469a-b01c-3273ef9289a1 Co-authored-by: gvegayon <893619+gvegayon@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds a second (“+1 seed”) simulation run per city and introduces a new sensitivity analysis report to relate final outbreak size to initial seed cases while controlling for demographics.
Changes:
scenarios/template.qmd: run a second simulation set with one additional seed case and save outputs to separate*_plus1seed.csvfiles.sensitivity_analyses/seeds_vs_outbreak_controls.qmd: new analysis that reads baseline/+1 outputs and fits/plots a regression with population, vaccination rate, and age-structure controls.- Repo wiring updates: narrow README file globbing, document the new analysis in
DETAILS.md, and un-ignore the new plus1 CSV outputs.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| sensitivity_analyses/seeds_vs_outbreak_controls.qmd | New demographic-controls analysis reading baseline and +1 seed scenario outputs. |
| scenarios/template.qmd | Adds an additional +1 seed simulation run and writes separate result CSVs. |
| README.qmd | Restricts scenario file discovery to baseline outbreak-size CSVs. |
| DETAILS.md | Documents the new sensitivity analysis file. |
| .gitignore | Ensures the new *_plus1seed.csv outputs are not ignored. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| baseline_files <- list.files( | ||
| "scenarios", | ||
| pattern = "_outbreak_size\\.csv$", | ||
| full.names = TRUE | ||
| ) | ||
|
|
||
| plus1_files <- list.files( | ||
| "scenarios", | ||
| pattern = "_outbreak_size_plus1seed\\.csv$", | ||
| full.names = TRUE | ||
| ) |
There was a problem hiding this comment.
I don't like using the here::here() R function. Instead, I am a fan of symbolic links. If needed, let's add the corresponding symbolic link so we can ensure this works if you render it from the root directory or within sensitivity_analyses.
There was a problem hiding this comment.
Implemented in commit 0aa7c54: I added sensitivity_analyses/scenarios as a symbolic link to ../scenarios so the QMD resolves the same scenarios/ path when rendered from either location.
| #| label: running-simulations-plus1-seed | ||
| expected_active_cases_plus1 <- expected_active_cases + 1L | ||
|
|
||
| get_virus(measles_model, 0L) |> | ||
| set_distribution_virus( | ||
| distfun = distribute_virus_randomly( | ||
| prevalence = expected_active_cases_plus1, | ||
| as_proportion = FALSE | ||
| ) | ||
| ) | ||
|
|
||
| measles_model |> | ||
| run_multiple( | ||
| ndays = params$ndays, | ||
| nsims = params$nsims, | ||
| seed = params$seed, | ||
| saver = make_saver("outbreak_size", "hospitalizations"), | ||
| nthreads = params$nthreads | ||
| ) |
There was a problem hiding this comment.
I don't agree with this. We need to have the same number of runs, even if it means twice the time. We will be using those later in the future, so let's not follow this advice.
Agent-Logs-Url: https://github.com/EpiForeSITE/idcup/sessions/ee4f1396-3f5d-46f1-83c9-f9bf64353a1a Co-authored-by: gvegayon <893619+gvegayon@users.noreply.github.com>
Uh oh!
There was an error while loading. Please reload this page.