Skip to content

Commit

Permalink
Older age groups (older than equilibrium age object) are not correctl…
Browse files Browse the repository at this point in the history
…y initiated. If outside of the age range, they get assigned 1 - the youngest age group. If we limit the max ages during these steps, we get something that is more accurate.
  • Loading branch information
RJSheppard committed May 9, 2024
1 parent 7e62cc9 commit d0854db
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions R/variables.R
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,8 @@ initial_immunity <- function(
) {
if (!is.null(eq)) {
age <- age / 365
# older ages must be assigned within the equilibrium age bounds
age[age>=max(eq[[1]][, 'age'])] <- max(eq[[1]][, 'age'])-0.01
return(vnapply(
seq_along(age),
function(i) {
Expand All @@ -338,6 +340,8 @@ initial_state <- function(parameters, age, groups, eq, states) {
if (!is.null(eq)) {
eq_states <- c('S', 'D', 'A', 'U', 'T')
age <- age / 365
# older ages must be assigned within the equilibrium age bounds
age[age>=max(eq[[1]][, 'age'])] <- max(eq[[1]][, 'age'])-0.01
return(vcapply(
seq_along(age),
function(i) {
Expand Down

0 comments on commit d0854db

Please sign in to comment.