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:
age-group bins, optionally aggregating over age groups if required (starting from one year age groups)
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.
One can pass new contact matrices to either
make_simulator()
orsimulate()
in acontact.pars
entry of thevalues
list argument. If this entry isn't passed, contact parameters will be generated withmk_contact_pars()
. Currently, this function is only set up to generate contact matrices based on the Mistry ones by specifying: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.