From e965bf2352391b2c110d7a0bd18353f94f776d6a Mon Sep 17 00:00:00 2001 From: Jayhari Aditiya Date: Wed, 12 Mar 2025 02:36:10 +0530 Subject: [PATCH 01/10] feat(stats/incr): add nancovariance accumulator --- 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: na - task: lint_package_json status: passed - task: lint_repl_help status: passed - 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: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../stats/incr/nancovariance/README.md | 121 +++++++++++++++++ .../incr/nancovariance/benchmark/benchmark.js | 72 ++++++++++ .../stats/incr/nancovariance/docs/repl.txt | 28 ++++ .../incr/nancovariance/docs/types/index.d.ts | 68 ++++++++++ .../incr/nancovariance/docs/types/test.ts | 50 +++++++ .../incr/nancovariance/examples/index.js | 35 +++++ .../stats/incr/nancovariance/lib/index.js | 54 ++++++++ .../stats/incr/nancovariance/lib/main.js | 85 ++++++++++++ .../stats/incr/nancovariance/package.json | 60 +++++++++ .../stats/incr/nancovariance/test/test.js | 127 ++++++++++++++++++ 10 files changed, 700 insertions(+) create mode 100644 lib/node_modules/@stdlib/stats/incr/nancovariance/README.md create mode 100644 lib/node_modules/@stdlib/stats/incr/nancovariance/benchmark/benchmark.js create mode 100644 lib/node_modules/@stdlib/stats/incr/nancovariance/docs/repl.txt create mode 100644 lib/node_modules/@stdlib/stats/incr/nancovariance/docs/types/index.d.ts create mode 100644 lib/node_modules/@stdlib/stats/incr/nancovariance/docs/types/test.ts create mode 100644 lib/node_modules/@stdlib/stats/incr/nancovariance/examples/index.js create mode 100644 lib/node_modules/@stdlib/stats/incr/nancovariance/lib/index.js create mode 100644 lib/node_modules/@stdlib/stats/incr/nancovariance/lib/main.js create mode 100644 lib/node_modules/@stdlib/stats/incr/nancovariance/package.json create mode 100644 lib/node_modules/@stdlib/stats/incr/nancovariance/test/test.js diff --git a/lib/node_modules/@stdlib/stats/incr/nancovariance/README.md b/lib/node_modules/@stdlib/stats/incr/nancovariance/README.md new file mode 100644 index 000000000000..b50811877bdf --- /dev/null +++ b/lib/node_modules/@stdlib/stats/incr/nancovariance/README.md @@ -0,0 +1,121 @@ + + +# incrnancovariance + +> Compute an incremental sample covariance while ignoring `NaN` values. + +
+ +## Usage + +```javascript +var nancovariance = require( '@stdlib/stats/incr/nancovariance' ); +``` + +#### incrnancovariance + +Returns an accumulator function which incrementally computes a sample covariance, ignoring any input pairs that contain NaN values. The accumulator returns null until at least two valid data pairs have been provided. + +```javascript +var accumulator = nancovariance(); +``` + +#### accumulator(`[x, y]`) + +If provided a pair of numeric input values `[x, y]`, the accumulator updates and returns the sample covariance. If not provided any input values, the accumulator returns the current sample covariance. + +```javascript +var accumulator = nancovariance(); + +var cov = accumulator(); +// returns null + +cov = accumulator( 2.0, 1.0 ); +// returns null + +cov = accumulator( NaN, 1.0 ); +// returns null + +cov = accumulator( 4.0, 5.0 ); +// returns 4.0 + +cov = accumulator(); +// returns 4.0 +``` + +
+ + + +
+ +## Examples + + + +```javascript +var randu = require( '@stdlib/random/base/randu' ); +var nancovariance = require( '@stdlib/stats/incr/nancovariance' ); + +var accumulator; +var i; +var x; +var y; +accumulator = nancovariance(); +for ( i = 0; i < 100; i++ ) { + x = ( randu() < 0.2 ) ? NaN : randu() * 100.0; + y = ( randu() < 0.2 ) ? NaN : randu() * 100.0; + accumulator( x, y ); +} +console.log( accumulator() ); +``` + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/stats/incr/nancovariance/benchmark/benchmark.js b/lib/node_modules/@stdlib/stats/incr/nancovariance/benchmark/benchmark.js new file mode 100644 index 000000000000..7f43432ae8a6 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/incr/nancovariance/benchmark/benchmark.js @@ -0,0 +1,72 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2020 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var randu = require( '@stdlib/random/base/randu' ); +var pkg = require( './../package.json' ).name; +var nancovariance = require( './../lib' ); + + +// MAIN // + +bench( pkg, function benchmark( b ) { + var acc; + var i; + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + acc = nancovariance(); + if ( typeof acc !== 'function' ) { + b.fail( 'should return a function' ); + } + } + b.toc(); + if ( typeof acc !== 'function' ) { + b.fail( 'should return a function' ); + } + b.pass( 'benchmark finished' ); + b.end(); +}); + +bench( pkg+'::accumulator', function benchmark( b ) { + var acc; + var x; + var y; + var v; + var i; + + acc = nancovariance(); + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + x = ( randu() < 0.1 ) ? NaN : randu()*10; // ~10% NaN + y = ( randu() < 0.1 ) ? NaN : randu()*10; // ~10% NaN + v = acc( x, y ); + if ( v !== v && i > 1 ) { + b.fail( 'accumulator should not return NaN once enough valid data' ); + } + } + b.toc(); + if ( v !== v ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); +}); diff --git a/lib/node_modules/@stdlib/stats/incr/nancovariance/docs/repl.txt b/lib/node_modules/@stdlib/stats/incr/nancovariance/docs/repl.txt new file mode 100644 index 000000000000..d696647ca7ae --- /dev/null +++ b/lib/node_modules/@stdlib/stats/incr/nancovariance/docs/repl.txt @@ -0,0 +1,28 @@ +{{alias}}() + Returns an accumulator function which incrementally updates a count, + ignoring `NaN` values. + + If provided a value, the accumulator function returns an updated count. If + not provided a value, the accumulator function returns the current count. + + Returns + ------- + acc: Function + Accumulator function. + + Examples + -------- + > var accumulator = {{alias}}(); + > var v = accumulator() + null + > v = accumulator( 2.0 ) + null + > v = accumulator( NaN ) + null + > v = accumulator( -5.0 ) + NaN + > v = accumulator() + NaN + + See Also + -------- diff --git a/lib/node_modules/@stdlib/stats/incr/nancovariance/docs/types/index.d.ts b/lib/node_modules/@stdlib/stats/incr/nancovariance/docs/types/index.d.ts new file mode 100644 index 000000000000..7a8e9967ae69 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/incr/nancovariance/docs/types/index.d.ts @@ -0,0 +1,68 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2020 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// TypeScript Version: 4.1 + +/// + +/** + * If provided a pair of values, updates and returns the sample covariance; + * otherwise, returns the current sample covariance. + * + * @param x - first numeric value + * @param y - second numeric value + * @returns sample covariance or null + */ +interface Accumulator { + ( x: number, y: number ): number | null; + (): number | null; +} + + +/** +* Returns an accumulator function which incrementally computes a count, ignoring `NaN` values. +* +* @returns accumulator function +* +* @example +* var nancovariance = require( '@stdlib/stats/incr/nancovariance' ); +* +* var acc = nancovariance(); +* +* var cov = acc(); +* // returns null +* +* cov = acc( 2.0, 1.0 ); +* // returns null +* +* cov = acc( NaN, 5.0 ); +* // returns null +* +* cov = acc( 4.0, 5.0 ); +* // returns 4.0 +* +* cov = acc(); +* // returns 4.0 +*/ + +declare function nancovariance( ...args: [] ): Accumulator; + + +// EXPORTS // + +export = nancovariance; diff --git a/lib/node_modules/@stdlib/stats/incr/nancovariance/docs/types/test.ts b/lib/node_modules/@stdlib/stats/incr/nancovariance/docs/types/test.ts new file mode 100644 index 000000000000..0bf914168755 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/incr/nancovariance/docs/types/test.ts @@ -0,0 +1,50 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2019 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +import nancovariance = require( '@stdlib/stats/incr/nancovariance' ); + +// TESTS // + +// The function returns an accumulator function... +{ + nancovariance(); // $ExpectType Accumulator +} + +// The compiler throws an error if the function is provided any arguments... +{ + nancovariance( 3 ); // $ExpectError + nancovariance( 3, 0.0 ); // $ExpectError +} + +// The function returns an accumulator function which returns an accumulated result... +{ + const acc = nancovariance(); + acc(); // $ExpectType number | null + acc( 2.0, 1.0 ); // $ExpectType number | null +} + +// The compiler throws an error if the returned accumulator function is provided invalid arguments... +{ + const acc = nancovariance(); + acc( '5', 2.0 ); // $ExpectError + acc( true, 2.0 ); // $ExpectError + acc( 2.0 ); // $ExpectError + acc( null, 2.0 ); // $ExpectError + acc( [], {} ); // $ExpectError + acc( ( x: number ): number => x ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/stats/incr/nancovariance/examples/index.js b/lib/node_modules/@stdlib/stats/incr/nancovariance/examples/index.js new file mode 100644 index 000000000000..3307796fcc3d --- /dev/null +++ b/lib/node_modules/@stdlib/stats/incr/nancovariance/examples/index.js @@ -0,0 +1,35 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2020 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +var nancovariance = require( './../lib' ); + +var acc = nancovariance(); + +var dataX = [ 2.0, 2.0, NaN, 3.0, 5.0 ]; +var dataY = [ 1.0, 5.0, 4.0, NaN, 5.0 ]; + +var i; +var cov; +for ( i = 0; i < dataX.length; i++ ) { + cov = acc( dataX[ i ], dataY[ i ] ); + console.log( 'x=%s, y=%s, cov=%s', dataX[ i ], dataY[ i ], ( cov === null ) ? 'null' : cov.toString() ); +} + +console.log( '\nFinal sample covariance:', acc() ); diff --git a/lib/node_modules/@stdlib/stats/incr/nancovariance/lib/index.js b/lib/node_modules/@stdlib/stats/incr/nancovariance/lib/index.js new file mode 100644 index 000000000000..da2a461fcc5e --- /dev/null +++ b/lib/node_modules/@stdlib/stats/incr/nancovariance/lib/index.js @@ -0,0 +1,54 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2020 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +/** +* Compute an incremental sample covariance while ignoring NaN values. +* +* @module @stdlib/stats/incr/nancovariance +* +* @example +* var nancovariance = require( '@stdlib/stats/incr/nancovariance' ); +* +* var acc = nancovariance(); +* +* var cov = acc(); +* // returns null +* +* cov = acc( 2.0, 1.0 ); +* // returns null (covariance is undefined for a single pair) +* +* cov = acc( NaN , 5.0 ); +* // returns null (An input with a NaN is ignored) +* +* cov = acc( 4.0, 5.0 ); +* // returns 4.0 +* +* cov = acc(); +* // returns 4.0 +*/ + +// MODULES // + +var main = require( './main.js' ); + + +// EXPORTS // + +module.exports = main; diff --git a/lib/node_modules/@stdlib/stats/incr/nancovariance/lib/main.js b/lib/node_modules/@stdlib/stats/incr/nancovariance/lib/main.js new file mode 100644 index 000000000000..4ea0de981100 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/incr/nancovariance/lib/main.js @@ -0,0 +1,85 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2020 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var covariance = require( '@stdlib/stats/incr/covariance' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); + + +// MAIN // + +/** +* Returns an accumulator function which incrementally computes a sample covariance. +* +* @returns {Function} accumulator function +* +* @example +* var nancovariance = require( '@stdlib/stats/incr/nancovariance' ); +* +* var acc = nancovariance(); +* +* var cov = acc(); +* // returns null +* +* cov = acc( 2.0, 1.0 ); +* // returns null +* +* cov = acc( NaN, 5.0 ); +* // returns null +* +* cov = acc( 4.0, 5.0 ); +* // returns 4.0 +* +* cov = acc(); +* // returns 4.0 +*/ +function nancovariance() { + var count = 0; + var acc = covariance(); + return accumulator; + + /** + * Updates and returns the sample covariance when provided two numeric arguments. + * If no arguments are provided, returns the current sample covariance. + * + * @private + * @param {number} [x] - new x value + * @param {number} [y] - new y value + * @returns {(number|null)} sample covariance or null + */ + function accumulator( x, y ) { + var val; + if ( arguments.length === 0 ) { + return ( count < 2 ) ? null : acc(); + } + if ( isnan( x ) || isnan( y ) ) { + return ( count < 2 ) ? null : acc(); + } + count += 1; + val = acc( x, y ); + return ( count < 2 ) ? null : val; + } +} + + +// EXPORTS // + +module.exports = nancovariance; diff --git a/lib/node_modules/@stdlib/stats/incr/nancovariance/package.json b/lib/node_modules/@stdlib/stats/incr/nancovariance/package.json new file mode 100644 index 000000000000..b80e2ab2744e --- /dev/null +++ b/lib/node_modules/@stdlib/stats/incr/nancovariance/package.json @@ -0,0 +1,60 @@ +{ + "name": "@stdlib/stats/incr/nancovariance", + "version": "0.0.0", + "description": "Compute an incremental sample covariance while ignoring NaN values.", + "license": "Apache-2.0", + "author": { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + }, + "contributors": [ + { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + } + ], + "main": "./lib", + "directories": { + "benchmark": "./benchmark", + "doc": "./docs", + "example": "./examples", + "lib": "./lib", + "test": "./test" + }, + "types": "./docs/types", + "scripts": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "statistics", + "covariance", + "incremental", + "accumulator", + "nan", + "sample covariance" + ] +} diff --git a/lib/node_modules/@stdlib/stats/incr/nancovariance/test/test.js b/lib/node_modules/@stdlib/stats/incr/nancovariance/test/test.js new file mode 100644 index 000000000000..43e9fc9afae9 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/incr/nancovariance/test/test.js @@ -0,0 +1,127 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2018 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var abs = require( '@stdlib/math/base/special/abs' ); +var EPS = require( '@stdlib/constants/float64/eps' ); +var nancovariance = require( './../lib' ); + + +// MAIN // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof nancovariance, 'function', 'main export is a function' ); + t.end(); +}); + +// Additional tests... + +tape( 'the function returns an accumulator function', function test( t ) { + var acc = nancovariance(); + t.strictEqual( typeof acc, 'function', 'returns a function' ); + t.end(); +}); + +tape( 'the accumulator function returns null if no valid pairs have been provided', function test( t ) { + var acc = nancovariance(); + t.equal( acc(), null, 'returns null initially' ); + + // Provide an invalid pair: + acc( NaN, 5.0 ); + t.equal( acc(), null, 'still null after invalid pair' ); + t.end(); +}); + +tape( 'the accumulator function returns null if only one valid pair has been provided', function test( t ) { + var acc = nancovariance(); + + // Add the first valid pair: + acc( 2.0, 1.0 ); + t.equal( acc(), null, 'returns null for single valid pair' ); + t.end(); +}); + +tape( 'the accumulator function computes sample covariance once two valid pairs have been provided', function test( t ) { + var acc = nancovariance(); + var cov; + + // Pair #1: + cov = acc( 2.0, 1.0 ); + t.equal( cov, null, 'still null with only one valid pair' ); + + // Pair #2: + cov = acc( 4.0, 5.0 ); + t.equal( cov, 4.0, 'returns sample covariance after second valid pair' ); + + // Current covariance with no arguments: + t.equal( acc(), 4.0, 'returns current covariance' ); + t.end(); +}); + +tape( 'the accumulator function skips pairs containing NaN', function test( t ) { + var acc = nancovariance(); + var cov; + + // Provide first valid pair: + cov = acc( 2.0, 1.0 ); + t.equal( cov, null, 'null with only one valid pair' ); + + // Invalid pair => skip: + cov = acc( NaN, 10.0 ); + t.equal( cov, null, 'still null, as second pair is invalid' ); + + // Provide second valid pair: + cov = acc( 2.0, 5.0 ); + // For (2,1) and (2,5): same X => covariance=0 + t.equal( cov, 0.0, 'returns 0.0 for these pairs' ); + + // Provide third valid pair: + cov = acc( 5.0, 9.0 ); + t.equal( typeof cov, 'number', 'returns a number after third valid pair' ); + t.end(); +}); + +tape( 'the accumulator function computes correct covariance for multiple valid pairs interspersed with invalid pairs', function test( t ) { + var expected = 14.0/3.0; + var delta; + var data = [ + [ 2.0, 1.0 ], + [ NaN, 4.0 ], + [ 4.0, 5.0 ], + [ 3.0, 7.0 ], + [ NaN, NaN ], + [ 5.0, 11.0 ] + ]; + var acc = nancovariance(); + var cov; + var tol; + var i; + for ( i = 0; i < data.length; i++ ) { + cov = acc( data[i][0], data[i][1] ); + } + delta = abs( cov - expected ); + tol = EPS * abs( expected ); + t.equal( typeof cov, 'number', 'returns a number' ); + t.ok( delta < tol, 'within tolerance. Actual: '+cov+'. Expected: '+expected+'. delta: '+delta+'. tol: '+tol+'.' ); + t.end(); +}); From cb5b0d618c61d86199fafd729460e6c90dc026b4 Mon Sep 17 00:00:00 2001 From: Philipp Burckhardt Date: Wed, 15 Jul 2026 00:38:45 -0500 Subject: [PATCH 02/10] fix: address review feedback Correct the JSDoc and TypeScript descriptions to describe a sample covariance ignoring NaN values, and align the TypeScript declarations and tests with the `stats/incr/covariance` conventions (lowercase `accumulator` type, relative import, and per-argument error checks). --- .../incr/nancovariance/docs/types/index.d.ts | 32 ++++++++----------- .../incr/nancovariance/docs/types/test.ts | 20 +++++++++--- .../stats/incr/nancovariance/lib/main.js | 2 +- 3 files changed, 30 insertions(+), 24 deletions(-) diff --git a/lib/node_modules/@stdlib/stats/incr/nancovariance/docs/types/index.d.ts b/lib/node_modules/@stdlib/stats/incr/nancovariance/docs/types/index.d.ts index 7a8e9967ae69..f7a4ace64d84 100644 --- a/lib/node_modules/@stdlib/stats/incr/nancovariance/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/stats/incr/nancovariance/docs/types/index.d.ts @@ -21,27 +21,24 @@ /// /** - * If provided a pair of values, updates and returns the sample covariance; - * otherwise, returns the current sample covariance. - * - * @param x - first numeric value - * @param y - second numeric value - * @returns sample covariance or null - */ -interface Accumulator { - ( x: number, y: number ): number | null; - (): number | null; -} - +* If provided arguments, returns an updated sample covariance; otherwise, returns the current sample covariance. +* +* ## Notes +* +* - If provided `NaN`, the input is ignored and the accumulated value remains unchanged. +* +* @param x - value +* @param y - value +* @returns sample covariance or null +*/ +type accumulator = ( x?: number, y?: number ) => number | null; /** -* Returns an accumulator function which incrementally computes a count, ignoring `NaN` values. +* Returns an accumulator function which incrementally computes a sample covariance, ignoring `NaN` values. * * @returns accumulator function * * @example -* var nancovariance = require( '@stdlib/stats/incr/nancovariance' ); -* * var acc = nancovariance(); * * var cov = acc(); @@ -56,11 +53,10 @@ interface Accumulator { * cov = acc( 4.0, 5.0 ); * // returns 4.0 * -* cov = acc(); +* cov = acc(); * // returns 4.0 */ - -declare function nancovariance( ...args: [] ): Accumulator; +declare function nancovariance(): accumulator; // EXPORTS // diff --git a/lib/node_modules/@stdlib/stats/incr/nancovariance/docs/types/test.ts b/lib/node_modules/@stdlib/stats/incr/nancovariance/docs/types/test.ts index 0bf914168755..8c9b6c659031 100644 --- a/lib/node_modules/@stdlib/stats/incr/nancovariance/docs/types/test.ts +++ b/lib/node_modules/@stdlib/stats/incr/nancovariance/docs/types/test.ts @@ -16,13 +16,13 @@ * limitations under the License. */ -import nancovariance = require( '@stdlib/stats/incr/nancovariance' ); +import nancovariance = require( './index' ); // TESTS // // The function returns an accumulator function... { - nancovariance(); // $ExpectType Accumulator + nancovariance(); // $ExpectType accumulator } // The compiler throws an error if the function is provided any arguments... @@ -41,10 +41,20 @@ import nancovariance = require( '@stdlib/stats/incr/nancovariance' ); // The compiler throws an error if the returned accumulator function is provided invalid arguments... { const acc = nancovariance(); + acc( '5', 2.0 ); // $ExpectError acc( true, 2.0 ); // $ExpectError - acc( 2.0 ); // $ExpectError + acc( false, 2.0 ); // $ExpectError acc( null, 2.0 ); // $ExpectError - acc( [], {} ); // $ExpectError - acc( ( x: number ): number => x ); // $ExpectError + acc( [], 2.0 ); // $ExpectError + acc( {}, 2.0 ); // $ExpectError + acc( ( x: number ): number => x, 2.0 ); // $ExpectError + + acc( 2.0, '5' ); // $ExpectError + acc( 2.0, true ); // $ExpectError + acc( 2.0, false ); // $ExpectError + acc( 2.0, null ); // $ExpectError + acc( 2.0, [] ); // $ExpectError + acc( 2.0, {} ); // $ExpectError + acc( 2.0, ( x: number ): number => x ); // $ExpectError } diff --git a/lib/node_modules/@stdlib/stats/incr/nancovariance/lib/main.js b/lib/node_modules/@stdlib/stats/incr/nancovariance/lib/main.js index 4ea0de981100..42f8bd2be864 100644 --- a/lib/node_modules/@stdlib/stats/incr/nancovariance/lib/main.js +++ b/lib/node_modules/@stdlib/stats/incr/nancovariance/lib/main.js @@ -27,7 +27,7 @@ var isnan = require( '@stdlib/math/base/assert/is-nan' ); // MAIN // /** -* Returns an accumulator function which incrementally computes a sample covariance. +* Returns an accumulator function which incrementally computes a sample covariance, ignoring `NaN` values. * * @returns {Function} accumulator function * From b807a515a4b9c5e189748bef59bbc1f96572cfce Mon Sep 17 00:00:00 2001 From: Philipp Burckhardt Date: Wed, 15 Jul 2026 00:43:41 -0500 Subject: [PATCH 03/10] chore: update copyright years --- lib/node_modules/@stdlib/stats/incr/nancovariance/README.md | 2 +- .../@stdlib/stats/incr/nancovariance/benchmark/benchmark.js | 2 +- .../@stdlib/stats/incr/nancovariance/docs/types/index.d.ts | 2 +- .../@stdlib/stats/incr/nancovariance/docs/types/test.ts | 2 +- .../@stdlib/stats/incr/nancovariance/examples/index.js | 2 +- lib/node_modules/@stdlib/stats/incr/nancovariance/lib/index.js | 2 +- lib/node_modules/@stdlib/stats/incr/nancovariance/lib/main.js | 2 +- lib/node_modules/@stdlib/stats/incr/nancovariance/test/test.js | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/node_modules/@stdlib/stats/incr/nancovariance/README.md b/lib/node_modules/@stdlib/stats/incr/nancovariance/README.md index b50811877bdf..6bbaeb41d067 100644 --- a/lib/node_modules/@stdlib/stats/incr/nancovariance/README.md +++ b/lib/node_modules/@stdlib/stats/incr/nancovariance/README.md @@ -2,7 +2,7 @@ @license Apache-2.0 -Copyright (c) 2020 The Stdlib Authors. +Copyright (c) 2026 The Stdlib Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/stats/incr/nancovariance/benchmark/benchmark.js b/lib/node_modules/@stdlib/stats/incr/nancovariance/benchmark/benchmark.js index 7f43432ae8a6..6987ba384037 100644 --- a/lib/node_modules/@stdlib/stats/incr/nancovariance/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/stats/incr/nancovariance/benchmark/benchmark.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2020 The Stdlib Authors. +* Copyright (c) 2026 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/stats/incr/nancovariance/docs/types/index.d.ts b/lib/node_modules/@stdlib/stats/incr/nancovariance/docs/types/index.d.ts index f7a4ace64d84..80885c12debe 100644 --- a/lib/node_modules/@stdlib/stats/incr/nancovariance/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/stats/incr/nancovariance/docs/types/index.d.ts @@ -1,7 +1,7 @@ /* * @license Apache-2.0 * -* Copyright (c) 2020 The Stdlib Authors. +* Copyright (c) 2026 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/stats/incr/nancovariance/docs/types/test.ts b/lib/node_modules/@stdlib/stats/incr/nancovariance/docs/types/test.ts index 8c9b6c659031..b03bb0289a06 100644 --- a/lib/node_modules/@stdlib/stats/incr/nancovariance/docs/types/test.ts +++ b/lib/node_modules/@stdlib/stats/incr/nancovariance/docs/types/test.ts @@ -1,7 +1,7 @@ /* * @license Apache-2.0 * -* Copyright (c) 2019 The Stdlib Authors. +* Copyright (c) 2026 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/stats/incr/nancovariance/examples/index.js b/lib/node_modules/@stdlib/stats/incr/nancovariance/examples/index.js index 3307796fcc3d..47eff782e13d 100644 --- a/lib/node_modules/@stdlib/stats/incr/nancovariance/examples/index.js +++ b/lib/node_modules/@stdlib/stats/incr/nancovariance/examples/index.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2020 The Stdlib Authors. +* Copyright (c) 2026 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/stats/incr/nancovariance/lib/index.js b/lib/node_modules/@stdlib/stats/incr/nancovariance/lib/index.js index da2a461fcc5e..dd40200cba16 100644 --- a/lib/node_modules/@stdlib/stats/incr/nancovariance/lib/index.js +++ b/lib/node_modules/@stdlib/stats/incr/nancovariance/lib/index.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2020 The Stdlib Authors. +* Copyright (c) 2026 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/stats/incr/nancovariance/lib/main.js b/lib/node_modules/@stdlib/stats/incr/nancovariance/lib/main.js index 42f8bd2be864..8de8814c0b37 100644 --- a/lib/node_modules/@stdlib/stats/incr/nancovariance/lib/main.js +++ b/lib/node_modules/@stdlib/stats/incr/nancovariance/lib/main.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2020 The Stdlib Authors. +* Copyright (c) 2026 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/stats/incr/nancovariance/test/test.js b/lib/node_modules/@stdlib/stats/incr/nancovariance/test/test.js index 43e9fc9afae9..e5c75a0caf85 100644 --- a/lib/node_modules/@stdlib/stats/incr/nancovariance/test/test.js +++ b/lib/node_modules/@stdlib/stats/incr/nancovariance/test/test.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2018 The Stdlib Authors. +* Copyright (c) 2026 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From 153a1945ac1201b89a544b7428d62bb33dcace7f Mon Sep 17 00:00:00 2001 From: Philipp Burckhardt Date: Wed, 15 Jul 2026 01:13:26 -0500 Subject: [PATCH 04/10] docs: fix REPL help to describe nancovariance accumulator --- 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_pkg_readmes status: na - task: lint_markdown_docs status: na - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: passed - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - 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: na - task: lint_license_headers status: passed --- --- .../stats/incr/nancovariance/docs/repl.txt | 26 ++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/lib/node_modules/@stdlib/stats/incr/nancovariance/docs/repl.txt b/lib/node_modules/@stdlib/stats/incr/nancovariance/docs/repl.txt index d696647ca7ae..f97e26539b7a 100644 --- a/lib/node_modules/@stdlib/stats/incr/nancovariance/docs/repl.txt +++ b/lib/node_modules/@stdlib/stats/incr/nancovariance/docs/repl.txt @@ -1,9 +1,17 @@ + {{alias}}() - Returns an accumulator function which incrementally updates a count, - ignoring `NaN` values. + Returns an accumulator function which incrementally computes a sample + covariance, ignoring `NaN` values. + + If provided input values, the accumulator function returns an updated + sample covariance. If not provided input values, the accumulator function + returns the current sample covariance. + + If an input value is `NaN`, the input pair is ignored and the accumulated + value remains unchanged. - If provided a value, the accumulator function returns an updated count. If - not provided a value, the accumulator function returns the current count. + Until at least two valid data pairs have been provided, the accumulator + function returns `null`. Returns ------- @@ -15,14 +23,14 @@ > var accumulator = {{alias}}(); > var v = accumulator() null - > v = accumulator( 2.0 ) + > v = accumulator( 2.0, 1.0 ) null - > v = accumulator( NaN ) + > v = accumulator( NaN, 5.0 ) null - > v = accumulator( -5.0 ) - NaN + > v = accumulator( 4.0, 5.0 ) + 4.0 > v = accumulator() - NaN + 4.0 See Also -------- From c350555e6cada1eb1ad0038b4a6f5aa6aba29146 Mon Sep 17 00:00:00 2001 From: Philipp Burckhardt Date: Wed, 15 Jul 2026 01:14:08 -0500 Subject: [PATCH 05/10] style: align spacing and use format for benchmark label --- .../stats/incr/nancovariance/benchmark/benchmark.js | 8 +++++--- .../@stdlib/stats/incr/nancovariance/lib/index.js | 2 +- .../@stdlib/stats/incr/nancovariance/lib/main.js | 2 +- .../@stdlib/stats/incr/nancovariance/test/test.js | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/node_modules/@stdlib/stats/incr/nancovariance/benchmark/benchmark.js b/lib/node_modules/@stdlib/stats/incr/nancovariance/benchmark/benchmark.js index 6987ba384037..5574d4884989 100644 --- a/lib/node_modules/@stdlib/stats/incr/nancovariance/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/stats/incr/nancovariance/benchmark/benchmark.js @@ -15,12 +15,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + 'use strict'; // MODULES // var bench = require( '@stdlib/bench' ); var randu = require( '@stdlib/random/base/randu' ); +var format = require( '@stdlib/string/format' ); var pkg = require( './../package.json' ).name; var nancovariance = require( './../lib' ); @@ -45,7 +47,7 @@ bench( pkg, function benchmark( b ) { b.end(); }); -bench( pkg+'::accumulator', function benchmark( b ) { +bench( format( '%s::accumulator', pkg ), function benchmark( b ) { var acc; var x; var y; @@ -56,8 +58,8 @@ bench( pkg+'::accumulator', function benchmark( b ) { b.tic(); for ( i = 0; i < b.iterations; i++ ) { - x = ( randu() < 0.1 ) ? NaN : randu()*10; // ~10% NaN - y = ( randu() < 0.1 ) ? NaN : randu()*10; // ~10% NaN + x = ( randu() < 0.1 ) ? NaN : randu() * 10; // ~10% NaN + y = ( randu() < 0.1 ) ? NaN : randu() * 10; // ~10% NaN v = acc( x, y ); if ( v !== v && i > 1 ) { b.fail( 'accumulator should not return NaN once enough valid data' ); diff --git a/lib/node_modules/@stdlib/stats/incr/nancovariance/lib/index.js b/lib/node_modules/@stdlib/stats/incr/nancovariance/lib/index.js index dd40200cba16..6421483cba8b 100644 --- a/lib/node_modules/@stdlib/stats/incr/nancovariance/lib/index.js +++ b/lib/node_modules/@stdlib/stats/incr/nancovariance/lib/index.js @@ -34,7 +34,7 @@ * cov = acc( 2.0, 1.0 ); * // returns null (covariance is undefined for a single pair) * -* cov = acc( NaN , 5.0 ); +* cov = acc( NaN, 5.0 ); * // returns null (An input with a NaN is ignored) * * cov = acc( 4.0, 5.0 ); diff --git a/lib/node_modules/@stdlib/stats/incr/nancovariance/lib/main.js b/lib/node_modules/@stdlib/stats/incr/nancovariance/lib/main.js index 8de8814c0b37..5b5e68fb71dc 100644 --- a/lib/node_modules/@stdlib/stats/incr/nancovariance/lib/main.js +++ b/lib/node_modules/@stdlib/stats/incr/nancovariance/lib/main.js @@ -48,7 +48,7 @@ var isnan = require( '@stdlib/math/base/assert/is-nan' ); * cov = acc( 4.0, 5.0 ); * // returns 4.0 * -* cov = acc(); +* cov = acc(); * // returns 4.0 */ function nancovariance() { diff --git a/lib/node_modules/@stdlib/stats/incr/nancovariance/test/test.js b/lib/node_modules/@stdlib/stats/incr/nancovariance/test/test.js index e5c75a0caf85..a985211dfa9a 100644 --- a/lib/node_modules/@stdlib/stats/incr/nancovariance/test/test.js +++ b/lib/node_modules/@stdlib/stats/incr/nancovariance/test/test.js @@ -117,7 +117,7 @@ tape( 'the accumulator function computes correct covariance for multiple valid p var tol; var i; for ( i = 0; i < data.length; i++ ) { - cov = acc( data[i][0], data[i][1] ); + cov = acc( data[ i ][ 0 ], data[ i ][ 1 ] ); } delta = abs( cov - expected ); tol = EPS * abs( expected ); From d848f967e4f72936118131746584065469cecbb7 Mon Sep 17 00:00:00 2001 From: Philipp Burckhardt Date: Wed, 15 Jul 2026 01:16:33 -0500 Subject: [PATCH 06/10] docs: move explanatory notes off the return-value annotations The `// returns` annotation must state exactly the returned value; move the explanatory parentheticals onto preceding comment lines so the REPL help lint passes. --- .../@stdlib/stats/incr/nancovariance/lib/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/stats/incr/nancovariance/lib/index.js b/lib/node_modules/@stdlib/stats/incr/nancovariance/lib/index.js index 6421483cba8b..9e227b7efa73 100644 --- a/lib/node_modules/@stdlib/stats/incr/nancovariance/lib/index.js +++ b/lib/node_modules/@stdlib/stats/incr/nancovariance/lib/index.js @@ -31,11 +31,13 @@ * var cov = acc(); * // returns null * +* // Covariance is undefined for a single pair: * cov = acc( 2.0, 1.0 ); -* // returns null (covariance is undefined for a single pair) +* // returns null * +* // An input pair containing NaN is ignored: * cov = acc( NaN, 5.0 ); -* // returns null (An input with a NaN is ignored) +* // returns null * * cov = acc( 4.0, 5.0 ); * // returns 4.0 From 7e872138675951055f0b9c23dae38554fe416c99 Mon Sep 17 00:00:00 2001 From: Philipp Burckhardt Date: Wed, 15 Jul 2026 01:16:34 -0500 Subject: [PATCH 07/10] style: add blank line before test section separator Match the two-blank-line convention preceding the `// TESTS //` separator used across sibling packages. --- .../@stdlib/stats/incr/nancovariance/docs/types/test.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/node_modules/@stdlib/stats/incr/nancovariance/docs/types/test.ts b/lib/node_modules/@stdlib/stats/incr/nancovariance/docs/types/test.ts index b03bb0289a06..acbecede6cf1 100644 --- a/lib/node_modules/@stdlib/stats/incr/nancovariance/docs/types/test.ts +++ b/lib/node_modules/@stdlib/stats/incr/nancovariance/docs/types/test.ts @@ -18,6 +18,7 @@ import nancovariance = require( './index' ); + // TESTS // // The function returns an accumulator function... From 392aecb8c85d1eadb04644593b540f2a6cd447b0 Mon Sep 17 00:00:00 2001 From: Philipp Burckhardt Date: Wed, 15 Jul 2026 22:57:10 -0500 Subject: [PATCH 08/10] style: use standard test section separator Use the `// TESTS //` separator and drop the non-conventional `// MAIN //` heading and `// Additional tests...` comment, matching sibling packages such as stats/incr/covariance. --- .../@stdlib/stats/incr/nancovariance/test/test.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/node_modules/@stdlib/stats/incr/nancovariance/test/test.js b/lib/node_modules/@stdlib/stats/incr/nancovariance/test/test.js index a985211dfa9a..e3df6c4ba79a 100644 --- a/lib/node_modules/@stdlib/stats/incr/nancovariance/test/test.js +++ b/lib/node_modules/@stdlib/stats/incr/nancovariance/test/test.js @@ -26,7 +26,7 @@ var EPS = require( '@stdlib/constants/float64/eps' ); var nancovariance = require( './../lib' ); -// MAIN // +// TESTS // tape( 'main export is a function', function test( t ) { t.ok( true, __filename ); @@ -34,8 +34,6 @@ tape( 'main export is a function', function test( t ) { t.end(); }); -// Additional tests... - tape( 'the function returns an accumulator function', function test( t ) { var acc = nancovariance(); t.strictEqual( typeof acc, 'function', 'returns a function' ); From bf288cd120b66e5d10cede93f174a8c680d14f19 Mon Sep 17 00:00:00 2001 From: Philipp Burckhardt Date: Wed, 15 Jul 2026 23:00:48 -0500 Subject: [PATCH 09/10] docs: remove hand-authored See Also entries The related-packages section is autopopulated by tooling; empty the `See Also` block and related-links so entries are not authored by hand. --- .../@stdlib/stats/incr/nancovariance/README.md | 8 -------- 1 file changed, 8 deletions(-) diff --git a/lib/node_modules/@stdlib/stats/incr/nancovariance/README.md b/lib/node_modules/@stdlib/stats/incr/nancovariance/README.md index 6bbaeb41d067..cf7fab18f863 100644 --- a/lib/node_modules/@stdlib/stats/incr/nancovariance/README.md +++ b/lib/node_modules/@stdlib/stats/incr/nancovariance/README.md @@ -96,12 +96,6 @@ console.log( accumulator() ); @@ -112,8 +106,6 @@ console.log( accumulator() ); -[@stdlib/stats/incr/nansum]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/stats/incr/nansum - From be0eb9fe881e74693b0287c84813957d7d6f2a64 Mon Sep 17 00:00:00 2001 From: Philipp Burckhardt Date: Wed, 15 Jul 2026 23:03:33 -0500 Subject: [PATCH 10/10] docs: align description phrasing with sibling convention Use "compute a sample covariance incrementally, ignoring NaN values" across the package description, README, and module documentation, matching the phrasing used by sibling stats/incr/nan* packages. --- lib/node_modules/@stdlib/stats/incr/nancovariance/README.md | 2 +- lib/node_modules/@stdlib/stats/incr/nancovariance/lib/index.js | 2 +- lib/node_modules/@stdlib/stats/incr/nancovariance/package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/node_modules/@stdlib/stats/incr/nancovariance/README.md b/lib/node_modules/@stdlib/stats/incr/nancovariance/README.md index cf7fab18f863..7d5db2b95ea0 100644 --- a/lib/node_modules/@stdlib/stats/incr/nancovariance/README.md +++ b/lib/node_modules/@stdlib/stats/incr/nancovariance/README.md @@ -20,7 +20,7 @@ limitations under the License. # incrnancovariance -> Compute an incremental sample covariance while ignoring `NaN` values. +> Compute a sample covariance incrementally, ignoring `NaN` values.
diff --git a/lib/node_modules/@stdlib/stats/incr/nancovariance/lib/index.js b/lib/node_modules/@stdlib/stats/incr/nancovariance/lib/index.js index 9e227b7efa73..01852a1896a0 100644 --- a/lib/node_modules/@stdlib/stats/incr/nancovariance/lib/index.js +++ b/lib/node_modules/@stdlib/stats/incr/nancovariance/lib/index.js @@ -19,7 +19,7 @@ 'use strict'; /** -* Compute an incremental sample covariance while ignoring NaN values. +* Compute a sample covariance incrementally, ignoring `NaN` values. * * @module @stdlib/stats/incr/nancovariance * diff --git a/lib/node_modules/@stdlib/stats/incr/nancovariance/package.json b/lib/node_modules/@stdlib/stats/incr/nancovariance/package.json index b80e2ab2744e..fa2560df8810 100644 --- a/lib/node_modules/@stdlib/stats/incr/nancovariance/package.json +++ b/lib/node_modules/@stdlib/stats/incr/nancovariance/package.json @@ -1,7 +1,7 @@ { "name": "@stdlib/stats/incr/nancovariance", "version": "0.0.0", - "description": "Compute an incremental sample covariance while ignoring NaN values.", + "description": "Compute a sample covariance incrementally, ignoring NaN values.", "license": "Apache-2.0", "author": { "name": "The Stdlib Authors",