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

Update advanced.jmd #414

Closed
wants to merge 4 commits into from
Closed

Update advanced.jmd #414

wants to merge 4 commits into from

Conversation

yebai
Copy link
Member

@yebai yebai commented Jul 30, 2023

No description provided.

tutorials/docs-09-using-turing-advanced/advanced.jmd Outdated Show resolved Hide resolved
tutorials/docs-09-using-turing-advanced/advanced.jmd Outdated Show resolved Hide resolved
tutorials/docs-09-using-turing-advanced/advanced.jmd Outdated Show resolved Hide resolved
tutorials/docs-09-using-turing-advanced/advanced.jmd Outdated Show resolved Hide resolved
tutorials/docs-09-using-turing-advanced/advanced.jmd Outdated Show resolved Hide resolved
tutorials/docs-09-using-turing-advanced/advanced.jmd Outdated Show resolved Hide resolved
tutorials/docs-09-using-turing-advanced/advanced.jmd Outdated Show resolved Hide resolved
tutorials/docs-09-using-turing-advanced/advanced.jmd Outdated Show resolved Hide resolved
yebai and others added 2 commits July 30, 2023 22:22
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>
@yebai yebai requested a review from torfjelde July 30, 2023 21:24
Copy link
Member

@torfjelde torfjelde left a 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.
Copy link
Member

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))'
Copy link
Member

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

Suggested change
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
Copy link
Member

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

@yebai
Copy link
Member Author

yebai commented May 21, 2024

@shravanngoswamii, can you copy the changes here to #441?

@shravanngoswamii
Copy link
Member

shravanngoswamii commented May 21, 2024

@yebai changes of new setup? OR just updated advanced.jmd?

@yebai
Copy link
Member Author

yebai commented May 21, 2024

Only changes in the file updated advanced.jmd.

@yebai
Copy link
Member Author

yebai commented May 23, 2024

Closed in favour of #441

@yebai yebai closed this May 23, 2024
@yebai yebai deleted the yebai-patch-2 branch May 23, 2024 17:08
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.

3 participants