feat: add stats/incr/nanrmse#12357
Open
wilmerdooley wants to merge 1 commit into
Open
Conversation
Signed-off-by: wilmerdooley <wilmerdooley1@gmail.com>
4f480c1 to
3745c28
Compare
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 adds a new package to the
stats/incr/*namespace:@stdlib/stats/incr/nanrmse, resolving #5621.The package incrementally computes the root mean squared error (RMSE), ignoring
NaNvalues. Following the pattern of@stdlib/stats/incr/nansum(and the existing@stdlib/stats/incr/nanmse), the accumulator is a thin wrapper around@stdlib/stats/incr/rmse: when either input value isNaN(or no arguments are provided), the value is skipped and the current RMSE is returned; otherwise the value is forwarded to the underlyingincrrmseaccumulator.Included (package directory only, consistent with the existing
nanmse/nanmmse/nanvarianceadditions):lib/main.js,lib/index.jstest/test.jsbenchmark/benchmark.jsexamples/index.jsdocs/repl.txt,docs/types/index.d.ts,docs/types/test.ts,docs/img/equation_root_mean_squared_error.svg,README.mdRelated Issues
Resolves #5621.
Questions
I implemented this as a package-only addition, matching the existing
@stdlib/stats/incr/nanmse,@stdlib/stats/incr/nanmmse, and@stdlib/stats/incr/nanvariancepackages, which do not modify the namespace. Should the new package also be registered in the@stdlib/stats/incrnamespace index and the@stdlib/namespacealias tables, or is that registration handled separately by the maintainers? Happy to add it in this PR if that is preferred.Other
Verified locally against the project's own tooling:
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was authored with assistance from Claude Code. The implementation, tests, documentation, and benchmarks were generated with AI assistance and then reviewed for correctness against the expected RMSE behavior and adapted to follow the conventions of the existing
@stdlib/stats/incr/rmseand@stdlib/stats/incr/nanmsepackages.