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 overdispersed models to contrib.epidemiology #2498

Merged
merged 14 commits into from
May 30, 2020
Merged

Conversation

fritzo
Copy link
Member

@fritzo fritzo commented May 22, 2020

Addresses #2426

This aims to improve fit to real data and improve mixing by relaxing all Binomial distributions to precisely overdispersed BetaBinomials such that the large population limiting dynamics is an SDE rather than a deterministic ODE. These new distributions are used in two new models: OverdispersedSIRModel and OverdispersedSEIRModel.

Questions

  • Is the proposed overdispersion parameter reasonable?
  • Should this be a global parameter, a local parameter, or an inferred variable?
    • An inferred variable works well, I've chosen the weak prior Beta(2, 2)

Tested

  • unit tests for distribution changes
  • unit tests verifying properties of overdispersion
  • smoke tests for use in SIR models
  • profiling: switching to BetaBinomials results in ~20% slowdown of likelihood computation

if _is_zero(overdispersion):
return dist.ExtendedBinomial(total_count, probs)
if getattr(probs, "dtype", torch.float64) != torch.float64:
warnings.warn("binomial_dist is unstable for dtypes less than torch.float64; "
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this really the source?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point. I've moved the warning to CompartmentalModel.fit() and .predict().

@fritzo
Copy link
Member Author

fritzo commented May 30, 2020

@martinjankowiak thanks for your patience. I've isolated the changes to two new models. I plan to test these on real data in the next couple weeks.

@fritzo fritzo changed the title Use overdispersed Binomials throughout contrib.epidemiology Add overdispersed Binomials models to contrib.epidemiology May 30, 2020
@fritzo fritzo changed the title Add overdispersed Binomials models to contrib.epidemiology Add overdispersed models to contrib.epidemiology May 30, 2020
@martinjankowiak martinjankowiak merged commit 69bf9a3 into dev May 30, 2020
@fritzo fritzo deleted the sir-overdispersed branch May 31, 2020 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants