Skip to content

fix(beta-distribution): handle boundary points in pdf correctly#169

Merged
JimmyMAndersson merged 1 commit into
mainfrom
fix/165-beta-distribution-bug
May 12, 2026
Merged

fix(beta-distribution): handle boundary points in pdf correctly#169
JimmyMAndersson merged 1 commit into
mainfrom
fix/165-beta-distribution-bug

Conversation

@JimmyMAndersson

Copy link
Copy Markdown
Owner

The pdf method returned 0 for x=0 and x=1 unconditionally. When alpha < 1 the density diverges to +∞ at x=0, and similarly for beta < 1 at x=1. When alpha=1 or beta=1 the boundary value is finite (1/B(α,β)). The interior formula cannot handle these points because (α-1)·log(0) is 0·(−∞) = NaN in IEEE 754.

Fixes #165

The pdf method returned 0 for x=0 and x=1 unconditionally. When
alpha < 1 the density diverges to +∞ at x=0, and similarly for
beta < 1 at x=1. When alpha=1 or beta=1 the boundary value is
finite (1/B(α,β)). The interior formula cannot handle these
points because (α-1)·log(0) is 0·(−∞) = NaN in IEEE 754.

Fixes #165
@JimmyMAndersson JimmyMAndersson self-assigned this May 12, 2026
@JimmyMAndersson JimmyMAndersson added the bug Something isn't working label May 12, 2026
@JimmyMAndersson JimmyMAndersson merged commit af41c81 into main May 12, 2026
5 checks passed
@JimmyMAndersson JimmyMAndersson deleted the fix/165-beta-distribution-bug branch May 12, 2026 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Beta distribution does not behave properly at boundary points

1 participant