Skip to content

CompartmentType

Tammy Ng edited this page Feb 16, 2018 · 5 revisions

A CompartmentType is an object representing a category of Compartment objects that share a common set of rate parameters. For example, a basic susceptible-infected compartmental epidemic model can be implemented with a single CompartmentType representing all sampled infected individuals and their respective source individuals, where we assume uniform transmission rates across hosts.

YAML syntax

CompartmentTypes:
  <label>:
    unsampled: <value>
    susceptible: <value>
    branching.rates: {<CompartmentType>: <rate>, ...}
    migration.rates: {<CompartmentType>: <rate>, ...}
    effective.size: <value|R expression>
    bottleneck.size: <value|R expression>

Description

  • label is a unique string identifier that is used to associate individual Compartment objects as instances of this CompartmentType.
  • unsampled is a numerical value of the number of unsampled infected compartments of a particular CompartmentType at time t=0.
  • susceptible is a numerical value of the number of susceptible uninfected compartments of a particular CompartmentType at t=0.
  • branching.rates is a dictionary of branching rates from specific CompartmentTypes. Depending on the model, branching rates can represent cospeciation or transmission rates . We assume that branching rates are uniform over all instance of a specific CompartmentType.
  • migration.rates is a dictionary of migration rates from specific CompartmentTypes.
  • effective.size (effective population size) determines the rate that lineages coalesce to common ancestors within a Compartment of this type. Specifically, the coalescence rate will be the reciprocal of this variable.
    • If this is set to a numerical value, then we assume a constant rate of coalescence over time for an instance of the CompartmentType until it reaches the transmission event.
    • If this is set to an R expression, then the expression must resolve to a univariate function of time t, where t is measured forward relative to the infection time (which is different from the way we usually deal with time for coalescent simulation). For example, 10 + 0.1*t would evaluate to the linear growth of effective population size over time, and correspond to a reciprocal decay of the coalescent rate. This function will not be evaluated at t=0; instead we will substitute the bottleneck size.
  • bottleneck.size determines the maximum number of lineages that were transmitted from the source to establish the current infection. If the number of lineages in this host exceeds the bottleneck size, then the lineages will be randomly sampled without replacement to the bottleneck size, and the remaining lineages will be forced to coalesce.
Clone this wiki locally