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

Fix #1356 #1357

Merged
merged 1 commit into from
Jul 3, 2021
Merged

Fix #1356 #1357

merged 1 commit into from
Jul 3, 2021

Conversation

devmotion
Copy link
Member

Fixes #1356.

@codecov-commenter
Copy link

codecov-commenter commented Jul 3, 2021

Codecov Report

Merging #1357 (61fed19) into master (a6b9960) will increase coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1357      +/-   ##
==========================================
+ Coverage   82.74%   82.76%   +0.01%     
==========================================
  Files         116      116              
  Lines        6672     6672              
==========================================
+ Hits         5521     5522       +1     
+ Misses       1151     1150       -1     
Impacted Files Coverage Δ
src/univariate/discrete/betabinomial.jl 88.46% <ø> (+1.92%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a6b9960...61fed19. Read the comment docs.

@mschauer
Copy link
Member

mschauer commented Jul 3, 2021

What about cdf(d::BetaBinomial, k::Real)?

@devmotion
Copy link
Member Author

There's no need to implement it, the default fallback in

cdf(d::DiscreteUnivariateDistribution, x::Real) = cdf_int(d, x)
is sufficient. In general, for discrete distributions whose support is of type Int one just has to define cdf(d, ::Int) (otherwise one has to implement cdf(d, ::Real)). One does not have to define ccdf, logcdf, logccdf (they are computed from cdf) but it is numerically more stable to compute them by direct summation (with logsumexp for the log variants).

@mschauer mschauer merged commit 34df63d into master Jul 3, 2021
@devmotion devmotion deleted the dw/fixbetabinomial branch July 3, 2021 13:27
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

Successfully merging this pull request may close these issues.

Warning on cdf in src/univariate/discrete/betabinomial.jl in v0.25.7
3 participants