Title: gammavariate uses misleading parameter names. · Issue #104337 · python/cpython · GitHub
Open Graph Title: gammavariate uses misleading parameter names. · Issue #104337 · python/cpython
X Title: gammavariate uses misleading parameter names. · Issue #104337 · python/cpython
Description: Documentation for gammavariate The parameters of the gammavariate function (in random module) are alpha, beta. We can see, from the mathematical description given, that these correspond to shape and scale. Wikipedia conventionally descri...
Open Graph Description: Documentation for gammavariate The parameters of the gammavariate function (in random module) are alpha, beta. We can see, from the mathematical description given, that these correspond to shape an...
X Description: Documentation for gammavariate The parameters of the gammavariate function (in random module) are alpha, beta. We can see, from the mathematical description given, that these correspond to shape an...
Opengraph URL: https://github.com/python/cpython/issues/104337
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"gammavariate uses misleading parameter names.","articleBody":"# Documentation for gammavariate\r\n\r\nThe parameters of the `gammavariate` function (in `random` module) are `alpha`, `beta`.\r\n\r\nWe can see, from the mathematical description given, that these correspond to _shape_ and _scale_. [Wikipedia conventionally describes these using the symbols `k` and `theta`](https://en.wikipedia.org/wiki/Gamma_distribution). Wikipedia uses `beta` for _rate_, which is the reciprocal of _scale_: _beta_ = 1/_theta_\r\n\r\nThis is a proposal to:\r\n\r\n- explain that `alpha` and `beta` are also known as _shape_ and _scale_;\r\n- reinforce that by adding that μ is proportional to _scale_;\r\n- add a warning that these are not the conventional names.\r\n\r\nor, more controversially, scrap all that and rename the parameters _k_ and _theta_. I understand that the parameter names leak into the API, so maybe not this option.\r\n\r\nSide note: there is some variability in naming convention. The only textbook i have to hand is Grimmett and Stirzaker \"Probability and Random Process\" (OUP, 1982). That uses Γ(λ, t) where _lambda_ is rate and _t_ is shape.\r\n\r\n(A clear and concise description of the issue.)\r\n\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-104410\n* gh-104481\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/drj11","@type":"Person","name":"drj11"},"datePublished":"2023-05-09T18:33:13.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":8},"url":"https://github.com/104337/cpython/issues/104337"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:6c3ede76-f6dc-01d0-db6c-2ffeed48a82d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D630:1E9341:9FCC52:D9B1AF:6969E2EB |
| html-safe-nonce | c14e9ac20d64c4f0220099451251dd5e76a7ecd905b65d15433f9d96d5d3fa33 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENjMwOjFFOTM0MTo5RkNDNTI6RDlCMUFGOjY5NjlFMkVCIiwidmlzaXRvcl9pZCI6IjI2OTE0MTEzMzA0NzQ4Mjg1MjMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | d773ce7ef825798b5625e11e204c2b5d61bfba3f2976ad7fe708cbd46c812a14 |
| hovercard-subject-tag | issue:1702552411 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/104337/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1a9bbcda5eb87c0643ebf6c60601777726810fc0d948e1c6da5ecc85f9cbe2de/python/cpython/issues/104337 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1a9bbcda5eb87c0643ebf6c60601777726810fc0d948e1c6da5ecc85f9cbe2de/python/cpython/issues/104337 |
| og:image:alt | Documentation for gammavariate The parameters of the gammavariate function (in random module) are alpha, beta. We can see, from the mathematical description given, that these correspond to shape an... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | drj11 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7b32f1c7c4549428ee399213e8345494fc55b5637195d3fc5f493657579235e8 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | bdde15ad1b403e23b08bbd89b53fbe6bdf688cad |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width