mrc-ide / helios

Simulating far UVC for pathogen control
https://mrc-ide.github.io/helios/
Other
5 stars 0 forks source link

non-empirical household variable generation creates households with children living on their own #44

Open cwhittaker1000 opened 7 months ago

cwhittaker1000 commented 7 months ago

As above, bug fix required

cwhittaker1000 commented 7 months ago

Low priority as we'll use the empirical approach based on bootstrapping UK households for now.

athowes commented 7 months ago

See https://mrc-ide.github.io/helios/articles/helios.html#households for illustration of issue.

athowes commented 6 months ago

After exposing function can use the following to verify problem:

df <- data.frame(individual_households, age_class_vector)
just_child <- 0
just_child_list <- list()

for(i in individual_households) {
  household <- df[df$individual_households == i, ]
  if(all(household$age_class_vector == "child")) {
    just_child <- just_child + 1
    just_child_list[[i]] <- household$age_class_vector
  }
}

names(just_child_list) <- seq_along(just_child_list)
just_child_list[sapply(just_child_list, is.null)] <- NULL

just_child_list
just_child

I got

> just_child
[1] 381
athowes commented 6 months ago

Made some progress on this on the branch just-child-bug but didn't get to a fix

cwhittaker1000 commented 5 months ago

@athowes and @tbreweric what do we think about just removing the non-empirical version of this function from the package?