-
Notifications
You must be signed in to change notification settings - Fork 35
Add Emax decay function for use with vaccine interventions #370
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
base: main
Are you sure you want to change the base?
Conversation
b-s-code
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm afraid I'm not yet familiar with the actual mathematics used in EmaxFunction::compute, can you say a little more about that?
Also seems that:
- It's probably worth having a new or existing black-box unit test cover this feature.
- https://github.com/OpenMalaria-Org/openmalaria/wiki/ModelDecayFunctions should be updated with some mention of this feature.
| <xs:attribute name="IC50" type="xs:double" use="optional"> | ||
| <xs:annotation> | ||
| <xs:documentation> | ||
| IC 50 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Presumably no need to add info on units? I.e. user will make that decision elsewhere then apply it here, or there is some unit which should always be used?
| } | ||
|
|
||
| private: | ||
| unique_ptr<DecayFunction> f; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My preference would be to have unique_ptr, move etc. prefixed with std::.
|
|
||
| double compute(double effectiveAge) const { | ||
| double fcomp = pow(initialConcentration * f->eval(effectiveAge), slope); | ||
| return max(min(Emax * fcomp / (fcomp + IC50), 1.0), 0.0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I propose putting the max/min calls for bounding result to [0, 1] on a separate line so the actual expression is easier to read.
| double fcomp = pow(initialConcentration * f->eval(effectiveAge), slope); | ||
| return max(min(Emax * fcomp / (fcomp + IC50), 1.0), 0.0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not familiar with this particular formula. Is this something for which users may require docs? (schema docs/wiki)
Add the Emax decay function for use with vaccine interventions.
Example:
This has been further tested using OpenMalaria's PEV vaccine with the Emax decay function to match known Weibull parameters. This was done by looking at nNewInfections in OpenMalaria over 5d surveys.