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

dispersion_parameter(::Geometric) incorrectly returns true #564

Open
palday opened this issue Oct 1, 2024 · 1 comment
Open

dispersion_parameter(::Geometric) incorrectly returns true #564

palday opened this issue Oct 1, 2024 · 1 comment
Assignees

Comments

@palday
Copy link
Member

palday commented Oct 1, 2024

GLM.jl/src/glmtools.jl

Lines 484 to 500 in 0e145bd

"""
GLM.dispersion_parameter(D)
Does distribution `D` have a separate dispersion parameter, ϕ?
Returns `false` for the `Bernoulli`, `Binomial` and `Poisson` distributions, `true` otherwise.
# Examples
```jldoctest; setup = :(using GLM)
julia> show(GLM.dispersion_parameter(Normal()))
true
julia> show(GLM.dispersion_parameter(Bernoulli()))
false
```
"""
dispersion_parameter(D) = true
dispersion_parameter(::Union{Bernoulli, Binomial, Poisson}) = false

The only parameter of the geometric distribution is the success probability.

@palday palday self-assigned this Oct 1, 2024
@andreasnoack
Copy link
Member

I'm wondering if we dare define this as length(params(D)) > 1? Any obvious cases where it would be wrong? Alternatively, we'd probably have to define the list explicitly and error out for unknown distributions.

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