Skip to content

Conversation

@acavelan
Copy link
Collaborator

@acavelan acavelan commented Jun 29, 2023

Add the Emax decay function for use with vaccine interventions.

Example:

<decay Emax="1" IC50="0.5" slope="@SLOPE@" initialConcentration="1" function="emax">\
      <decay L="1y" function="exponential"/>\
</decay>

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.

image image

@acavelan acavelan marked this pull request as ready for review December 12, 2025 09:31
Copy link
Collaborator

@b-s-code b-s-code left a 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:

<xs:attribute name="IC50" type="xs:double" use="optional">
<xs:annotation>
<xs:documentation>
IC 50
Copy link
Collaborator

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;
Copy link
Collaborator

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);
Copy link
Collaborator

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.

Comment on lines +335 to +336
double fcomp = pow(initialConcentration * f->eval(effectiveAge), slope);
return max(min(Emax * fcomp / (fcomp + IC50), 1.0), 0.0);
Copy link
Collaborator

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)

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.

2 participants