Skip to content

Translate the Multiple Choice chapter to numpyro#21

Draft
kylejcaron wants to merge 2 commits into
mainfrom
numpyro/ch4
Draft

Translate the Multiple Choice chapter to numpyro#21
kylejcaron wants to merge 2 commits into
mainfrom
numpyro/ch4

Conversation

@kylejcaron

Copy link
Copy Markdown
Collaborator

Adds tabs to the Multiple Choice chapter for numpyro

plot_logit_grid(
"Rescaled predictor and weakly informative prior",
"Standardized exam score",
logit_prior,

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@aloctavodia Calling out that under the numpyro example, this would break because plot_logit_grid is expecting a cmdstanpy model.

Do we want to leave as is, or should I adjust the function to have routing based on the model?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Better to change it. I did it for the other functions, but it seems I missed this one.

"sigma_mu_ab": jnp.array([5., 10.]),
"mu_sigma_ab": jnp.array([5., 10.]),
}
longdata_6["student"] = jnp.array(longdata_6["student"]) - 1

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@aloctavodia calling out the tabs get a little awkward with data handling around 0 vs 1 indexing. its not too bad, but it causes the numpyro blocks to end up being longer

thoughts?

:::

```{python}
posterior = az.extract(az.from_cmdstanpy(break_1_fit), group="posterior")

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

adjusted this so these cells work for both numpyro and cmdstanpy

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.

2 participants