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

Add equilibrium solution to P.v model #322

Merged
merged 2 commits into from
Oct 25, 2024

Conversation

RJSheppard
Copy link
Member

Added in functionality to start at equilibrium, based on Michael White's equilibrium solution. This is accessed in initial equilibrium calculation in compatability and in variable creation. The equilibrium solution is found in malariaEquilibriumVivax.

Note that we draw individuals from a joint probability distribution over age and het group to generate human state and number of hypnozoite batches.

tests included to check correct equilibrium is generated and maintained.

I have also added the An. koliensis parameters as found in Michael White's repo in order to compare equilibrium solutions.

A few errors were identified. Total infection rates were not being calculated correctly in human_infection.R. Lagged infectivity needs to be saved before the current infectivity is extracted during the biting_process.R. Also, when immunity is boosted through infection, this should incorporate the decrease in immunity from decay (there may be better ways of achieving this).

@RJSheppard RJSheppard force-pushed the vivax_competing_hazards_main_hypnozoites branch 3 times, most recently from ec751e9 to 4b38d43 Compare September 18, 2024 12:22
@RJSheppard RJSheppard force-pushed the vivax_competing_hazards_main_equilibrium branch 2 times, most recently from b807634 to 16cc8c4 Compare September 18, 2024 14:56
@RJSheppard RJSheppard force-pushed the vivax_competing_hazards_main_hypnozoites branch from 4b38d43 to 1916fa1 Compare September 19, 2024 12:58
@RJSheppard RJSheppard force-pushed the vivax_competing_hazards_main_equilibrium branch from 16cc8c4 to a75a671 Compare September 19, 2024 13:00
@RJSheppard RJSheppard force-pushed the vivax_competing_hazards_main_hypnozoites branch from 1916fa1 to b481153 Compare September 19, 2024 14:22
@RJSheppard RJSheppard force-pushed the vivax_competing_hazards_main_equilibrium branch from a75a671 to 2e0e3f3 Compare September 19, 2024 14:56
@RJSheppard RJSheppard force-pushed the vivax_competing_hazards_main_hypnozoites branch from b481153 to 42083f2 Compare September 20, 2024 16:27
@RJSheppard RJSheppard force-pushed the vivax_competing_hazards_main_equilibrium branch from 2e0e3f3 to 6309897 Compare September 20, 2024 16:29
@RJSheppard RJSheppard force-pushed the vivax_competing_hazards_main_hypnozoites branch from 42083f2 to e2adee2 Compare October 14, 2024 09:16
@RJSheppard RJSheppard force-pushed the vivax_competing_hazards_main_hypnozoites branch from 7166cba to da381b9 Compare October 22, 2024 15:43
@RJSheppard RJSheppard force-pushed the vivax_competing_hazards_main_equilibrium branch from 6309897 to 921c84f Compare October 22, 2024 16:07
Base automatically changed from vivax_competing_hazards_main_hypnozoites to dev October 22, 2024 16:15
…e's equilibrium solution. This is accessed during the initial equilibrium calculation in compatability and during the variable creation. The equilibrium solution is found in malariaEquilibriumVivax.

Note that we draw individuals from a joint probability distribution over age and het group to generate human state, immunities and number of hypnozoite batches.

tests included to check correct equilibrium is generated and maintained.

I have also added the An. koliensis parameters as found in Michael White's repo in order to compare equilibrium solutions.

Lagged infectivity needs to be saved before the current infectivity is extracted during the biting_process.R. Also, when immunity is boosted through infection, this should incorporate the decrease in immunity from decay (there may be better ways of achieving this).
@RJSheppard RJSheppard force-pushed the vivax_competing_hazards_main_equilibrium branch from 921c84f to 16666ba Compare October 22, 2024 16:17
@RJSheppard
Copy link
Member Author

/benchmark

Copy link

This is how benchmark results would change (along with a 95% confidence interval in relative change) if 16666ba is merged into dev:

  • ✔️large_population: 2.38m -> 2.39m [-1.5%, +2.39%]
  • ❗🐌small_population: 32.4s -> 34.2s [+2.66%, +8.44%]

Further explanation regarding interpretation and methodology can be found in the documentation.
Plots and raw data are available as artifacts of the workflow run.

Copy link
Member

@giovannic giovannic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice! Just making sure the right tests run on CI, comments in line.

expect_equal(counts, expected, tolerance=1e-3)
})

test_that('vivax ODE stays at equilibrium with low total_M', {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is perhaps redundant? Is there any change in the vector model for vivax?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there was a while when I wasn't sure, but I think you're right: I can take them out.

})


test_that('vivax changing total_M stabilises', {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

@@ -0,0 +1,86 @@
test_that('Initial states are consistent with equilibrium', {
skip_on_ci()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could run this on the CI? It seems valuable and quick to run. If we're not doing this for falciparum, maybe we should be.

})

test_that('Initial immunities are consistent with equilibrium', {
skip_on_ci()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

})

test_that('vivax equilibrium works with multiple species', {
skip_on_ci()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant?

@RJSheppard RJSheppard merged commit fa12d59 into dev Oct 25, 2024
4 checks passed
@RJSheppard RJSheppard deleted the vivax_competing_hazards_main_equilibrium branch October 25, 2024 10:14
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

Successfully merging this pull request may close these issues.

3 participants