Skip to content

docs: fix parameter descriptions in stats/base/dists/lognormal#11829

Merged
kgryte merged 1 commit intodevelopfrom
philipp/drift-stats-base-dists-lognormal-2026-04-28
Apr 29, 2026
Merged

docs: fix parameter descriptions in stats/base/dists/lognormal#11829
kgryte merged 1 commit intodevelopfrom
philipp/drift-stats-base-dists-lognormal-2026-04-28

Conversation

@Planeshifter
Copy link
Copy Markdown
Member

@Planeshifter Planeshifter commented Apr 28, 2026

Description

What is the purpose of this pull request?

This pull request aligns stats/base/dists/lognormal/logcdf with the 13/14 (93%) namespace majority: mu and sigma parameter labels corrected from "mean"/"standard deviation" to "location parameter"/"scale parameter" across JSDoc, TS declarations, repl.txt, and README.md, and the sigma < 0 example comment updated to "Negative scale parameter" to match sibling phrasing. The factory.js JSDoc summary was also given the matching distribution-description prose, which was previously absent. TYPE annotations (NonNegativeNumber for sigma) are intentionally unchanged — both main.js and factory.js legitimately accept sigma === 0 by delegating to the degenerate distribution.

Related Issues

Does this pull request have any related issues?

No.

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

Validation

  • Structural feature extraction: file system + package.json / manifest.json / README header parsing across all 14 members.
  • Semantic feature extraction: per-package agents reading lib/main.js, lib/index.js, and lib/factory.js (where present) to capture public signature, validation prologue, error construction, JSDoc shape, and @stdlib/* dependencies.
  • Three-agent drift validation:
    • Semantic-review confirmed all six terminology drift items in logcdf and clarified that factory.js's NonNegativeNumber for sigma is intentional (factory delegates to the degenerate distribution at sigma === 0).
    • Cross-reference review found that test/test.logcdf.js (lines 108–127) and test/test.factory.js (lines 131–153) both assert that logcdf(..., sigma=0) returns the degenerate result, so changing the JSDoc type from NonNegativeNumber to PositiveNumber would contradict observed behavior — that change was dropped.
    • Structural review confirmed C-binding files sit at 10/14 (below the 75% threshold) and so are not drift; missing Julia fixtures in logcdf (12/14 majority) were dropped because adding them mechanically requires regenerating ground-truth JSON and rewiring test.logcdf.js / test.factory.js to consume them, which exceeds the "mechanical, single-package" scope of this routine; missing Julia fixtures in ctor are intentional (constructor has no fixture-based numerical tests).
  • Deliberately excluded: intentional deviations (factory.js sigma type and ctor test layout), outliers whose tests rely on the deviation (logcdf sigma === 0 tests), and features without a clear majority (C bindings, returnsTag type, error construction, validation prologue sequences).

Checklist

Please ensure the following tasks are completed before submitting this pull request.

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of 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

If you answered "yes" to using AI assistance, please provide a short disclosure indicating how you used AI assistance. This helps reviewers determine how much scrutiny to apply when reviewing your contribution. Example disclosures: "This PR was written primarily by Claude Code." or "I consulted ChatGPT to understand the codebase, but the proposed changes were fully authored manually by myself.".

This PR was produced by Claude Code via an automated cross-package API drift detection routine: a randomly selected stdlib namespace (stats/base/dists/lognormal, seed 20260428) had structural and semantic features extracted from each member, the majority pattern computed per feature (75% conformance threshold), and outliers validated by three independent agents (semantic, cross-reference, and structural) before being committed. Only documentation (JSDoc / README / repl.txt / TS-decl) wording is changed; behavior, signatures, and types are unchanged.


@stdlib-js/reviewers


Generated by Claude Code

…tions

Aligns logcdf parameter terminology with the 13 sibling packages
(cdf, pdf, logpdf, quantile, mean, median, mode, entropy, kurtosis,
skewness, stdev, variance, ctor) which uniformly describe `mu` as
the location parameter and `sigma` as the scale parameter of the
underlying normal distribution.

Drift items corrected (logcdf was the lone outlier):

- JSDoc / TS-decl / repl.txt / README descriptions: `mu - mean` ->
  `mu - location parameter` (13/14 = 93% of siblings).
- JSDoc / TS-decl / repl.txt / README descriptions: `sigma -
  standard deviation` -> `sigma - scale parameter` (13/14 = 93%
  of siblings).
- Function-description prose: "with mean \`mu\` and standard
  deviation \`sigma\`" -> "with location parameter \`mu\` and scale
  parameter \`sigma\`" (13/14 = 93% of siblings); also added the
  matching prose to the factory.js JSDoc summary, which previously
  lacked any parameter description.
- Example-comment label: "Negative standard deviation" ->
  "Negative scale parameter" (matches sibling phrasing for the
  sigma < 0 example).

The mu/sigma terms are the location/scale of the underlying normal,
not the mean/stddev of the lognormal, so the prior wording was
mathematically misleading. JSDoc TYPE annotations and behavior are
intentionally unchanged: factory.js legitimately accepts sigma === 0
(delegates to the degenerate distribution), and main.js is exercised
by test.logcdf.js with sigma === 0, so NonNegativeNumber is preserved
for both.
@stdlib-bot stdlib-bot added the Statistics Issue or pull request related to statistical functionality. label Apr 28, 2026
@stdlib-bot
Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
stats/base/dists/lognormal/logcdf $\color{green}212/212$
$\color{green}+100.00%$
$\color{green}16/16$
$\color{green}+100.00%$
$\color{green}3/3$
$\color{green}+100.00%$
$\color{green}212/212$
$\color{green}+100.00%$

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

@Planeshifter Planeshifter changed the title docs: align outliers in stats/base/dists/lognormal with namespace majority patterns docs: fix parameter descriptions in stats/base/dists/lognormal Apr 29, 2026
@Planeshifter Planeshifter marked this pull request as ready for review April 29, 2026 00:04
@Planeshifter Planeshifter requested review from a team and kgryte April 29, 2026 00:04
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Apr 29, 2026
@kgryte kgryte added Documentation Improvements, additions, or changes to documentation. and removed Needs Review A pull request which needs code review. labels Apr 29, 2026
@kgryte kgryte merged commit 9fedcf9 into develop Apr 29, 2026
81 checks passed
@kgryte kgryte deleted the philipp/drift-stats-base-dists-lognormal-2026-04-28 branch April 29, 2026 01:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation Improvements, additions, or changes to documentation. Statistics Issue or pull request related to statistical functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants