[RFC]: add stats/incr/nanmvariance
#5614
Labels
Accepted
RFC feature request which has been accepted.
difficulty: 2
May require some initial design or R&D, but should be straightforward to resolve and/or implement.
Feature
Issue or pull request for adding a new feature.
Good First Issue
A good first issue for new contributors!
JavaScript
Issue involves or relates to JavaScript.
priority: Normal
Normal priority concern or feature request.
RFC
Request for comments. Feature requests and proposed changes.
Statistics
Issue or pull request related to statistical functionality.
Description
This RFC proposes adding a new package to the
stats/incr/*
namespace:@stdlib/stats/incr/nanmvariance
.This package is similar to
@stdlib/stats/incr/mvariance
, except that it performs special handling ofNaN
values.Key Points
When implementing this package, you'll need to do the following:
Create package files
To see examples of similar packages, see
@stdlib/stats/incr/mvariance
(propagatesNaN
values) and@stdlib/stats/incr/nansum
(wraps aNaN
propagating accumulator and skipsNaN
values).In particular notice how
nansum
is a thin wrapper aroundsum
. In most cases, this is what we are looking for.While the package proposed in this RFC will not match the implementations found in the above packages, those packages should provide a conceptual idea of what is desired. Do not simply copy-paste the code found in those packages without reasoning about expected behavior and API design.
Update source files
Once you've created package files, proceed to update all tests, documentation, and examples to reflect the API and expected behavior for the package. You should spend some time studying the tests in
@stdlib/stats/incr/mvariance
. We expect this package to have equivalent and fully comprehensive tests. The primary difference will be in the handling ofNaN
values.To see an example of what is expected, study the tests in
@stdlib/stats/incr/sum
and@stdlib/stats/incr/nansum
Compare and contrast the tests in that pair of packages.
Run tests and other commands
For each of the following commands, please run them from the root stdlib repository directory (not the package folder!).
To run unit tests,
To run examples,
make examples EXAMPLES_FILTER=".*/stats/incr/nanmvariance/.*"
To run benchmarks,
make benchmark BENCHMARKS_FILTER=".*/stats/incr/nanmvariance/.*"
Create pull request
Provided all tests, examples, and benchmarks successfully execute and pass and that you've updated the package's documentation, you are now ready to open a pull request!
Notes
Checklist
[RFC]:
.The text was updated successfully, but these errors were encountered: