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

Cannot use the scale and shape arguments of dist_gamma() because rate argument must be supplied #132

Closed
gavinsimpson opened this issue Jan 3, 2025 · 1 comment

Comments

@gavinsimpson
Copy link

It does not appear possible to use dist_gamma() with the shape and scale parameterisation of the Gamma distribution; the rate argument must always be provided.

library("distributional")
dist_gamma(shape = 2, scale = 0.5)
#> Error in dist_gamma(shape = 2, scale = 0.5): argument "rate" is missing, with no default
dist_gamma(shape = 2, rate = 1 / 0.5)
#> <distribution[1]>
#> [1] Γ(2, 2)
dist_gamma(shape = 2, rate = 1 / 2, scale = 2)
#> <distribution[1]>
#> [1] Γ(2, 0.5)
dist_gamma(shape = 2, scale = 2, rate = 1 / 2)
#> <distribution[1]>
#> [1] Γ(2, 0.5)

Created on 2025-01-03 with reprex v2.1.1

Expected behaviour would be that the scale argument could be used as an alternative in a manner similar to stats::rgamma.

@mitchelloharawild
Copy link
Owner

Fixed, thanks.

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

No branches or pull requests

2 participants