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

Add the one-parameter Lindley distribution #1678

Merged
merged 8 commits into from
Feb 25, 2023
Merged

Add the one-parameter Lindley distribution #1678

merged 8 commits into from
Feb 25, 2023

Conversation

ararslan
Copy link
Member

@ararslan ararslan commented Feb 13, 2023

This requires a new dependency on LambertW.jl, which is actively maintained and has no dependencies of its own. I'm also currently using evalpoly, which was introduced in Julia 1.4, but this package currently requires at least 1.3. IMO we should raise the minimum supported version to 1.6 anyway; I've done so in a separate commit.

@ararslan ararslan added the feature: new distribution Feature request for a new distribution label Feb 13, 2023
@codecov-commenter
Copy link

codecov-commenter commented Feb 18, 2023

Codecov Report

Base: 85.71% // Head: 85.40% // Decreases project coverage by -0.31% ⚠️

Coverage data is based on head (19090ca) compared to base (e761040).
Patch coverage: 69.87% of modified lines in pull request are covered.

❗ Current head 19090ca differs from pull request most recent head 2523d67. Consider uploading reports for the commit 2523d67 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1678      +/-   ##
==========================================
- Coverage   85.71%   85.40%   -0.31%     
==========================================
  Files         130      131       +1     
  Lines        8230     8286      +56     
==========================================
+ Hits         7054     7077      +23     
- Misses       1176     1209      +33     
Impacted Files Coverage Δ
src/Distributions.jl 100.00% <ø> (ø)
src/univariates.jl 74.54% <ø> (ø)
src/univariate/continuous/lindley.jl 69.87% <69.87%> (ø)
src/univariate/continuous/pgeneralizedgaussian.jl 68.57% <0.00%> (-31.43%) ⬇️
...rc/univariate/continuous/skewedexponentialpower.jl 71.42% <0.00%> (-17.67%) ⬇️
src/univariate/continuous/triangular.jl 93.02% <0.00%> (-4.66%) ⬇️
src/univariate/discrete/bernoulli.jl 86.95% <0.00%> (-2.90%) ⬇️
src/univariate/continuous/laplace.jl 95.31% <0.00%> (-1.57%) ⬇️
src/multivariate/multinomial.jl 84.35% <0.00%> (-1.37%) ⬇️
src/multivariate/dirichlet.jl 77.51% <0.00%> (-0.41%) ⬇️
... and 17 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@ararslan ararslan force-pushed the aa/lindley branch 2 times, most recently from 6ede24e to 10af11d Compare February 21, 2023 04:34
@ararslan ararslan marked this pull request as ready for review February 21, 2023 04:39
@ararslan ararslan requested a review from devmotion February 21, 2023 04:39
Project.toml Outdated Show resolved Hide resolved
Project.toml Outdated Show resolved Hide resolved
return Lindley{typeof(θ)}(θ)
end

Lindley(θ::Integer; check_args::Bool=true) = Lindley(float(θ); check_args=check_args)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this method needed? For most/all functions integers should work equally well, I assume?

Suggested change
Lindley(θ::Integer; check_args::Bool=true) = Lindley(float(θ); check_args=check_args)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Originally I didn't have this but one of the automated tests checks that integer input gives you a float parameter.

src/univariate/continuous/lindley.jl Show resolved Hide resolved
src/univariate/continuous/lindley.jl Outdated Show resolved Hide resolved
src/univariate/continuous/lindley.jl Outdated Show resolved Hide resolved
src/univariate/continuous/lindley.jl Outdated Show resolved Hide resolved
src/univariate/continuous/lindley.jl Outdated Show resolved Hide resolved
src/univariate/continuous/lindley.jl Outdated Show resolved Hide resolved
src/univariate/continuous/lindley.jl Outdated Show resolved Hide resolved
test/univariate/continuous/lindley.jl Outdated Show resolved Hide resolved
src/univariate/continuous/lindley.jl Outdated Show resolved Hide resolved
src/univariate/continuous/lindley.jl Outdated Show resolved Hide resolved
@ararslan ararslan requested a review from devmotion February 24, 2023 17:07
@ararslan
Copy link
Member Author

I really appreciate the thorough review, @devmotion!

@ararslan
Copy link
Member Author

(Note that one of the commits here includes [ci skip], which should be removed from the consolidated commit message when squash-merged)

Copy link
Member

@devmotion devmotion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@ararslan
Copy link
Member Author

Thanks again!

@ararslan ararslan merged commit 5b99fe0 into master Feb 25, 2023
@ararslan ararslan deleted the aa/lindley branch February 25, 2023 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: new distribution Feature request for a new distribution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants