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

Some distributions don't have default parameters #26

Open
EmilHvitfeldt opened this issue Jun 27, 2019 · 1 comment
Open

Some distributions don't have default parameters #26

EmilHvitfeldt opened this issue Jun 27, 2019 · 1 comment

Comments

@EmilHvitfeldt
Copy link
Contributor

library(distributions)
#> 
#> Attaching package: 'distributions'
#> The following objects are masked from 'package:stats':
#> 
#>     Gamma, quantile
#> The following object is masked from 'package:grDevices':
#> 
#>     pdf
distributions::Bernoulli()
#> Bernoulli distribution (p = 0.5)
distributions::Beta()
#> Beta distribution (alpha = 1, beta = 1)
distributions::Binomial()
#> Error in distributions::Binomial(): argument "size" is missing, with no default
distributions::Cauchy()
#> Cauchy distribution (location = 0, scale = 1)
distributions::ChiSquare()
#> Error in distributions::ChiSquare(): argument "df" is missing, with no default
distributions::Exponential()
#> Exponential distribution (rate = 1)
distributions::FisherF()
#> Error in distributions::FisherF(): argument "df1" is missing, with no default
distributions::Gamma()
#> Error in distributions::Gamma(): argument "shape" is missing, with no default
distributions::Geometric()
#> Geometric distribution (p = 0.5)
distributions::HyperGeometric()
#> Error in distributions::HyperGeometric(): argument "m" is missing, with no default
distributions::Logistic()
#> Logistic distribution (location = 0, scale = 1)
distributions::LogNormal()
#> Lognormal distribution (log_mu = 0, log_sigma = 1)
distributions::Multinomial()
#> Error in distributions::Multinomial(): argument "size" is missing, with no default
distributions::NegativeBinomial()
#> Error in distributions::NegativeBinomial(): argument "size" is missing, with no default
distributions::Normal()
#> Normal distribution (mu = 0, sigma = 1)
distributions::Poisson()
#> Error in distributions::Poisson(): argument "lambda" is missing, with no default
distributions::StudentsT()
#> Error in distributions::StudentsT(): argument "df" is missing, with no default
distributions::Tukey()
#> Error in distributions::Tukey(): argument "nmeans" is missing, with no default
distributions::Uniform()
#> Continuous Uniform distribution (a = 0, b = 1)
distributions::Weibull()
#> Error in distributions::Weibull(): argument "shape" is missing, with no default

Created on 2019-06-27 by the reprex package (v0.3.0)

Is this intentional? do we want to provide a sensible default to ensure consistent behavior?

@1danjordan
Copy link
Contributor

I think there's two options here - give every distribution a sensible default or allow distributions be initialised without any parameters. This way users (and learners) have to be explicit about the distribution they want when they create it. It's slightly less user-friendly but I think has long term benefits (for learners and code bases).

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