Skip to content

fix(exponential-distribution): correct sign in log-space pdf branch - #181

Merged
JimmyMAndersson merged 1 commit into
mainfrom
fix/exponential-log-pmf
May 23, 2026
Merged

fix(exponential-distribution): correct sign in log-space pdf branch#181
JimmyMAndersson merged 1 commit into
mainfrom
fix/exponential-log-pmf

Conversation

@JimmyMAndersson

Copy link
Copy Markdown
Owner

The logarithmic branch used + rate * x instead of - rate * x, causing log pdf to grow with x rather than decay. The correct identity is log pdf(x) = log(λ) − λx.

Expanded the test suite to cover pdf (previously untested), log pdf (which directly exercises the fixed branch), boundary values at ±infinity, and precondition failure tests, aligning the suite with LogisticDistributionTests.

Fixes: #175

The logarithmic branch used `+ rate * x` instead of `- rate * x`,
causing log pdf to grow with x rather than decay. The correct
identity is log pdf(x) = log(λ) − λx.

Expanded the test suite to cover pdf (previously untested),
log pdf (which directly exercises the fixed branch), boundary
values at ±infinity, and precondition failure tests, aligning
the suite with LogisticDistributionTests.

Fixes: #175
@JimmyMAndersson JimmyMAndersson self-assigned this May 23, 2026
@JimmyMAndersson JimmyMAndersson added the bug Something isn't working label May 23, 2026
@JimmyMAndersson
JimmyMAndersson merged commit 7cb0eea into main May 23, 2026
5 checks passed
@JimmyMAndersson
JimmyMAndersson deleted the fix/exponential-log-pmf branch May 23, 2026 14:52
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.

ExponentialDistribution.pdf returns incorrect values when logarithmic: true

1 participant