Skip to content

docs: fix REPL inaccuracies in stats/base/dists/rayleigh#12682

Draft
Planeshifter wants to merge 2 commits into
developfrom
claude/practical-goodall-v96rn
Draft

docs: fix REPL inaccuracies in stats/base/dists/rayleigh#12682
Planeshifter wants to merge 2 commits into
developfrom
claude/practical-goodall-v96rn

Conversation

@Planeshifter
Copy link
Copy Markdown
Member

Description

This pull request corrects two REPL documentation inaccuracies in @stdlib/stats/base/dists/rayleigh that were surfaced by a cross-package drift scan of the namespace's 15 members. Both fixes are documentation-only and do not change runtime behavior.

stats/base/dists/rayleigh/mean

The REPL documentation for @stdlib/stats/base/dists/rayleigh/mean incorrectly stated that the function returns NaN for σ <= 0, contradicting both the implementation, which only rejects sigma < 0, and the package README and TypeScript declarations, which correctly specify σ < 0. A scale parameter of zero is degenerate but accepted by convention across the Rayleigh namespace — every other zero-arity package (entropy, kurtosis, median, mode, skewness, stdev, variance) documents σ < 0, and mean(0) returns 0. This commit aligns the REPL text with the actual behavior and the rest of the namespace (7/8 = 87% conformance).

stats/base/dists/rayleigh/quantile

The repl.txt documentation for quantile incorrectly described a negative value for the scale parameter sigma as a "negative probability" — copy-paste residue from the adjacent guard on the probability argument p. The parameter sigma is a scale parameter, not a probability, so the original phrasing was nonsensical. This aligns the wording with the five other factory packages in the namespace (cdf, logcdf, logpdf, mgf, pdf), all of which use "negative value for sigma" (5/6 = 83% conformance).

Related Issues

No.

Questions

No.

Other

No.

Checklist

AI Assistance

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

This PR was authored by Claude Code as part of a cross-package drift-detection routine over the stats/base/dists/rayleigh namespace. The two corrections that survived the drift filter were structural documentation fixes verified against each package's own implementation, README, and TypeScript declarations, as well as the conventions used by sibling packages. A human maintainer should verify the fixes before promoting this PR out of draft.


@stdlib-js/reviewers


Generated by Claude Code

claude added 2 commits June 7, 2026 20:21
Corrects the REPL documentation, which stated that `mean` returns
`NaN` for `σ <= 0`. The implementation rejects only `σ < 0`
(`mean(0)` returns `0`), matching the package README and TypeScript
declaration. The other 7 zero-arity packages in the namespace already
use `σ < 0` (7/8 = 87% conformance).
Corrects "negative probability for `sigma`" to "negative value for
`sigma`". `sigma` is the scale parameter, not a probability; the
wording is a copy-paste residue from the preceding line documenting
the `p < 0 or p > 1` condition. The other 5 factory packages in the
namespace use "negative value for `sigma`" (5/6 = 83% conformance).
@stdlib-bot stdlib-bot added the Statistics Issue or pull request related to statistical functionality. label Jun 7, 2026
@stdlib-bot
Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
stats/base/dists/rayleigh/mean $\color{green}162/162$
$\color{green}+100.00\%$
$\color{green}8/8$
$\color{green}+100.00\%$
$\color{green}2/2$
$\color{green}+100.00\%$
$\color{green}162/162$
$\color{green}+100.00\%$
stats/base/dists/rayleigh/quantile $\color{green}290/290$
$\color{green}+100.00\%$
$\color{green}26/26$
$\color{green}+100.00\%$
$\color{green}4/4$
$\color{green}+100.00\%$
$\color{green}290/290$
$\color{green}+100.00\%$

The above coverage report was generated for the changes in this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Statistics Issue or pull request related to statistical functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants