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

Capture MGCV error #49

Open
njtierney opened this issue Oct 6, 2021 · 0 comments
Open

Capture MGCV error #49

njtierney opened this issue Oct 6, 2021 · 0 comments
Milestone

Comments

@njtierney
Copy link
Collaborator

library(conmat)
library(readr)
library(dplyr)

oz_pop <- abs_pop_age_lga_2020 %>%
group_by(age_group) %>%
summarise(
population = sum(population)
) %>%
mutate(
lower.age.limit = parse_number(as.character(age_group))
) %>%
mutate(
country = "Australia"
)
oz_pop

fit_setting_contacts(
contact_data_list = get_polymod_setting_data(),
population = oz_pop
)
#> Error in if (sum(uconv.ind) == 0) {: missing value where TRUE/FALSE needed

Thanks to @goldingn for working out when this error typically occurs:

Because the interpolated population function was predicting 0 population for some ages, which then led to a non-finite offset

The goal here it to either try and capture that error exactly, and give a more informative error, replacing it with suggestions.

Alternatively, identify this ahead of time somehow, before model fitting, and describe how to fix that issue.

@njtierney njtierney added this to the 0.1.0 milestone Sep 14, 2022
@njtierney njtierney modified the milestones: 0.1.0, 0.2.0 Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant