Skip to content
This repository has been archived by the owner on Jul 7, 2022. It is now read-only.

Performance boost through normal approximations #49

Merged
merged 40 commits into from
Apr 27, 2020

Conversation

ckoerber
Copy link
Contributor

TL;DR

This PR contains a simplified approach to accommodate error propagations due to uncertain parameters in the SIR/SEIR model. For known priors, forecast uncertainties are computed within 20ms (on a laptop) for ~200 days and statistically agree with the original approach.

error-propagation-comparison

Results at 50% C.I. for the Downtown area.

What is present

  • New bayes_chime.normal module which provides an interface for using normal approximations in error propagation and posterior estimations
  • Comparison to original fit and usage guide in notebooks/How-to-use-normal-approximations-module.ipynb
  • Unittest to compare mean results against original penn_chime for SIR; SIR-SEIR crosschecks
  • Setup file to make package installable

Details

The README-normal-extension.md file specifies more details about this PR.
I've tried to limit the math to files in bayes_chime/normal/models/; in particular the simulation_step method of implemented models.

Open questions

  • As can be seen above, even though mean values agree, the uncertainty of census data seems to be significantly different. This is challenging to understand because the admissions seem to agree just fine (and the implementation is the same).
  • Computing posteriors from normal parameters seems promising (~2s computation time, almost all parameters statistically agree with original approach) but needs to be analyzed in detail (see last cells of notebook).

Further remarks

  • The current version tries to be rather "readable" and "extendable" at the potential cost of performance
  • I do not insist on any details of the implementation. If you have suggestions for improvements (like names), please let me know
  • This PR was generated with the help of @acd and @cjbayesian. Thanks for the feedback :)
  • I believe it is relatively easy to create chained "fits" for different regions by wrapping different models with shared parameters. Let me know if you are interested in this.

Related issues

In some sense, this is related to issues #26, #30, #31, #32.

@ckoerber ckoerber changed the title Feature normal approximation Performance boost through normal approximations Apr 24, 2020
@cjbayesian cjbayesian self-requested a review April 24, 2020 14:15
@cranedroesch cranedroesch self-requested a review April 24, 2020 14:49
@cjbayesian cjbayesian merged commit 8364e69 into pennsignals:master Apr 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants