Other configuration options
Command line inputs
flepiMoP allows some input parameters/options to be specified in the command line at the time of model submission, in addition to or instead of in the configuration file. This can be helpful for users who want to quickly run different versions of the model ā typically a different number of simulations or a different intervention scenario from among all those specified in the config ā without having to edit or create a new configuration file every time. In addition, some arguments can only be specified via the command line.
In addition to the configuration file and the command line, the inputs described below can also be specified as environmental variables.
In all cases, command line arguments override configuration file entries which override environmental variables. The order of command line arguments does not matter.
Details on how to run the model, including how to add command line arguments or environmental variables, are in the section How to Run.
Command-line only inputs
Argument | Env. Variable | Value type | Description | Required? | Default |
---|---|---|---|---|---|
|
| file path | Name of configuration file. Must be located in the current working directory, or else relative or absolute file path must be provided. | Yes | NA |
|
| The index of the first simulation | No | 1 | |
|
| Number of parallel processors used to run the simulation. If there are more slots that jobs, slots will be divided up between processors and run in series on each. | No | Number of processors on the computer used to run the simulation | |
| NA | Choose either option | Run simulation in interactive or batch mode | No |
|
| NA | Choose either option | Whether model output will be saved as .csv files | No |
|
| NA | Choose either option | Whether model output will be saved as .parquet files (a compressed representation that can be opened and manipulated with minimal memory. May be required for large simulations). Read more about parquet files. | No |
|
Command-line versions of configuration file inputs
Argument | Config item | Env. Variable | Value type | Description | Required? | Default |
---|---|---|---|---|---|---|
|
|
| list of strings | Names of the intervention scenarios described in the config file that will be run. Must be a subset of scenarios defined. | No | All scenarios described in config |
|
|
| Number of independent simulations of the model to be run | No | Config value | |
|
|
| choose either option | Whether the model will be run stochastically or non-stochastically (deterministic numerical integration of equations using the RK4 algorithm) | No | Config value |
|
| string | Unique ID given to the model runs. If the same config is run multiple times, you can avoid the output being overwritten by using unique model run IDs. | No | Constructed from current date and time as YYYY.MM.DD.HH/MM/SS | |
|
| string | Unique ID given to the model runs. If the same config is run multiple times, you can avoid the output being overwritten by using unique model run IDs. | No | Constructed from current date and time as YYYY.MM.DD.HH/MM/SS |
Example
As an example, consider running the following configuration file
To run this model directly in Python (it can alternatively be run from R, for all details see section How to Run), we could use the command line entry
Alternatively, to run 100 simulations using only 4 of the available processors on our computer, but only running the "" scenario with a deterministic model, and to save the files as .csv (since the model is relatively simple), we could call the model using the command line entry
Environmental variables
TBA
US-specific configuration file options
Things below here are very out of date. Put here as place holder but not updated recently.
global: smh_round, setup_name, disease
spatial_setup: census_year, modeled_states, state_level
For US-specific population structures
For creating US-based population structures using the helper script build_US_setup.R
which is run before the main model simulation script, the following extra parameters can be specified
Config Item | Required? | Type/Format | Description |
---|---|---|---|
census_year | optional | integer (year) | Determines the year for which census population size data is pulled. |
state_level | optional | boolean | Determines whether county-level population-size data is instead grouped into state-level data (TRUE). Default FALSE |
modeled_states | optional | list of location codes | A vector of locations that will be modeled; others will be ignored |
Example 2
To simulate an epidemic across all 50 states of the US or a subset of them, users can take advantage of built in machinery to create geodata and mobility files for the US based on the population size and number of daily commuting trips reported in the US Census.
Before running the simulation, the script build_US_setup.R
can be run to get the required population data files from online census data and filter out only states/territories of interest for the model. More details are provided in the How to Run section.
This example simulates COVID-19 in the New England states, assuming no transmission from other states, using 2019 census data for the population sizes and a pre-created file for estimated interstate commutes during the 2011-2015 period.
geodata.csv
contains
mobility_2011-2015_statelevel.csv
contains
importation
section (optional)
importation
section (optional)This section is optional. It is used by the covidImportation package to import global air importation data for seeding infections into the United States.
If you wish to include it, here are the options.
Config Item | Required? | Type/Format | Description |
---|---|---|---|
census_api_key | required | string | |
travel_dispersion | required | number | ow dispersed daily travel data is; default = 3. |
maximum_destinations | required | integer | number of airports to limit importation to |
dest_type | required | categorical | location type |
dest_country | required | string (Country) | ISO3 code for country of importation. Currently only USA is supported |
aggregate_to | required | categorical | location type to aggregate to |
cache_work | required | boolean | whether to save case data |
update_case_data | required | boolean | deprecated; whether to update the case data or used saved |
draw_travel_from_distribution | required | boolean | whether to add additional stochasticity to travel data; default is FALSE |
print_progress | required | boolean | whether to print progress of importation model simulations |
travelers_threshold | required | integer | include airports with at least the |
airport_cluster_distance | required | numeric | cluster airports within |
param_list | required | See section below | see below |
importation::param_list
importation::param_list
Config Item | Required? | Type/Format | Description |
---|---|---|---|
incub_mean_log | required | numeric | incubation period, log mean |
incub_sd_log | required | numeric | incubation period, log standard deviation |
inf_period_nohosp_mean | required | numeric | infectious period, non-hospitalized, mean |
inf_period_nohosp_sd | required | numeric | infectious period, non-hospitalized, sd |
inf_period_hosp_mean_log | required | numeric | infectious period, hospitalized, log-normal mean |
inf_period_hosp_sd_log | required | numeric | infectious period, hospitalized, log-normal sd |
p_report_source | required | numeric | reporting probability, Hubei and elsewhere |
shift_incid_days | required | numeric | mean delay from infection to reporting of cases; default = -10 |
delta | required | numeric | days per estimations period |
report
section
report
sectionThe report
section is completely optional and provides settings for making an R Markdown report. For an example of a report, see the Supplementary Material of our preprint
If you wish to include it, here are the options.
Config Item | Required? | Type/Format | Description |
---|---|---|---|
data_settings::pop_year | integer | ||
plot_settings::plot_intervention | boolean | ||
formatting::scenario_labels_short | list of strings; one for each scenario in | ||
formatting::scenario_labels | list of strings; one for each scenario in | ||
formatting::scenario_colors | list of strings; one for each scenario in | ||
formatting::pdeath_labels | list of strings | ||
formatting::display_dates | list of dates | ||
formatting::display_dates2 | optional | list of dates | a 2nd string of display dates that can optionally be supplied to specific report functions |
Last updated