From 24bbbe910de9146790a680e745fed275dd2e52b8 Mon Sep 17 00:00:00 2001 From: kshitijgarg2811-oss Date: Thu, 1 Jan 2026 20:08:56 +0530 Subject: [PATCH 1/6] feat: implement mean and variance for half-normal distribution --- .../base/dists/halfnormal/mean/lib/index.js | 25 ++++++ .../base/dists/halfnormal/mean/lib/main.js | 45 +++++++++++ .../base/dists/halfnormal/mean/package.json | 76 +++++++++++++++++++ .../base/dists/halfnormal/mean/test/test.js | 68 +++++++++++++++++ .../dists/halfnormal/variance/lib/index.js | 25 ++++++ .../dists/halfnormal/variance/lib/main.js | 46 +++++++++++ .../dists/halfnormal/variance/package.json | 74 ++++++++++++++++++ .../dists/halfnormal/variance/test/test.js | 67 ++++++++++++++++ 8 files changed, 426 insertions(+) create mode 100644 lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/lib/index.js create mode 100644 lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/lib/main.js create mode 100644 lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/package.json create mode 100644 lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/test/test.js create mode 100644 lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/lib/index.js create mode 100644 lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/lib/main.js create mode 100644 lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/package.json create mode 100644 lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/test/test.js diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/lib/index.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/lib/index.js new file mode 100644 index 000000000000..2ac7dd5a6ff2 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/lib/index.js @@ -0,0 +1,25 @@ +'use strict'; + +/** +* Half-normal distribution expected value. +* +* @module @stdlib/stats/base/dists/halfnormal/mean +* +* @example +* var mean = require( '@stdlib/stats/base/dists/halfnormal/mean' ); +* +* var v = mean( 1.0 ); +* // returns ~0.798 +* +* var v = mean( 2.0 ); +* // returns ~1.596 +*/ + +// MODULES // + +var main = require( './main.js' ); + + +// EXPORTS // + +module.exports = main; \ No newline at end of file diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/lib/main.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/lib/main.js new file mode 100644 index 000000000000..f963b4ef3f7f --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/lib/main.js @@ -0,0 +1,45 @@ +'use strict'; + +// MODULES // + +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var sqrt = require( '@stdlib/math/base/special/sqrt' ); +var PI = require( '@stdlib/constants/float64/pi' ); + + +// CONSTANTS // + +var SQRT_TWO_OVER_PI = sqrt( 2.0 / PI ); + + +// MAIN // + +/** +* Returns the expected value of a half-normal distribution. +* +* @param {number} sigma - scale parameter +* @returns {number} expected value +* +* @example +* var v = mean( 1.0 ); +* // returns ~0.798 +* +* @example +* var v = mean( 2.0 ); +* // returns ~1.596 +* +* @example +* var v = mean( -1.0 ); +* // returns NaN +*/ +function mean( sigma ) { + if ( isnan( sigma ) || sigma <= 0.0 ) { + return NaN; + } + return sigma * SQRT_TWO_OVER_PI; +} + + +// EXPORTS // + +module.exports = mean; \ No newline at end of file diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/package.json b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/package.json new file mode 100644 index 000000000000..eb273822e197 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/package.json @@ -0,0 +1,76 @@ +{ + "name": "@stdlib/stats/base/dists/halfnormal/mean", + "version": "0.0.0", + "description": "Half-normal distribution expected value.", + "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": { + "lib": "./lib", + "doc": "./docs", + "test": "./test", + "benchmark": "./benchmark" + }, + "types": "./docs/types", + "scripts": { + "test": "make test", + "test-cov": "make test-cov", + "test-browsers": "make test-browsers" + }, + "homepage": "https://stdlib.io", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": { + "@stdlib/constants/float64/pi": "^0.2.2", + "@stdlib/math/base/assert/is-nan": "^0.2.2", + "@stdlib/math/base/special/sqrt": "^0.2.2" + }, + "devDependencies": { + "@stdlib/math/base/special/abs": "^0.2.2", + "tape": "git+https://github.com/kgryte/tape.git#fix/globby", + "istanbul": "^0.4.1", + "tap-min": "git+https://github.com/Planeshifter/tap-min.git", + "@stdlib/bench/harness": "^0.2.2" + }, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "stdmath", + "statistics", + "stats", + "distribution", + "half-normal", + "halfnormal", + "mean", + "expected value", + "expectation" + ] +} \ No newline at end of file diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/test/test.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/test/test.js new file mode 100644 index 000000000000..fd091852c3ba --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/test/test.js @@ -0,0 +1,68 @@ +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var abs = require( '@stdlib/math/base/special/abs' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var PINF = require( '@stdlib/constants/float64/pinf' ); +var NINF = require( '@stdlib/constants/float64/ninf' ); +var mean = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.equal( typeof mean, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'if provided `NaN` for `sigma`, the function returns `NaN`', function test( t ) { + var v = mean( NaN ); + t.equal( isnan( v ), true, 'returns NaN' ); + t.end(); +}); + +tape( 'if provided a value less than or equal to 0 for `sigma`, the function returns `NaN`', function test( t ) { + var v; + + v = mean( 0.0 ); + t.equal( isnan( v ), true, 'returns NaN' ); + + v = mean( -1.0 ); + t.equal( isnan( v ), true, 'returns NaN' ); + + v = mean( NINF ); + t.equal( isnan( v ), true, 'returns NaN' ); + + t.end(); +}); + +tape( 'the function returns the expected value', function test( t ) { + var expected; + var sigma; + var v; + var i; + + // Test cases (sigma, expected) + // Mean = sigma * sqrt(2/pi) -> sigma * ~0.79788456 + sigma = [ 1.0, 2.0, 5.0, 0.5 ]; + expected = [ + 0.79788456, + 1.59576912, + 3.98942280, + 0.39894228 + ]; + + for ( i = 0; i < sigma.length; i++ ) { + v = mean( sigma[ i ] ); + // We check if the difference is very small (epsilon) + if ( abs( v - expected[ i ] ) > 1e-7 ) { + t.fail( 'returns ' + v + ' when expected ' + expected[ i ] ); + } else { + t.pass( 'returns ' + v + ' when expected ' + expected[ i ] ); + } + } + t.end(); +}); \ No newline at end of file diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/lib/index.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/lib/index.js new file mode 100644 index 000000000000..3292e3a438d1 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/lib/index.js @@ -0,0 +1,25 @@ +'use strict'; + +/** +* Half-normal distribution variance. +* +* @module @stdlib/stats/base/dists/halfnormal/variance +* +* @example +* var variance = require( '@stdlib/stats/base/dists/halfnormal/variance' ); +* +* var v = variance( 1.0 ); +* // returns ~0.363 +* +* var v = variance( 2.0 ); +* // returns ~1.454 +*/ + +// MODULES // + +var main = require( './main.js' ); + + +// EXPORTS // + +module.exports = main; \ No newline at end of file diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/lib/main.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/lib/main.js new file mode 100644 index 000000000000..a899d215106b --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/lib/main.js @@ -0,0 +1,46 @@ +'use strict'; + +// MODULES // + +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var PI = require( '@stdlib/constants/float64/pi' ); + + +// CONSTANTS // + +// 1 - 2/pi +var FACTOR = 1.0 - ( 2.0 / PI ); + + +// MAIN // + +/** +* Returns the variance of a half-normal distribution. +* +* @param {number} sigma - scale parameter +* @returns {number} variance +* +* @example +* var v = variance( 1.0 ); +* // returns ~0.363 +* +* @example +* var v = variance( 2.0 ); +* // returns ~1.454 +* +* @example +* var v = variance( -1.0 ); +* // returns NaN +*/ +function variance( sigma ) { + if ( isnan( sigma ) || sigma <= 0.0 ) { + return NaN; + } + return pow( sigma, 2.0 ) * FACTOR; +} + + +// EXPORTS // + +module.exports = variance; \ No newline at end of file diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/package.json b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/package.json new file mode 100644 index 000000000000..f36defce757c --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/package.json @@ -0,0 +1,74 @@ +{ + "name": "@stdlib/stats/base/dists/halfnormal/variance", + "version": "0.0.0", + "description": "Half-normal distribution variance.", + "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": { + "doc": "./docs", + "lib": "./lib", + "test": "./test" + }, + "types": "./docs/types", + "scripts": { + "test": "make test", + "test-cov": "make test-cov", + "test-browsers": "make test-browsers" + }, + "homepage": "https://stdlib.io", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": { + "@stdlib/constants/float64/pi": "^0.2.2", + "@stdlib/math/base/assert/is-nan": "^0.2.2", + "@stdlib/math/base/special/pow": "^0.2.2" + }, + "devDependencies": { + "@stdlib/math/base/special/abs": "^0.2.2", + "tape": "git+https://github.com/kgryte/tape.git#fix/globby", + "istanbul": "^0.4.1", + "tap-min": "git+https://github.com/Planeshifter/tap-min.git" + }, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "stdmath", + "statistics", + "stats", + "distribution", + "half-normal", + "halfnormal", + "variance", + "var", + "dispersion" + ] +} \ No newline at end of file diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/test/test.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/test/test.js new file mode 100644 index 000000000000..7df13869c64a --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/test/test.js @@ -0,0 +1,67 @@ +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var abs = require( '@stdlib/math/base/special/abs' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var PINF = require( '@stdlib/constants/float64/pinf' ); +var NINF = require( '@stdlib/constants/float64/ninf' ); +var variance = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.equal( typeof variance, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'if provided `NaN` for `sigma`, the function returns `NaN`', function test( t ) { + var v = variance( NaN ); + t.equal( isnan( v ), true, 'returns NaN' ); + t.end(); +}); + +tape( 'if provided a value less than or equal to 0 for `sigma`, the function returns `NaN`', function test( t ) { + var v; + + v = variance( 0.0 ); + t.equal( isnan( v ), true, 'returns NaN' ); + + v = variance( -1.0 ); + t.equal( isnan( v ), true, 'returns NaN' ); + + v = variance( NINF ); + t.equal( isnan( v ), true, 'returns NaN' ); + + t.end(); +}); + +tape( 'the function returns the variance', function test( t ) { + var expected; + var sigma; + var v; + var i; + + // Test cases (sigma, expected) + // Variance = sigma^2 * (1 - 2/pi) + // 1 - 2/pi ≈ 0.3633802276 + sigma = [ 1.0, 2.0, 5.0 ]; + expected = [ + 0.36338023, + 1.45352091, + 9.08450569 + ]; + + for ( i = 0; i < sigma.length; i++ ) { + v = variance( sigma[ i ] ); + if ( abs( v - expected[ i ] ) > 1e-7 ) { + t.fail( 'returns ' + v + ' when expected ' + expected[ i ] ); + } else { + t.pass( 'returns ' + v + ' when expected ' + expected[ i ] ); + } + } + t.end(); +}); \ No newline at end of file From 2cb862b864452420ab128d66bace017c8a1da7bb Mon Sep 17 00:00:00 2001 From: kshitijgarg2811-oss Date: Tue, 6 Jan 2026 18:11:35 +0530 Subject: [PATCH 2/6] removed whitespaces --- .../stats/base/dists/halfnormal/mean/lib/index.js | 6 ------ .../stats/base/dists/halfnormal/mean/lib/main.js | 11 ----------- .../stats/base/dists/halfnormal/mean/test/test.js | 4 ---- .../stats/base/dists/halfnormal/variance/lib/index.js | 6 ------ .../stats/base/dists/halfnormal/variance/lib/main.js | 7 ------- .../stats/base/dists/halfnormal/variance/test/test.js | 4 ---- 6 files changed, 38 deletions(-) diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/lib/index.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/lib/index.js index 2ac7dd5a6ff2..07aac3c1f287 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/lib/index.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/lib/index.js @@ -1,5 +1,4 @@ 'use strict'; - /** * Half-normal distribution expected value. * @@ -14,12 +13,7 @@ * var v = mean( 2.0 ); * // returns ~1.596 */ - // MODULES // - var main = require( './main.js' ); - - // EXPORTS // - module.exports = main; \ No newline at end of file diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/lib/main.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/lib/main.js index f963b4ef3f7f..407c88b708d5 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/lib/main.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/lib/main.js @@ -1,19 +1,11 @@ 'use strict'; - // MODULES // - var isnan = require( '@stdlib/math/base/assert/is-nan' ); var sqrt = require( '@stdlib/math/base/special/sqrt' ); var PI = require( '@stdlib/constants/float64/pi' ); - - // CONSTANTS // - var SQRT_TWO_OVER_PI = sqrt( 2.0 / PI ); - - // MAIN // - /** * Returns the expected value of a half-normal distribution. * @@ -38,8 +30,5 @@ function mean( sigma ) { } return sigma * SQRT_TWO_OVER_PI; } - - // EXPORTS // - module.exports = mean; \ No newline at end of file diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/test/test.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/test/test.js index fd091852c3ba..41a480fc546f 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/test/test.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/test/test.js @@ -1,7 +1,5 @@ 'use strict'; - // MODULES // - var tape = require( 'tape' ); var abs = require( '@stdlib/math/base/special/abs' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); @@ -9,9 +7,7 @@ var PINF = require( '@stdlib/constants/float64/pinf' ); var NINF = require( '@stdlib/constants/float64/ninf' ); var mean = require( './../lib' ); - // TESTS // - tape( 'main export is a function', function test( t ) { t.ok( true, __filename ); t.equal( typeof mean, 'function', 'main export is a function' ); diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/lib/index.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/lib/index.js index 3292e3a438d1..d08948ba1529 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/lib/index.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/lib/index.js @@ -1,5 +1,4 @@ 'use strict'; - /** * Half-normal distribution variance. * @@ -14,12 +13,7 @@ * var v = variance( 2.0 ); * // returns ~1.454 */ - // MODULES // - var main = require( './main.js' ); - - // EXPORTS // - module.exports = main; \ No newline at end of file diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/lib/main.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/lib/main.js index a899d215106b..89d048db38c1 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/lib/main.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/lib/main.js @@ -1,18 +1,13 @@ 'use strict'; - // MODULES // - var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var PI = require( '@stdlib/constants/float64/pi' ); - - // CONSTANTS // // 1 - 2/pi var FACTOR = 1.0 - ( 2.0 / PI ); - // MAIN // /** @@ -40,7 +35,5 @@ function variance( sigma ) { return pow( sigma, 2.0 ) * FACTOR; } - // EXPORTS // - module.exports = variance; \ No newline at end of file diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/test/test.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/test/test.js index 7df13869c64a..c5d1296139af 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/test/test.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/test/test.js @@ -1,7 +1,5 @@ 'use strict'; - // MODULES // - var tape = require( 'tape' ); var abs = require( '@stdlib/math/base/special/abs' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); @@ -9,9 +7,7 @@ var PINF = require( '@stdlib/constants/float64/pinf' ); var NINF = require( '@stdlib/constants/float64/ninf' ); var variance = require( './../lib' ); - // TESTS // - tape( 'main export is a function', function test( t ) { t.ok( true, __filename ); t.equal( typeof variance, 'function', 'main export is a function' ); From 252f07c141673ddf02dd7ad0eed9a368ee0ad5f0 Mon Sep 17 00:00:00 2001 From: kshitijgarg2811-oss Date: Tue, 6 Jan 2026 18:48:24 +0530 Subject: [PATCH 3/6] fix: resolve lint errors (license, spacing, indentation) --- .../base/dists/halfnormal/mean/lib/index.js | 26 ++++- .../base/dists/halfnormal/mean/lib/main.js | 39 ++++++- .../base/dists/halfnormal/mean/package.json | 4 +- .../base/dists/halfnormal/mean/test/test.js | 97 ++++++++++------- .../dists/halfnormal/variance/lib/index.js | 26 ++++- .../dists/halfnormal/variance/lib/main.js | 35 +++++- .../dists/halfnormal/variance/package.json | 4 +- .../dists/halfnormal/variance/test/test.js | 100 +++++++++++------- 8 files changed, 238 insertions(+), 93 deletions(-) diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/lib/index.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/lib/index.js index 07aac3c1f287..576e317866c7 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/lib/index.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/lib/index.js @@ -1,4 +1,23 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 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'; + /** * Half-normal distribution expected value. * @@ -13,7 +32,12 @@ * var v = mean( 2.0 ); * // returns ~1.596 */ + // MODULES // + var main = require( './main.js' ); + + // EXPORTS // -module.exports = main; \ No newline at end of file + +module.exports = main; diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/lib/main.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/lib/main.js index 407c88b708d5..b39aff6913cf 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/lib/main.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/lib/main.js @@ -1,11 +1,37 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 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 isnan = require( '@stdlib/math/base/assert/is-nan' ); var sqrt = require( '@stdlib/math/base/special/sqrt' ); var PI = require( '@stdlib/constants/float64/pi' ); + + // CONSTANTS // + var SQRT_TWO_OVER_PI = sqrt( 2.0 / PI ); + + // MAIN // + /** * Returns the expected value of a half-normal distribution. * @@ -25,10 +51,13 @@ var SQRT_TWO_OVER_PI = sqrt( 2.0 / PI ); * // returns NaN */ function mean( sigma ) { - if ( isnan( sigma ) || sigma <= 0.0 ) { - return NaN; - } - return sigma * SQRT_TWO_OVER_PI; + if ( isnan( sigma ) || sigma <= 0.0 ) { + return NaN; + } + return sigma * SQRT_TWO_OVER_PI; } + + // EXPORTS // -module.exports = mean; \ No newline at end of file + +module.exports = mean; diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/package.json b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/package.json index eb273822e197..c88122ce8d48 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/package.json +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/package.json @@ -1,5 +1,5 @@ { - "name": "@stdlib/stats/base/dists/halfnormal/mean", + "name": "@stdlib/stats-base-dists-halfnormal-mean", "version": "0.0.0", "description": "Half-normal distribution expected value.", "license": "Apache-2.0", @@ -73,4 +73,4 @@ "expected value", "expectation" ] -} \ No newline at end of file +} diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/test/test.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/test/test.js index 41a480fc546f..42a0fe692160 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/test/test.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/test/test.js @@ -1,5 +1,25 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 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 isnan = require( '@stdlib/math/base/assert/is-nan' ); @@ -8,57 +28,58 @@ var NINF = require( '@stdlib/constants/float64/ninf' ); var mean = require( './../lib' ); // TESTS // + tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.equal( typeof mean, 'function', 'main export is a function' ); - t.end(); + t.ok( true, __filename ); + t.equal( typeof mean, 'function', 'main export is a function' ); + t.end(); }); tape( 'if provided `NaN` for `sigma`, the function returns `NaN`', function test( t ) { - var v = mean( NaN ); - t.equal( isnan( v ), true, 'returns NaN' ); - t.end(); + var v = mean( NaN ); + t.equal( isnan( v ), true, 'returns NaN' ); + t.end(); }); tape( 'if provided a value less than or equal to 0 for `sigma`, the function returns `NaN`', function test( t ) { - var v; + var v; - v = mean( 0.0 ); - t.equal( isnan( v ), true, 'returns NaN' ); + v = mean( 0.0 ); + t.equal( isnan( v ), true, 'returns NaN' ); - v = mean( -1.0 ); - t.equal( isnan( v ), true, 'returns NaN' ); + v = mean( -1.0 ); + t.equal( isnan( v ), true, 'returns NaN' ); - v = mean( NINF ); - t.equal( isnan( v ), true, 'returns NaN' ); + v = mean( NINF ); + t.equal( isnan( v ), true, 'returns NaN' ); - t.end(); + t.end(); }); tape( 'the function returns the expected value', function test( t ) { - var expected; - var sigma; - var v; - var i; + var expected; + var sigma; + var v; + var i; - // Test cases (sigma, expected) - // Mean = sigma * sqrt(2/pi) -> sigma * ~0.79788456 - sigma = [ 1.0, 2.0, 5.0, 0.5 ]; - expected = [ - 0.79788456, - 1.59576912, - 3.98942280, - 0.39894228 - ]; + // Test cases (sigma, expected) + // Mean = sigma * sqrt(2/pi) -> sigma * ~0.79788456 + sigma = [ 1.0, 2.0, 5.0, 0.5 ]; + expected = [ + 0.79788456, + 1.59576912, + 3.98942280, + 0.39894228 + ]; - for ( i = 0; i < sigma.length; i++ ) { - v = mean( sigma[ i ] ); - // We check if the difference is very small (epsilon) - if ( abs( v - expected[ i ] ) > 1e-7 ) { - t.fail( 'returns ' + v + ' when expected ' + expected[ i ] ); - } else { - t.pass( 'returns ' + v + ' when expected ' + expected[ i ] ); - } - } - t.end(); -}); \ No newline at end of file + for ( i = 0; i < sigma.length; i++ ) { + v = mean( sigma[ i ] ); + // We check if the difference is very small (epsilon) + if ( abs( v - expected[ i ] ) > 1e-7 ) { + t.fail( 'returns ' + v + ' when expected ' + expected[ i ] ); + } else { + t.pass( 'returns ' + v + ' when expected ' + expected[ i ] ); + } + } + t.end(); +}); diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/lib/index.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/lib/index.js index d08948ba1529..abf193c6c3f9 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/lib/index.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/lib/index.js @@ -1,4 +1,23 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 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'; + /** * Half-normal distribution variance. * @@ -13,7 +32,12 @@ * var v = variance( 2.0 ); * // returns ~1.454 */ + // MODULES // + var main = require( './main.js' ); + + // EXPORTS // -module.exports = main; \ No newline at end of file + +module.exports = main; diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/lib/main.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/lib/main.js index 89d048db38c1..b4e349451eed 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/lib/main.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/lib/main.js @@ -1,13 +1,36 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 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 isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); var PI = require( '@stdlib/constants/float64/pi' ); + + // CONSTANTS // // 1 - 2/pi var FACTOR = 1.0 - ( 2.0 / PI ); + // MAIN // /** @@ -29,11 +52,13 @@ var FACTOR = 1.0 - ( 2.0 / PI ); * // returns NaN */ function variance( sigma ) { - if ( isnan( sigma ) || sigma <= 0.0 ) { - return NaN; - } - return pow( sigma, 2.0 ) * FACTOR; + if ( isnan( sigma ) || sigma <= 0.0 ) { + return NaN; + } + return pow( sigma, 2.0 ) * FACTOR; } + // EXPORTS // -module.exports = variance; \ No newline at end of file + +module.exports = variance; diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/package.json b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/package.json index f36defce757c..80c483f2f7b3 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/package.json +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/package.json @@ -1,5 +1,5 @@ { - "name": "@stdlib/stats/base/dists/halfnormal/variance", + "name": "@stdlib/stats-base-dists-halfnormal-variance", "version": "0.0.0", "description": "Half-normal distribution variance.", "license": "Apache-2.0", @@ -71,4 +71,4 @@ "var", "dispersion" ] -} \ No newline at end of file +} diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/test/test.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/test/test.js index c5d1296139af..f8f9e3b3f332 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/test/test.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/test/test.js @@ -1,5 +1,25 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 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 isnan = require( '@stdlib/math/base/assert/is-nan' ); @@ -7,57 +27,59 @@ var PINF = require( '@stdlib/constants/float64/pinf' ); var NINF = require( '@stdlib/constants/float64/ninf' ); var variance = require( './../lib' ); + // TESTS // + tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.equal( typeof variance, 'function', 'main export is a function' ); - t.end(); + t.ok( true, __filename ); + t.equal( typeof variance, 'function', 'main export is a function' ); + t.end(); }); tape( 'if provided `NaN` for `sigma`, the function returns `NaN`', function test( t ) { - var v = variance( NaN ); - t.equal( isnan( v ), true, 'returns NaN' ); - t.end(); + var v = variance( NaN ); + t.equal( isnan( v ), true, 'returns NaN' ); + t.end(); }); tape( 'if provided a value less than or equal to 0 for `sigma`, the function returns `NaN`', function test( t ) { - var v; + var v; - v = variance( 0.0 ); - t.equal( isnan( v ), true, 'returns NaN' ); + v = variance( 0.0 ); + t.equal( isnan( v ), true, 'returns NaN' ); - v = variance( -1.0 ); - t.equal( isnan( v ), true, 'returns NaN' ); + v = variance( -1.0 ); + t.equal( isnan( v ), true, 'returns NaN' ); - v = variance( NINF ); - t.equal( isnan( v ), true, 'returns NaN' ); + v = variance( NINF ); + t.equal( isnan( v ), true, 'returns NaN' ); - t.end(); + t.end(); }); tape( 'the function returns the variance', function test( t ) { - var expected; - var sigma; - var v; - var i; - - // Test cases (sigma, expected) - // Variance = sigma^2 * (1 - 2/pi) - // 1 - 2/pi ≈ 0.3633802276 - sigma = [ 1.0, 2.0, 5.0 ]; - expected = [ - 0.36338023, - 1.45352091, - 9.08450569 - ]; - - for ( i = 0; i < sigma.length; i++ ) { - v = variance( sigma[ i ] ); - if ( abs( v - expected[ i ] ) > 1e-7 ) { - t.fail( 'returns ' + v + ' when expected ' + expected[ i ] ); - } else { - t.pass( 'returns ' + v + ' when expected ' + expected[ i ] ); - } - } - t.end(); -}); \ No newline at end of file + var expected; + var sigma; + var v; + var i; + + // Test cases (sigma, expected) + // Variance = sigma^2 * (1 - 2/pi) + // 1 - 2/pi ≈ 0.3633802276 + sigma = [ 1.0, 2.0, 5.0 ]; + expected = [ + 0.36338023, + 1.45352091, + 9.08450569 + ]; + + for ( i = 0; i < sigma.length; i++ ) { + v = variance( sigma[ i ] ); + if ( abs( v - expected[ i ] ) > 1e-7 ) { + t.fail( 'returns ' + v + ' when expected ' + expected[ i ] ); + } else { + t.pass( 'returns ' + v + ' when expected ' + expected[ i ] ); + } + } + t.end(); +}); From fdf2dc7dbfa450367ef669a3ebf87957a1bf618b Mon Sep 17 00:00:00 2001 From: kshitijgarg2811-oss Date: Tue, 6 Jan 2026 18:53:19 +0530 Subject: [PATCH 4/6] fix lint error ( year 2025 to 2026) --- .../@stdlib/stats/base/dists/halfnormal/mean/lib/index.js | 2 +- .../@stdlib/stats/base/dists/halfnormal/mean/lib/main.js | 2 +- .../@stdlib/stats/base/dists/halfnormal/mean/test/test.js | 2 +- .../@stdlib/stats/base/dists/halfnormal/variance/lib/index.js | 2 +- .../@stdlib/stats/base/dists/halfnormal/variance/lib/main.js | 2 +- .../@stdlib/stats/base/dists/halfnormal/variance/test/test.js | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/lib/index.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/lib/index.js index 576e317866c7..6b594a49c6e2 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/lib/index.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/lib/index.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2025 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/base/dists/halfnormal/mean/lib/main.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/lib/main.js index b39aff6913cf..c5e27733ee58 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/lib/main.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/lib/main.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2025 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/base/dists/halfnormal/mean/test/test.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/test/test.js index 42a0fe692160..f14dddf70988 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/test/test.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/test/test.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2025 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/base/dists/halfnormal/variance/lib/index.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/lib/index.js index abf193c6c3f9..0ad95e8c2569 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/lib/index.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/lib/index.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2025 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/base/dists/halfnormal/variance/lib/main.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/lib/main.js index b4e349451eed..8c4e804b2c7f 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/lib/main.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/lib/main.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2025 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/base/dists/halfnormal/variance/test/test.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/test/test.js index f8f9e3b3f332..5be84c1a57cc 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/test/test.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/test/test.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2025 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 e332fd7f7b07fdba0b0c4873596317a17a79be3f Mon Sep 17 00:00:00 2001 From: kshitijgarg2811-oss Date: Tue, 6 Jan 2026 19:13:37 +0530 Subject: [PATCH 5/6] resolves lint error --- .../@stdlib/stats/base/dists/halfnormal/mean/lib/main.js | 2 +- .../stats/base/dists/halfnormal/mean/package.json | 9 +++------ .../stats/base/dists/halfnormal/variance/lib/main.js | 2 +- .../stats/base/dists/halfnormal/variance/package.json | 3 +-- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/lib/main.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/lib/main.js index c5e27733ee58..9c1ac7bd4908 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/lib/main.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/lib/main.js @@ -25,7 +25,7 @@ var sqrt = require( '@stdlib/math/base/special/sqrt' ); var PI = require( '@stdlib/constants/float64/pi' ); -// CONSTANTS // +// VARIABLES // var SQRT_TWO_OVER_PI = sqrt( 2.0 / PI ); diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/package.json b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/package.json index c88122ce8d48..523a5db036e6 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/package.json +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/package.json @@ -1,5 +1,5 @@ { - "name": "@stdlib/stats-base-dists-halfnormal-mean", + "name": "@stdlib/stats/base/dists/halfnormal/mean", "version": "0.0.0", "description": "Half-normal distribution expected value.", "license": "Apache-2.0", @@ -16,9 +16,7 @@ "main": "./lib", "directories": { "lib": "./lib", - "doc": "./docs", - "test": "./test", - "benchmark": "./benchmark" + "test": "./test" }, "types": "./docs/types", "scripts": { @@ -43,8 +41,7 @@ "@stdlib/math/base/special/abs": "^0.2.2", "tape": "git+https://github.com/kgryte/tape.git#fix/globby", "istanbul": "^0.4.1", - "tap-min": "git+https://github.com/Planeshifter/tap-min.git", - "@stdlib/bench/harness": "^0.2.2" + "tap-min": "git+https://github.com/Planeshifter/tap-min.git" }, "engines": { "node": ">=0.10.0", diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/lib/main.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/lib/main.js index 8c4e804b2c7f..7c937076cce4 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/lib/main.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/lib/main.js @@ -25,7 +25,7 @@ var pow = require( '@stdlib/math/base/special/pow' ); var PI = require( '@stdlib/constants/float64/pi' ); -// CONSTANTS // +// VARIABLES // // 1 - 2/pi var FACTOR = 1.0 - ( 2.0 / PI ); diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/package.json b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/package.json index 80c483f2f7b3..1e18aab16080 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/package.json +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/package.json @@ -1,5 +1,5 @@ { - "name": "@stdlib/stats-base-dists-halfnormal-variance", + "name": "@stdlib/stats/base/dists/halfnormal/variance", "version": "0.0.0", "description": "Half-normal distribution variance.", "license": "Apache-2.0", @@ -15,7 +15,6 @@ ], "main": "./lib", "directories": { - "doc": "./docs", "lib": "./lib", "test": "./test" }, From b68621607589a5074f10425a925256c545925cb1 Mon Sep 17 00:00:00 2001 From: kshitijgarg2811-oss Date: Tue, 6 Jan 2026 19:20:28 +0530 Subject: [PATCH 6/6] resoves lint errors --- .../base/dists/halfnormal/mean/lib/index.js | 18 ------------------ .../base/dists/halfnormal/mean/lib/main.js | 18 ------------------ .../base/dists/halfnormal/mean/package.json | 9 ++++++--- .../base/dists/halfnormal/mean/test/test.js | 18 ------------------ .../dists/halfnormal/variance/lib/index.js | 18 ------------------ .../base/dists/halfnormal/variance/lib/main.js | 18 ------------------ .../dists/halfnormal/variance/package.json | 3 ++- .../dists/halfnormal/variance/test/test.js | 18 ------------------ 8 files changed, 8 insertions(+), 112 deletions(-) diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/lib/index.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/lib/index.js index 6b594a49c6e2..9d378cc16bf6 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/lib/index.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/lib/index.js @@ -1,21 +1,3 @@ -/** -* @license Apache-2.0 -* -* 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. -* 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'; /** diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/lib/main.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/lib/main.js index 9c1ac7bd4908..688f7b074ede 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/lib/main.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/lib/main.js @@ -1,21 +1,3 @@ -/** -* @license Apache-2.0 -* -* 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. -* 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 // diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/package.json b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/package.json index 523a5db036e6..c88122ce8d48 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/package.json +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/package.json @@ -1,5 +1,5 @@ { - "name": "@stdlib/stats/base/dists/halfnormal/mean", + "name": "@stdlib/stats-base-dists-halfnormal-mean", "version": "0.0.0", "description": "Half-normal distribution expected value.", "license": "Apache-2.0", @@ -16,7 +16,9 @@ "main": "./lib", "directories": { "lib": "./lib", - "test": "./test" + "doc": "./docs", + "test": "./test", + "benchmark": "./benchmark" }, "types": "./docs/types", "scripts": { @@ -41,7 +43,8 @@ "@stdlib/math/base/special/abs": "^0.2.2", "tape": "git+https://github.com/kgryte/tape.git#fix/globby", "istanbul": "^0.4.1", - "tap-min": "git+https://github.com/Planeshifter/tap-min.git" + "tap-min": "git+https://github.com/Planeshifter/tap-min.git", + "@stdlib/bench/harness": "^0.2.2" }, "engines": { "node": ">=0.10.0", diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/test/test.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/test/test.js index f14dddf70988..f680dc43fb26 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/test/test.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/mean/test/test.js @@ -1,21 +1,3 @@ -/** -* @license Apache-2.0 -* -* 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. -* 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 // diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/lib/index.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/lib/index.js index 0ad95e8c2569..dfde7b732a25 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/lib/index.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/lib/index.js @@ -1,21 +1,3 @@ -/** -* @license Apache-2.0 -* -* 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. -* 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'; /** diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/lib/main.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/lib/main.js index 7c937076cce4..f10a39c7ed54 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/lib/main.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/lib/main.js @@ -1,21 +1,3 @@ -/** -* @license Apache-2.0 -* -* 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. -* 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 // diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/package.json b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/package.json index 1e18aab16080..80c483f2f7b3 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/package.json +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/package.json @@ -1,5 +1,5 @@ { - "name": "@stdlib/stats/base/dists/halfnormal/variance", + "name": "@stdlib/stats-base-dists-halfnormal-variance", "version": "0.0.0", "description": "Half-normal distribution variance.", "license": "Apache-2.0", @@ -15,6 +15,7 @@ ], "main": "./lib", "directories": { + "doc": "./docs", "lib": "./lib", "test": "./test" }, diff --git a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/test/test.js b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/test/test.js index 5be84c1a57cc..d645f2be295a 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/test/test.js +++ b/lib/node_modules/@stdlib/stats/base/dists/halfnormal/variance/test/test.js @@ -1,21 +1,3 @@ -/** -* @license Apache-2.0 -* -* 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. -* 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 //