docs icon indicating copy to clipboard operation
docs copied to clipboard

[FR] Distribution plots in the manual

Open SteveBronder opened this issue 5 years ago • 6 comments

Summary:

Like how wiki has https://en.wikipedia.org/wiki/Gumbel_distribution it may be nice to have a picture for each distribution with different parameters in the function docs

Additional Information:

Since most of (all?) of the docs are in .Rmd I think this would just be calling the _rng for each distribution and making a pretty plot of the distribution with different params

Current Version:

v2.18.0

SteveBronder avatar Jan 09 '20 15:01 SteveBronder

excellent idea! will investigate

mitzimorris avatar Jan 09 '20 15:01 mitzimorris

On Jan 9, 2020, at 10:04 AM, Steve Bronder [email protected] wrote:

Summary:

Like how wiki has https://en.wikipedia.org/wiki/Gumbel_distribution it may be nice to have a picture for each distribution with different parameters in the function docs

Additional Information:

Since most of (all?) of the docs are in .Rmd I think this would just be calling the _rng for each distribution and making a pretty plot of the distribution with different params

Rather than using an RNG and then a smoothed plot like loess, we can just use stat_function:

https://ggplot2.tidyverse.org/reference/stat_function.html

This is tricky as the distributions have multiple shapes, so you'd also want something like the gamma distribution plots from Wikipedia.

The reason I never did this before is that it seems redundant with Wikipedia. We need to define what our functions do so people know which parameterization of gamma, etc., we use, but I don't think we need to write a textbook on them all. So I'd make this a low priority project, though definitely one where we'd accept a PR.

bob-carpenter avatar Jan 09 '20 19:01 bob-carpenter

The reason I never did this before is that it seems redundant with Wikipedia. We need to define what our functions do so people know which parameterization of gamma, etc., we use, but I don't think we need to write a textbook on them all. So I'd make this a low priority project, though definitely one where we'd accept a PR.

Maybe an alt half cent solution would just be wiki links. My current methodology is 'look at distribution name', "What does that look like exactly again?", 'type distro in search bar', "Ah yes, indeed"

SteveBronder avatar Jan 21 '20 05:01 SteveBronder

Just be careful because some distributions such as negative binomial have multiple parameterizations.

On Jan 21, 2020, at 12:21 AM, Steve Bronder [email protected] wrote:

The reason I never did this before is that it seems redundant with Wikipedia. We need to define what our functions do so people know which parameterization of gamma, etc., we use, but I don't think we need to write a textbook on them all. So I'd make this a low priority project, though definitely one where we'd accept a PR.

Maybe an alt half cent solution would just be wiki links. My current methodology is 'look at distribution name', "What does that look like exactly again?", 'type distro in search bar', "Ah yes indeed"

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/stan-dev/docs/issues/119?email_source=notifications&email_token=AAZYCUOH7C3Y4DFT4P3H5NDQ62A6BA5CNFSM4KEZXUKKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJOQTYY#issuecomment-576522723, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZYCUIT5VLAELQQWZZFFODQ62A6BANCNFSM4KEZXUKA.

andrewgelman avatar Jan 21 '20 05:01 andrewgelman

Just be careful because some distributions such as negative binomial have multiple parameterizations.

I think it'd be one plot per parameterization.

Also, this is tricky because distributions like the gamma have very different shapes depending on the parameters. And I don't know how to visualize multivariate densities beyond 2D.

bob-carpenter avatar Jan 21 '20 18:01 bob-carpenter

I think something like what @rok-cesnovar has been working on here https://github.com/rok-cesnovar/stan-distributions could be nice if we could find a way to incorporate it with the existing documentation (at least for the web version, pdf wouldn't be able to use such a thing)

WardBrian avatar Dec 10 '21 17:12 WardBrian