Specifying population structure
This page describes how users specify the names, sizes, and connectivities of the different subpopulations comprising the total population to be modeled
Overview
The spatial_setup
section of the configuration file is where users can input the information required to define a population structure on which to simulate the model. The options allow the user to determine the population size of each subpopulation that makes up the overall population, and to specify the amount of mixing that occurs between each pair of subpopulations.
An example configuration file with the global header and the spatial_setup section is below:
Items and options
Config Item | Required? | Type/Format | Description |
---|---|---|---|
geodata | required | path to file | path to file relative to |
popnodes | required | string | name of population column in |
nodenames | required | string | name of location nodes column in |
mobility | required | path to file | path to file relative to |
geodata
file
geodata
filegeodata
is a .csv with column headers, with at least two columns:nodenames
andpopnodes
.nodenames
is the name of a column ingeodata
that specifies unique geographical identification strings for each subpopulation.popnodes
is the name of a column ingeodata
that specifies the population size (number of individual residents) of the subpopulation given in thenodenames
column.include_in_report
is the name of an optional column ingeodata
that specifies whichnodenames
are included in the report. Models may include more locations than simply the location of interest.
Example geodata file format
mobility
file
mobility
fileThe mobility
file is a .csv file (it has to contain .csv as extension) with long form comma separated values. Columns have to be named ori
, dest
, amount,
with amount being the average number individuals moving from the origin subpopulation ori
to destination subpopulation dest
on any given day. Details on the mathematics of this model of contact are explained in the Model Description section. Unassigned relations are assumed to be zero. The location entries in the ori
and dest
columns should match exactly the nodenames
column in geodata.csv
Example mobility file format
It is also possible, but not recommended to specify the mobility
file as a .txt with space-separated values in the shape of a matrix. This matrix is symmetric and of size K x K, with K being the number of rows in geodata
. The above example corresponds to
Examples
Example 1
To simulate a simple population structure with two subpopulations, a large province with 10,000 individuals and a small province with only 1,000 individuals, where every day 100 residents of the large province travel to the small province and interact with residents there, and 50 residents of the small province visit the large province
geodata.csv
contains the population structure (with nodename
column subpop
and popnodes
column population
)
mobility.csv
contains
Example 2
(Give example with US states)
Last updated