Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support specification of population size by age #50

Merged
merged 6 commits into from
Nov 7, 2024

Conversation

papsti
Copy link
Collaborator

@papsti papsti commented Nov 7, 2024

a user can now pass a new population vector (count by age) into the values fields of either make_simulator() or simulate() (in a named list under the entry "pop"). (value updates through simulate() is still only supported for the hosp model)

note that if the population sizes are being updated, the contact parameters must also be regenerated to ensure the average contact rate by age (c.hat) remains consistent with the new population data.

this update can be done with

values$pop <- c(...) # new population size vector
values$contact.pars <- mk_contact_pars(
    age.group.lower = seq(0, 80, by = 5),
    setting.weight = values$setting.weight, 
    pop.new = values$pop
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant