-
Notifications
You must be signed in to change notification settings - Fork 12
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
Multilevel model tutorial with dynamical systems #542
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When initializing the cadence of observations, you say:
obs_sample_rate = torch.tensor(1/7) # Take measurements one per week
However, since the timescale is months, not days, it should be
obs_sample_rate = torch.tensor(1/4) # Take measurements one per week
If you meant for the timestep to be days, then it should be:
obs_sample_rate = torch.tensor(7.0) # Take measurements one per week
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like the obs_sample_rate
is still 1/7, not 1/4.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since time is measured in units of months, a weekly obs_sample
rate should be 1/4, not 1/7.
…into sw-dynamic-multi-tutorial
Why is Edit: Nevermind. I now see that |
In |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The prior marginal and conditional distributions of the parameters should be a different color for each town. Currently, they are all the same color. This could be fixed by introducing:
town_colors = ["cyan", "magenta", "chartreuse"]
...
for i in range(3):
sns.kdeplot(
parameter_prior_samples['beta'][:, i],
ax=ax[1,0],
alpha=0.4,
color=town_colors[i],
label=f"Town {i} $\\beta$ - Marginal Probability",
linewidth=1.5,
bw_adjust=.6,
clip=(0, 1),
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple minor plotting issues, but otherwise, it looks ready to go.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since time is measured in units of months, a weekly obs_sample
rate should be 1/4, not 1/7.
This tutorial demonstrates how ChiRho's dynamical systems module composes with existing techniques in Bayesian hierarchical modeling. Specifically, this tutorial shows how to represent joint dependencies between parameters of non-interacting SIR models for different towns, and how ordinary probabilistic inference reflects reasonable intuition about how observations from one stratum inform our predictions for another.
Subsumes #351 .
TODO: