docs: add NaN notes to stats/incr/covmat and stats/incr/pcorrmat#12693
Draft
Planeshifter wants to merge 2 commits into
Draft
docs: add NaN notes to stats/incr/covmat and stats/incr/pcorrmat#12693Planeshifter wants to merge 2 commits into
stats/incr/covmat and stats/incr/pcorrmat#12693Planeshifter wants to merge 2 commits into
Conversation
Populates the empty `<section class="notes">` block with the standard NaN-propagation warning used by 105/108 packages (97%) in `stats/incr`. The accumulator performs Welford-style updates on persistent state, so a single NaN input permanently corrupts all subsequent matrix outputs; this matches the scalar sibling `stats/incr/covariance`, which already documents the same caveat.
Populates the empty `<section class="notes">` block with the standard NaN-propagation warning used by 105/108 packages (97%) in `stats/incr`. The accumulator performs Welford-style updates on persistent state plus a square-root standardization, so a single NaN input permanently corrupts the persistent means, co-moments, and standard deviations and poisons every subsequent correlation matrix; matches the scalar sibling `stats/incr/pcorr`, which already documents the same caveat.
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
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
Populates the empty
<section class="notes">scaffold in two@stdlib/stats/incrpackage READMEs with the standard NaN-propagation warning used by 105 of the 108 packages in the namespace (97% conformance). No code, type, or test changes; documentation only.Namespace summary
@stdlib/stats/incr— 108 non-autogenerated members.package.jsonshape, README section list, REPL section list, test/benchmark/example filenames, JSDoc shape (@param/@returns/@throws/@example), validation prologue, error construction, dependencies,keywords.package.jsontop-level keys at 100%, 8keywordsat 100%,{## Usage, ## Notes, ## Examples, ## See Also}README sections at ≥83%, JSDoc@exampleat 100%,@returns {Function}at 100%,format-based error construction at 100% (of the 60 packages that throw).package.json#scriptskeys (shape-driven),bench(...)call count (shape-driven),validate.js(only 2 packages —grubbs,mgrubbs).stats/incr/covmatEmpty
<section class="notes">populated with the standard NaN-propagation warning.incrcovmatupdates a persistent mean vector and co-moment matrix via Welford recursion; a single NaN input contaminatesmuandCand poisons every subsequent covariance-matrix output. 105/108 packages (97%) in the namespace already document this caveat verbatim, including the scalar siblingstats/incr/covariance.stats/incr/pcorrmatSame fix.
incrpcorrmatcarries persistent means, co-moments, and per-variable standard deviations, and divides bysd[i]*sd[j]to produce the correlation matrix; a NaN input permanently corrupts means, co-moments, and standard deviations and thereby every later correlation. Mirrors the wording used by the scalar siblingstats/incr/pcorr. Sibling matrix variantstats/incr/pcorrdistmatalready carries a Notes section (with a package-specific floating-point note), confirming the matrix subgroup does not follow a "no Notes" convention.Related Issues
None.
Questions
No.
Other
Validation
Both candidates were filtered through three independent review agents before applying:
lib/main.jsfiles and verified that NaN propagation is the same behavior the standard warning describes — applies verbatim, no need for a package-specific rephrasing.test/directory parses the README, and no sibling package or generator depends on the<section class="notes">content of either file.<section class="notes">blocks are scaffold placeholders rather than a deliberate "no Notes" convention in the matrix subgroup, citingstats/incr/pcorrdistmatas a counterexample.Deliberately excluded from this PR:
stats/incr/count— also missing## Notes.incrcountincrements unconditionally, so NaN does not propagate; the boilerplate would be inaccurate.intentional-deviation.nan*packages missing## See Also— generator-owned auto-populated section; gating rule disallows touching it.nan*packages without a validation prologue (nanmcv,nanmmape,nanmmse,nanmstdev,nanmsum,nanstdev,nanvariance) — each delegates to a non-nan sibling that performs the validation.intentional-deviation.grubbsvsmgrubbsvalidate.jswording drift — only 2 data points, no majority to anchor a fix.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
Drafted by Claude Code as part of a cross-package drift detection routine: structural and semantic features were extracted from all 108 packages in
@stdlib/stats/incr, the majority pattern was identified per feature, and outliers were flagged. Three independent agent reviews (two opus, one sonnet) confirmed both Notes-section additions as unintentional drift before the patches were applied verbatim from the namespace boilerplate. A maintainer should promote out of draft.@stdlib-js/reviewers
Generated by Claude Code