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

fix immunized #89

Closed
wants to merge 1 commit into from
Closed

fix immunized #89

wants to merge 1 commit into from

Conversation

GianmarcoRasi
Copy link

Multiply 'fraction' by the proportion of susceptible individual to be sure to subtract and add a value that does not exceeds the proportion of susceptible individials

@AllenDowney
Copy link
Owner

I see the issue you are addressing -- this function is error-prone if fraction exceeds s. But the intention is that fraction is the fraction of the population that is immunized, so the responsibility is on the caller to make sure the argument is sensible. I'm inclined to leave it as is. What do you think?

@AllenDowney
Copy link
Owner

BTW, ignore the failing test -- that has nothing to do with this PR.

@GianmarcoRasi
Copy link
Author

Thank you for answering, and for asking about my opinion.

I think that sweeping over fraction would result in incorrect estimates of the count of overall infected individuals, since when s < fraction <= 1 the amount of susceptible individuals becomes negative. So, if we want to leave the function as it is then we should sweep between $0$ and the fraction of susceptible individuals s, not between $0$ and $1$.

However, leaving the code untouched would make it easier for a reader to internalize the concept (as it worked for me) even if the result is not 100% correct.

@GianmarcoRasi GianmarcoRasi deleted the develo branch June 19, 2024 11:17
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