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

Check additivity vs multiplicativity of interventions #255

Closed
adamkucharski opened this issue Nov 7, 2024 · 2 comments
Closed

Check additivity vs multiplicativity of interventions #255

adamkucharski opened this issue Nov 7, 2024 · 2 comments

Comments

@adamkucharski
Copy link
Member

In the odin implementation, we currently have multiplicative interventions on the contact rate, defined via a log transform:

  contact_reduction[, ] <- if (t > intervention_start[i] && t < intervention_end[i]) (1.0 - intervention_effect[i, j]) else 1 # nolint: line_length_linter.
  contact_reduction_log[, ] <- log(contact_reduction[i, j] + 1e-10) # Avoid zero
  contact_reduction_total_log[] <- sum(contact_reduction_log[, i])
  contact_reduction_total[] <- exp(contact_reduction_total_log[i])

This seems to matches the vignette output for overlapping interventions with the same parameter set.

However, the vignette states that "All further interventions are assumed to be additional percentage point increases on the effect of any active interventions.". This functionality comes from cumulative_contacts_intervention() in intervention.R. We should work out what's driving this difference.

@adamkucharski
Copy link
Member Author

Update: the difference comes because the default scenarios for overlapping interventions in the vignette target different ages (children and adults), so the difference isn't obviously apparent. If instead we set the 1st intervention to c(0.3,0.3,0.3) and the second to c(0.7,0.7,0.7), we get non-zero transmission in the multiplicative odin assumption
Screenshot 2024-11-06 at 19 55 29

and zero in the additive one:
Screenshot 2024-11-06 at 19 55 55

This should be a reasonably straightfoward fix in the internal odin machinery – will flag on issue #254.

@adamkucharski
Copy link
Member Author

Have pushed a fix to the odin model branch, and now get matching outputs for odin:
Screenshot 2024-11-06 at 20 04 59

and original cpp:
Screenshot 2024-11-06 at 20 04 36

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

No branches or pull requests

1 participant