-
Notifications
You must be signed in to change notification settings - Fork 100
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
Update advanced.jmd #414
Update advanced.jmd #414
Conversation
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.
LGTM, just added a few comments:) Nothing major though, so feel free to do with them as you wish.
|
||
More generally, there are often quantities in our models that we might be interested in viewing, but which are not explicitly present in our chain. | ||
|
||
We can generate draws from these variables — in this case, `x, y` — by adding them as a return statement to the model, and then calling `generated_quantities(model, chain)`. Calling this function outputs an array of values specified in the return statement of the model. |
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.
Maybe add a link to the docs for generated_quantities
?
In this case, it might be useful to reorganize our output into a matrix for plotting: | ||
|
||
```julia; eval=false | ||
reparam_chain = reduce(hcat, generated_quantities(Neal(), chain))' |
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.
I'm personally in favour of just keeping it as
reparam_chain = reduce(hcat, generated_quantities(Neal(), chain))' | |
reparam_chain = reduce(hcat, generated_quantities(Neal(), chain)) |
since this is a) what leads to the most efficient access, and b) (because of (a)) it's more commonly used.
The drawback is that MCMChains does not follow this convention 😕 So because of this, I'm happy to accept the current version, if you prefer it 👍
Often, the most natural parameterization for a model is not the most computationally feasible. Consider the following | ||
(efficiently reparametrized) implementation of Neal's funnel [(Neal, 2003)](https://arxiv.org/abs/physics/0009028): | ||
|
||
```julia; eval=false |
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.
Would it be worth making eval=true
here? Would potentially be nice to have the outputs of this example if it doesn't take too long to run:)
@shravanngoswamii, can you copy the changes here to #441? |
@yebai changes of new setup? OR just updated advanced.jmd? |
Only changes in the file |
Closed in favour of #441 |
No description provided.