This PR adds the classes of user base found in epiforecast/user_base.py . It creates the user specified complete subgraph (a view of the graph - so linked in memory). I have included an example to show how they work, and also a full data assimilation / master equations loop with a subgraph.
FullUserBase(network) stores the full contact network view
FractionalUserBase(network, user_fraction) build a subgraph of a given fraction of the population that are randomly selected. We also remove isolated nodes, therfore for smaller graphs it is likely to produce a graph slightly under the given fraction of the population.
ContiguousUserBase(network, user_fraction) builds a subgraph by starting at a seed user, and expanding outwards, by adding maximal subgraphs containing that user, (then iterate to the next user) until a given fraction of population is reached. Therefore for it is likely to produce a graph slightly larger than the given fraction of the population.
examples/specify_user_base.py gives a simple example.
user_base_data_assimilation.py gives the framework for how the data assimilation will work with the user base.
This PR adds the classes of user base found in
epiforecast/user_base.py
. It creates the user specified complete subgraph (a view of the graph - so linked in memory). I have included an example to show how they work, and also a full data assimilation / master equations loop with a subgraph.FullUserBase(network)
stores the full contact network viewFractionalUserBase(network, user_fraction)
build a subgraph of a given fraction of the population that are randomly selected. We also remove isolated nodes, therfore for smaller graphs it is likely to produce a graph slightly under the given fraction of the population.ContiguousUserBase(network, user_fraction)
builds a subgraph by starting at a seed user, and expanding outwards, by adding maximal subgraphs containing that user, (then iterate to the next user) until a given fraction of population is reached. Therefore for it is likely to produce a graph slightly larger than the given fraction of the population.examples/specify_user_base.py
gives a simple example.user_base_data_assimilation.py
gives the framework for how the data assimilation will work with the user base.