feat: add stats/incr/nanmmaape package#9338
Open
ROKUMATE wants to merge 3 commits intostdlib-js:developfrom
Open
feat: add stats/incr/nanmmaape package#9338ROKUMATE wants to merge 3 commits intostdlib-js:developfrom
stats/incr/nanmmaape package#9338ROKUMATE wants to merge 3 commits intostdlib-js:developfrom
Conversation
Implement moving mean arctangent absolute percentage error
with NaN handling. Add thin wrapper around mmaape that
ignores NaN values in either argument. Include comprehensive
test suite (52 tests, all passing), TypeScript definitions
and type tests, benchmarks for performance testing, examples
demonstrating NaN handling, and complete documentation in
README.
Closes RFC for nanmmaape implementation.
---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
- task: lint_filenames
status: passed
- task: lint_editorconfig
status: passed
- task: lint_markdown
status: passed
- task: lint_package_json
status: passed
- task: lint_repl_help
status: na
- task: lint_javascript_src
status: passed
- task: lint_javascript_cli
status: na
- task: lint_javascript_examples
status: passed
- task: lint_javascript_tests
status: passed
- task: lint_javascript_benchmarks
status: passed
- task: lint_python
status: na
- task: lint_r
status: na
- task: lint_c_src
status: na
- task: lint_c_examples
status: na
- task: lint_c_benchmarks
status: na
- task: lint_c_tests_fixtures
status: na
- task: lint_shell
status: na
- task: lint_typescript_declarations
status: passed
- task: lint_typescript_tests
status: passed
- task: lint_license_headers
status: passed
---
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
Member
|
/stdlib merge |
Member
|
/stdlib update-copyright-years |
Planeshifter
requested changes
Jan 14, 2026
Member
Planeshifter
left a comment
There was a problem hiding this comment.
Looking pretty good overall.
| { | ||
| "name": "@stdlib/stats/incr/nanmmaape", | ||
| "version": "0.0.0", | ||
| "description": "Compute a moving arctangent mean absolute percentage error (MAAPE) incrementally, ignoring NaN values.", |
Member
There was a problem hiding this comment.
The description has the words in the wrong order - should be "mean arctangent absolute percentage error" (MAAPE stands for Mean Arctangent Absolute Percentage Error), not "arctangent mean absolute percentage error".
Suggested change
| "description": "Compute a moving arctangent mean absolute percentage error (MAAPE) incrementally, ignoring NaN values.", | |
| "description": "Compute a moving mean arctangent absolute percentage error (MAAPE) incrementally, ignoring NaN values.", |
Member
There was a problem hiding this comment.
The package is missing a docs/repl.txt file. All stdlib packages need this file for REPL documentation. You can reference @stdlib/stats/incr/mmaape/docs/repl.txt as a template and update it to mention the NaN-ignoring behavior.
@stdlib/stats/incr/nanmmaape packagestats/incr/nanmmaape package
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.
Add
@stdlib/stats/incr/nanmmaape- Moving MAAPE with NaN handlingImplement moving mean arctangent absolute percentage error with NaN handling. Add thin wrapper around
mmaapethat ignores NaN values in either the forecast or actual argument. Include comprehensive test suite (52 tests, all passing), TypeScript definitions and type tests, benchmarks for performance testing, examples demonstrating NaN handling, and complete documentation in README.Closes RFC for
nanmmaapeimplementation.type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
Resolves #5562
Description
This pull request:
@stdlib/stats/incr/nanmmaapeto compute a moving mean arctangent absolute percentage error (MAAPE) incrementally, ignoring NaN values@stdlib/stats/incr/mmaapethat skips NaN values in either the forecast (f) or actual (a) parametersRelated Issues
This pull request has the following related issues:
Questions
No.
Other
Implementation Notes:
@stdlib/stats/incr/nansumwrapping@stdlib/stats/incr/summmaapeaccumulator is not called, so the window state remains unchangedTest Results:
✅ Total: 52 tests
✅ Passing: 52
✅ Failing: 0
✅ Duration: 43-55ms
Benchmark Results:
✅ Constructor: ~21M ops/sec
✅ Accumulator: ~10M ops/sec
✅ Accumulator with NaN: ~7.5M ops/sec
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was authored with significant AI assistance (GitHub Copilot). The AI helped with:
mmaape,nansum,sum) to understand implementation patternsnansumpatternmmaapetests with NaN-specific scenariosAll code follows stdlib conventions and passes all static analysis checks. The implementation was iteratively tested and refined to ensure correct behavior and comprehensive test coverage.
@stdlib-js/reviewers