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

Make concentration in NegativeBinomialObservation a RandomVariable #267

Conversation

damonbayer
Copy link
Collaborator

@damonbayer damonbayer commented Jul 15, 2024

Closes #178.
Partially addresses #198.

I now also estimate the overdipsersion parameter in hospital_admissions_model.qmd.
This makes the inference take quite a while, so maybe we should look at reducing the scope of that tutorial.
It leads to a nice-looking posterior predictive:
fig-output-posterior-predictive-output-1

But funky looking posterior latent infections:
fig-output-infections-distribution-output-1

Not sure if this is just an artifact of the hdi plots or if it indicates something undesirable about the model.

@damonbayer damonbayer requested a review from a team July 15, 2024 23:16
@damonbayer damonbayer linked an issue Jul 15, 2024 that may be closed by this pull request
Copy link

codecov bot commented Jul 15, 2024

Codecov Report

Attention: Patch coverage is 93.75000% with 1 line in your changes missing coverage. Please review.

Project coverage is 92.80%. Comparing base (0219353) to head (0446afd).

Files Patch % Lines
model/src/pyrenew/observation/poisson.py 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #267      +/-   ##
==========================================
+ Coverage   92.73%   92.80%   +0.06%     
==========================================
  Files          40       40              
  Lines         909      903       -6     
==========================================
- Hits          843      838       -5     
+ Misses         66       65       -1     
Flag Coverage Δ
unittests 92.80% <93.75%> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sbidari
Copy link
Collaborator

sbidari commented Jul 16, 2024

@damonbayer did you also look at equal tailed intervals for the posterior latent infection?

@damonbayer
Copy link
Collaborator Author

damonbayer commented Jul 16, 2024

@damonbayer did you also look at equal tailed intervals for the posterior latent infection?

No. I would accept a PR to add that figure, though :)

@damonbayer damonbayer force-pushed the 178-make-concentration-in-negativebinomialobservation-a-randomvariable branch from 690cc59 to 673bab2 Compare July 16, 2024 15:38
@dylanhmorris
Copy link
Collaborator

Caught the problem in #269 from looking at the example figures highlighted here by @damonbayer. Suggest landing that first and merging it in here.

@damonbayer
Copy link
Collaborator Author

@dylanhmorris #269 is merged here

Copy link
Collaborator

@dylanhmorris dylanhmorris left a comment

Choose a reason for hiding this comment

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

LGTM

@dylanhmorris dylanhmorris merged commit ce055af into main Jul 17, 2024
8 checks passed
@dylanhmorris dylanhmorris deleted the 178-make-concentration-in-negativebinomialobservation-a-randomvariable branch July 17, 2024 14:00
@sbidari
Copy link
Collaborator

sbidari commented Jul 18, 2024

The posterior plots in this tutorial doesn't look right. Looks like the posterior samples are all just same array?
Capture1
and the diagnostics are bad
Capture

@damonbayer
Copy link
Collaborator Author

There is some variability in latent infections (see my original post), but I agree it is strange.

@sbidari
Copy link
Collaborator

sbidari commented Jul 18, 2024

There is no within chain variability in the posterior samples

@dylanhmorris
Copy link
Collaborator

The prior on the concentration is not working as written. I tried swapping in a LogNormal prior and things just worked. Will investigate further.

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.

Make Concentration in NegativeBinomialObservation a RandomVariable
3 participants