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

Multilevel model tutorial with dynamical systems #542

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
05dee76
setup model for bayesian hierarchical prior
SamWitty Apr 30, 2024
8e91896
add plot of inferred parameters
SamWitty Apr 30, 2024
c91d3d3
telling the story a bit better
SamWitty Apr 30, 2024
93f5e58
tuned parameters to tell the story
SamWitty May 1, 2024
ba4dee4
added rendering and prior predictive plot with intervention
SamWitty May 3, 2024
165bc56
Merge branch 'master' of https://github.com/BasisResearch/causal_pyro…
SamWitty Aug 21, 2024
9305e1f
added some explanatory text
SamWitty Aug 21, 2024
b8bee67
misc edits
SamWitty Sep 26, 2024
7f02300
revised visualizations
rfl-urbaniak Sep 26, 2024
37a4ffa
stronger intervention
rfl-urbaniak Sep 26, 2024
7b92c91
textual content WIP
rfl-urbaniak Sep 27, 2024
21826b7
revise overview
rfl-urbaniak Oct 18, 2024
b12a2c9
mdoel description
rfl-urbaniak Oct 18, 2024
4b802f7
prior distributions plot
rfl-urbaniak Oct 18, 2024
6e150a8
posterior visualizations and explanations wip
rfl-urbaniak Oct 18, 2024
336919b
add text, revised marginal plots
rfl-urbaniak Oct 21, 2024
2068526
rerun the whole notebook
rfl-urbaniak Nov 19, 2024
ca098db
re-run
rfl-urbaniak Nov 19, 2024
3ea9ce4
Merge branch 'master' of https://github.com/BasisResearch/chirho into…
rfl-urbaniak Nov 25, 2024
aedda46
text addition and cleanup
rfl-urbaniak Nov 25, 2024
a038b22
TOC
SamWitty Jan 16, 2025
52e0f15
more updates
SamWitty Jan 21, 2025
b6a5ce3
legend
SamWitty Jan 21, 2025
9efa0fd
more progress
SamWitty Jan 21, 2025
8448a77
revise plots and a bit of text for prior and posterior predictives
SamWitty Jan 21, 2025
502f1b6
wrapped up text and reran
SamWitty Jan 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
telling the story a bit better
SamWitty committed Apr 30, 2024
commit c91d3d3bff120cce35cfc47d73e08dd5f287078e
238 changes: 110 additions & 128 deletions docs/source/dynamical_multi.ipynb
SamWitty marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Collaborator

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

Copy link
Collaborator

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.

Copy link
Collaborator

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.

Copy link
Collaborator

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),
    )

Large diffs are not rendered by default.