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

rate inputs for create_progression_process are average state residence times #290

Open
tbreweric opened this issue Apr 21, 2024 · 3 comments

Comments

@tbreweric
Copy link
Contributor

As raised in the PR #289, the create_progression_process() function (disease_progression.R), which governs the way individuals move between some pairs of states, has an argument rate which is currently passed mean state duration time. Within the function, the inverse of this rate argument is used to sample individuals to move between states.

While a fix has been suggested for naming the Bitset$sample() function in the individual package, in the meantime the malariasimulation code could be made clearer by passing the create_progression_process() function the rate in each instance in which it is called (e.g. 1/parameters$dt for transitions from the Tr to the S state).

@tbreweric
Copy link
Contributor Author

Have made a working version with this fix on the bug/progression_process_rates branch

@giovannic
Copy link
Member

giovannic commented Apr 22, 2024

That branch is a good start.

I would suggest that, now it's clearer that $sample takes a probability, we:

  • rename the rate argument of create_progression_process (and asymp. prog. process) to prob
  • update the argument to take a probability 1- exp(-rate)
  • and check that this test continues to pass.

Separately, Individual will be updated to make that code clearer.

@tbreweric
Copy link
Contributor Author

I changed the rate argument to prob and implemented the progression processes in the following way:

create_progression_process(
  variables$state,
  'U',
  'S',
  1 - exp(-1/parameters$du),
  variables$infectivity,
  0
)

Is this what you had in mind @giovannic?

The test flagged still passes. As I've now merged the SPC (#289) branch to dev, which changes the way the process moving individuals from Tr -> S is called, I need to align these changes to the updated version.

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

2 participants