-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1036 Simulations from paper to investigate behavior of IDE model #1130
base: main
Are you sure you want to change the base?
Conversation
…into 1036-ide-simulations
…e-of-the-discretization-scheme-from-the-ide-model' into 1036-ide-simulations
…nfirmedCasesNoAgeEntry and ConfirmedCasesDataEntry
…and ConfirmedCasesNoAgeEntry
…-both-confirmedcasesnoageentry-and-confirmedcasesdataentry' into 1036-ide-simulations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First part of review
|
||
- Section 5.1: With the file [ide_convergence_rate](ide_convergence_rate.cpp) simulations with an integro-differential-based model (IDE model) and an ordinary differential-based model (ODE model) with different time step sizes can be performed to analyze the order of convergence of the introduced nonstandard numerical scheme. The visualization of the results can be done with [plot_convergence](plot_convergence.py). | ||
|
||
- Section 5.2: In [ide_changepoints](ide_chanepoints.cpp) a simulation with both our IDE and an ODE model is performed where a change in the contact rate is applied after two days to investigate the model behavior at change points. The results can be visualized with [plot_changepoints](plot_changepoints.py). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Section 5.2: In [ide_changepoints](ide_chanepoints.cpp) a simulation with both our IDE and an ODE model is performed where a change in the contact rate is applied after two days to investigate the model behavior at change points. The results can be visualized with [plot_changepoints](plot_changepoints.py). | |
- Section 5.2: In [ide_changepoints](ide_chanepoints.cpp), a simulation with both our IDE and an ODE model is performed, where a change in the contact rate is applied after two days to investigate the model behavior at change points. The results can be visualized with [plot_changepoints](plot_changepoints.py). |
|
||
Below is an overview of the files and the paper sections they belong to. | ||
|
||
- Section 5.1: With the file [ide_convergence_rate](ide_convergence_rate.cpp) simulations with an integro-differential-based model (IDE model) and an ordinary differential-based model (ODE model) with different time step sizes can be performed to analyze the order of convergence of the introduced nonstandard numerical scheme. The visualization of the results can be done with [plot_convergence](plot_convergence.py). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Section 5.1: With the file [ide_convergence_rate](ide_convergence_rate.cpp) simulations with an integro-differential-based model (IDE model) and an ordinary differential-based model (ODE model) with different time step sizes can be performed to analyze the order of convergence of the introduced nonstandard numerical scheme. The visualization of the results can be done with [plot_convergence](plot_convergence.py). | |
- Section 5.1: With the file [ide_convergence_rate](ide_convergence_rate.cpp) simulations with an integro-differential equation-based model (IDE model) and an ordinary differential equation-based model (ODE model) with different time step sizes can be performed to analyze the order of convergence of the introduced nonstandard numerical scheme. The visualization of the results can be done with [plot_convergence](plot_convergence.py). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe nonstandard numerical scheme for the IDE model? Maybe add also somewhere a SECIR- ?
|
||
- Section 5.3: The COVID-19 inspired scenario can be run with [ide_covid_inspired_scenario](ide_covid_inspired_scenario.cpp). | ||
|
||
For the transition probabilities we use data from [Assessment of effective mitigation and prediction of the spread of SARS-CoV-2 in Germany using demographic information and spatial resolution](https://doi.org/10.1016/j.mbs.2021.108648) and [Covasim: An agent-based model of COVID-19 dynamics and interventions](https://doi.org/10.1371/journal.pcbi.1009149). There, the data is age-resolved. We consider a model without age resolution which is why compute according parameters by averaging over the age groups. This is done in [compute_parameters](compute_parameters.cpp). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this also the case for the cangepoints? Maybe you can reformat this somehow or add a comment
|
||
For the transition probabilities we use data from [Assessment of effective mitigation and prediction of the spread of SARS-CoV-2 in Germany using demographic information and spatial resolution](https://doi.org/10.1016/j.mbs.2021.108648) and [Covasim: An agent-based model of COVID-19 dynamics and interventions](https://doi.org/10.1371/journal.pcbi.1009149). There, the data is age-resolved. We consider a model without age resolution which is why compute according parameters by averaging over the age groups. This is done in [compute_parameters](compute_parameters.cpp). | ||
|
||
For the stay time distributions in the respective compartments we used lognormal distributions as in [Covasim: An agent-based model of COVID-19 dynamics and interventions](https://doi.org/10.1371/journal.pcbi.1009149). There, the mean and the standard deviation were given. In order to use it with our implementation, we computed the corresponding shape and scale parameters with [get_lognormal_parameters](get_lognormal_parameters.py). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the stay time distributions in the respective compartments we used lognormal distributions as in [Covasim: An agent-based model of COVID-19 dynamics and interventions](https://doi.org/10.1371/journal.pcbi.1009149). There, the mean and the standard deviation were given. In order to use it with our implementation, we computed the corresponding shape and scale parameters with [get_lognormal_parameters](get_lognormal_parameters.py). | |
For the stay time distributions in the respective compartments, we used lognormal distributions as in [Covasim: An agent-based model of COVID-19 dynamics and interventions](https://doi.org/10.1371/journal.pcbi.1009149). There, the mean and the standard deviation were given. In order to use it with our implementation, we computed the corresponding shape and scale parameters with [get_lognormal_parameters](get_lognormal_parameters.py). |
- Data on reported cases can be downloaded with [getCaseData](../../../pycode/memilio-epidata/memilio/epidata/getCaseData.py). To obtain the data, use the options moving_average = 7 and impute_dates = True when downloading the data. For the other function parameters, one can use default parameters from [defaultDict](../../../pycode/memilio-epidata/memilio/epidata/defaultDict.py). | ||
|
||
When simulating, we set the contact rate such that the daily new transmissions of the IDE simulation are consistent with the reported data at the beginning of the simulation. The contact scaling and the visualization is done in [run_and_plot_covid_inspired_scenario](run_and_plot_covid_inspired_scenario.py). For the scaling and the subsequent visualization we used case data from RKI (not averaged) and data on ICU patients as reported from DIVI. | ||
- To obtain the case data, use [getCaseData](../../../pycode/memilio-epidata/memilio/epidata/getCaseData.py) with the option impute_dates = True when downloading. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a comment that ma7 is not set here.
|
||
mio::osecir::Model<ScalarType> model_ode(1); | ||
|
||
// Set initial values for compartments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add comment that they are random
|
||
// Set parameters. | ||
ScalarType cont_freq = simulation_parameter["cont_freq"]; | ||
// Set Seasonality=0 so that cont_freq_eff is equal to contact_matrix. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as abpve
simulation_parameter["total_population"]); | ||
|
||
// Set parameters. | ||
ScalarType cont_freq = simulation_parameter["cont_freq"]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this extra variable
mio::isecir::Model model_ide(std::move(init_transitions), total_population, deaths, num_agegroups); | ||
|
||
// Set parameters. | ||
// Contact matrix; contact_matrix was already defined for ODE. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Contact matrix; contact_matrix was already defined for ODE. | |
// contact_matrix was already defined for ODE. |
|
||
if (!result_dir.empty() && save_exponent > 0) { | ||
// Create result directory if not existent yet. | ||
boost::filesystem::path res_dir(result_dir); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
boost filesystem header ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
really really nice work :)
|
||
// ----- Add NPIs to the contact matrices. ----- | ||
// Set of NPIs for October. | ||
if (start_date == mio::Date(2020, 10, 1)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just if really 1.10. or also if maybe 30.9.? I mean for the simulations conducted, this is not relevant
|
||
/** | ||
* @brief Set the contact pattern of parameters for a model without division in age groups without using the | ||
* age-resolved contact_matrices. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
somehow doubled
* @param[in] contact_matrices Contact matrices used. | ||
* @param[in] data_dir Directory to files with minimum and baseline contact matrices and reported data from RKI. | ||
* @param[in] save_dir Directory where simulation results will be stored. | ||
* @returns Any IO errros that happen. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or a vector
* @param[in] start_date Start date of the simulation | ||
* @param[in] simulation_time Duration of the simulation. | ||
* @param[in] contact_matrices Contact matrices used. | ||
* @param[in] data_dir Directory to files with minimum and baseline contact matrices and reported data from RKI. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported_data_dir
* @param[in] simulation_time Duration of the simulation. | ||
* @param[in] contact_matrices Contact matrices used. | ||
* @param[in] data_dir Directory to files with minimum and baseline contact matrices and reported data from RKI. | ||
* @param[in] save_dir Directory where simulation results will be stored. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default
@returns df_result Dataframe containing processed RKI data. | ||
""" | ||
# Set start date and end date according to input arguments. | ||
parameters['start_date'] = start_date |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why?
@param[in] start_date Start date of the simulations. | ||
@param[in] simulation_time Duration of the simulation. | ||
@param[in] fileending String that further specifies filename of plot. | ||
@param[in] Directory where plot will be stored. If this is not set, the plot will not be stored. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@param[in] Directory where plot will be stored. If this is not set, the plot will not be stored. | |
@param[in] save_dir Directory where plot will be stored. If this is not set, the plot will not be stored. |
@param[in] start_date Start date of the simulations. | ||
@param[in] simulation_time Duration of the simulation. | ||
@param[in] fileending String that further specifies filename of plot. | ||
@param[in] Directory where plot will be stored. If this is not set, the plot will not be stored. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@param[in] Directory where plot will be stored. If this is not set, the plot will not be stored. | |
@param[in] save_dir Directory where plot will be stored. If this is not set, the plot will not be stored. |
@param[in] start_date Start date of the simulations. | ||
@param[in] simulation_time Duration of the simulation. | ||
@param[in] fileending String that further specifies filename of plot. | ||
@param[in] Directory where plot will be stored. If this is not set, the plot will not be stored. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@param[in] Directory where plot will be stored. If this is not set, the plot will not be stored. | |
@param[in] save_dir Directory where plot will be stored. If this is not set, the plot will not be stored. |
""" Plots the number of ICU patients obtained by simulations with an ODE and an IDE model as well as | ||
the number of ICU patients as reported by DIVI. | ||
|
||
@param[in] files Expects list of two files with ODE and IDE simulation results for flows, respectively, in this order. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
really flows? or compartments?
Changes and Information
Merge Request - Guideline Checklist
Please check our git workflow. Use the draft feature if the Pull Request is not yet ready to review.
Checks by code author
Checks by code reviewer(s)
Closes #1036
Closes #1097
Closes #411