Repository navigation
Conversation
…logistic/pdf` `x <= 0` returned `0`, but the density `(beta/alpha) (x/alpha)^(beta-1) / (1+(x/alpha)^beta)^2` tends to `+Infinity`, `1/alpha`, or `0` at `x = 0` for `beta` less than, equal to, or greater than one. The documented example `pdf( 0.0, 1.0, 1.0 )` is the standard log-logistic, whose density `1/(1+x)^2` is `1` at `0`.
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
Member
|
@Planeshifter Mind taking a look at this one? |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This pull request:
stats/base/dists/log-logistic/pdf(JS,factory, and C) return the limiting density atx = 0rather than0.The density is
(beta/alpha) (x/alpha)^(beta-1) / (1 + (x/alpha)^beta)^2. Atx = 0its limit is+Infinityforbeta < 1,1/alphaforbeta = 1, and0forbeta > 1. SciPy'sfisk.pdf( 0, c )returns those values (inf,1,0forc = 0.5, 1, 2with unit scale).Changes:
lib/main.js,lib/factory.js,src/main.c:x < 0still returns0, andx = 0now returns+Infinity,1/alphaor0.manifest.jsongains@stdlib/constants/float64/pinf.pdf( 0.0, 1.0, 1.0 )now says1.0, inlib/main.js,lib/native.js,docs/types/index.d.tsanddocs/repl.txt.x <= 0returns0" tests assertedpdf( 0.0, 1.0, 1.0 ) === 0. That point is removed and they now sayx < 0. There is a newx = 0test withbetabelow, at and above one intest.pdf.js,test.factory.jsandtest.native.js.Related Issues
This pull request has the following related issues:
+Infinityatx = 0fork < 1instats/base/dists/weibull/pdfandlogpdf#15605x = 0andx = 1instats/base/dists/kumaraswamy/pdfandlogpdf#15606x = 0instats/base/dists/betaprime/logpdfandpdf#15607Questions
No.
Other
No.
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was written primarily by Claude Code. The bug was found by comparing every
stats/base/distsfunction against SciPy on random parameters.@stdlib-js/reviewers