phac-nml-phrsd / EPACmodel

Use the Early Pandemic Age-structured Compartmental (EPAC) model
https://phac-nml-phrsd.github.io/EPACmodel/
Other
3 stars 1 forks source link

enable the creation of Mistry contact matrices with new population data #48

Closed papsti closed 5 days ago

papsti commented 1 week ago

One can pass new contact matrices to either make_simulator() or simulate() in a contact.pars entry of the values list argument. If this entry isn't passed, contact parameters will be generated with mk_contact_pars(). Currently, this function is only set up to generate contact matrices based on the Mistry ones by specifying:

  1. age-group bins, optionally aggregating over age groups if required (starting from one year age groups)
  2. setting weights (overall avg contacts per day per setting; used especially for intervention simulation)

However, the population sizes used to generate contact matrices are currently baked into them, so if one wants to use a different population size for simulation, the contact matrices will be inconsistent. We should add a feature to mk_contact_pars() that allows it to accept a population table in order to population-renormalize the contact matrices before returning them.

How to pop-renormalize the contact matrices?

Mistry et al. 2021 have a nice section explaining the construction of their matrices, which reveals how to population-renormalize them; see page 9 of the pdf downloadable here, under the section header "Construction of age-based contact matrices".

Equation (3) shows that row $i$ of a setting-specific component contact matrix $F^k$ (for setting $k$) is divided by the population size of age group $i$. Mistry et al published the population distributions they used to generate their contact matrices here, so we can renormalize their matrices by multiplying each element in row $i$ by (Mistry et al.'s population size for age $i$)/(the new desired population size for age $i$).

Note that each overall contact matrix, $M$ (in their notation), is simply a linear combination of the setting-specific $F$ matrices, so whether one is working directly with the setting-specific matrices or with the overall contact matrix, the same renormalization procedure would apply.

papsti commented 1 week ago

working on this on 48-pop-renorm-contact-mats branch