feat: add @stdlib/stats/incr/nanmpcorrdist
#9319
Open
+1,398
−0
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.
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes. report:
Resolves #5602.
Description
This pull request:
@stdlib/stats/incr/nanmpcorrdist, an accumulator function for incrementally computing a moving sample Pearson product-moment correlation distance while ignoringNaNvalues@stdlib/stats/incr/mpcorrdistand adds robust NaN handling by checking input values before updating the accumulatorRelated Issues
This pull request has the following related issues:
stats/incr/nanmpcorrdist#5602 ([RFC]: add stats/incr/nanmpcorrdist)Questions
No.
Other
Implementation Details
The accumulator checks if either input value (
xory) isNaNusing@stdlib/math/base/assert/is-nan:NaNis detected, returns the current correlation distance without updatingmpcorrdistaccumulatorValidation Results
Tests: All 2069 tests pass, including:
Examples: Execute successfully, demonstrating ~20% NaN injection rate with proper handling
Benchmarks: All benchmarks pass:
Linting: All static analysis checks pass (see pre-commit report above)
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was authored with GitHub Copilot assistance. The implementation was created by analyzing existing stdlib packages (
@stdlib/stats/incr/mpcorrdist,@stdlib/stats/incr/nansum,@stdlib/stats/incr/sum) to understand patterns and conventions, then generating all required files (implementation, tests, examples, benchmarks, documentation, TypeScript definitions) following stdlib's established structure. All code has been validated with comprehensive tests (2069 passing), examples, and benchmarks, and follows stdlib linting rules and conventions.@stdlib-js/reviewers