-
Notifications
You must be signed in to change notification settings - Fork 6
Description
Hello! I have been testing the package to model diseases like measles or pertussis with high R0 values and I wanted to know if there are any limitations regarding the range of R0s the calculations of final size are acceptable/doable for. For example, I was replicating the example in: https://epiverse-trace.github.io/finalsize/articles/varying_susceptibility.html using an r0 of 10 and the p_infected that the model returns is bigger than the suscetpibility provided for the different age groups. Code follows:
library(tidyverse)
library(finalsize)
get UK polymod data
polymod <- socialmixr::polymod
contact_data <- socialmixr::contact_matrix(
polymod,
countries = "United Kingdom",
age.limits = c(0, 5, 18, 40, 65),
symmetric = TRUE
)
get the contact matrix and demography data
contact_matrix <- t(contact_data$matrix)
demography_vector <- contact_data$demography$population
scale the contact matrix so the largest eigenvalue is 1.0
contact_matrix <- contact_matrix / max(Re(eigen(contact_matrix)$values))
divide each row of the contact matrix by the corresponding demography
contact_matrix <- contact_matrix / demography_vector
n_demo_grps <- length(demography_vector)
r0 <- 10
susc_variable <- matrix(
data = c(0.75, 0.8, 0.85, 0.9, 1.0)
)
n_susc_groups <- 1L
p_susc_uniform <- matrix(
data = 1.0,
nrow = n_demo_grps,
ncol = n_susc_groups
)
final_size_heterog <- final_size(
r0 = r0,
contact_matrix = contact_matrix,
demography_vector = demography_vector,
susceptibility = susc_variable,
p_susceptibility = p_susc_uniform,
solver = 'iterative'
)
final_size_heterog
The results are:
I noticed that when just calling final_size(15), there are some warnings (though not in the previous case)
Thank you for the attention, as well as the package!