From fda12113e9b196a5cc4a5f89fd4f07b9a925da58 Mon Sep 17 00:00:00 2001 From: Karan Anand Date: Wed, 19 Feb 2025 03:33:00 -0800 Subject: [PATCH 1/9] feat: add implementation --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - 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: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../base/dists/bradford/mode/lib/index.js | 43 +++++++++++ .../base/dists/bradford/mode/lib/main.js | 71 +++++++++++++++++++ 2 files changed, 114 insertions(+) create mode 100644 lib/node_modules/@stdlib/stats/base/dists/bradford/mode/lib/index.js create mode 100644 lib/node_modules/@stdlib/stats/base/dists/bradford/mode/lib/main.js diff --git a/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/lib/index.js b/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/lib/index.js new file mode 100644 index 000000000000..fbfe1cd4ea9f --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/lib/index.js @@ -0,0 +1,43 @@ +/** +* @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'; + +/** +* Bradford distribution mode. +* +* @module @stdlib/stats/base/dists/bradford/mode +* +* @example +* var mode = require( '@stdlib/stats/base/dists/bradford/mode' ); +* +* var v = mode( 0.1 ); +* // returns 0.0 +* +* v = mode( 0.5 ); +* // returns 0.0 +*/ + +// MODULES // + +var mode = require( './main.js' ); + + +// EXPORTS // + +module.exports = mode; diff --git a/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/lib/main.js b/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/lib/main.js new file mode 100644 index 000000000000..4e269d0397db --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/lib/main.js @@ -0,0 +1,71 @@ +/** +* @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' ); + + +// MAIN // + +/** +* Returns the mode of a Bradford distribution. +* +* @param {number} c - shape parameter +* @returns {number} mode +* +* @example +* var v = mode( 0.1 ); +* // returns 0.0 +* +* @example +* var v = mode( 0.5 ); +* // returns 0.0 +* +* @example +* var v = mode( 10.0 ); +* // returns 0.0 +* +* @example +* var v = mode( 0.0 ); +* // returns NaN +* +* @example +* var v = mode( -1.0 ); +* // returns NaN +* +* @example +* var v = mode( NaN ); +* // returns NaN +*/ +function mode( c ) { + if ( + isnan( c ) || + c <= 0.0 + ) { + return NaN; + } + return 0.0; +} + + +// EXPORTS // + +module.exports = mode; From 34fc73dcacc0e2f785171b5f8267c4330a97c13d Mon Sep 17 00:00:00 2001 From: Karan Anand Date: Wed, 19 Feb 2025 03:33:28 -0800 Subject: [PATCH 2/9] feat: add tests --- 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: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - 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: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../base/dists/bradford/mode/test/test.js | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 lib/node_modules/@stdlib/stats/base/dists/bradford/mode/test/test.js diff --git a/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/test/test.js b/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/test/test.js new file mode 100644 index 000000000000..7271072e5913 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/test/test.js @@ -0,0 +1,71 @@ +/** +* @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 isnan = require( '@stdlib/math/base/assert/is-nan' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var NINF = require( '@stdlib/constants/float64/ninf' ); +var mode = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof mode, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'if provided `NaN` for `c`, the function returns `NaN`', function test( t ) { + var v = mode( NaN ); + t.equal( isnan( v ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'if provided `c <= 0`, the function returns `NaN`', function test( t ) { + var v; + + v = mode( 0.0 ); + t.equal( isnan( v ), true, 'returns expected value' ); + + v = mode( -1.0 ); + t.equal( isnan( v ), true, 'returns expected value' ); + + v = mode( NINF ); + t.equal( isnan( v ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns `0.0` as the mode of a Bradford distribution', function test( t ) { + var c; + var i; + var y; + + c = uniform( 10, 0.1, 10.0 ); + + for ( i = 0; i < c.length; i++ ) { + y = mode( c[ i ] ); + t.equal( y, 0.0, 'returns expected value' ); + } + t.end(); +}); From fe18f3a315291821f439f922cc94839d1ce2073c Mon Sep 17 00:00:00 2001 From: Karan Anand Date: Wed, 19 Feb 2025 03:33:51 -0800 Subject: [PATCH 3/9] feat: add docs, benchmarks and examples --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: passed - task: lint_repl_help status: passed - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: passed - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na --- --- .../stats/base/dists/bradford/mode/README.md | 141 ++++++++++++++++++ .../bradford/mode/benchmark/benchmark.js | 59 ++++++++ .../mode/docs/img/equation_bradford_mode.svg | 27 ++++ .../base/dists/bradford/mode/docs/repl.txt | 29 ++++ .../dists/bradford/mode/docs/types/index.d.ts | 60 ++++++++ .../dists/bradford/mode/docs/types/test.ts | 44 ++++++ .../dists/bradford/mode/examples/index.js | 31 ++++ .../base/dists/bradford/mode/package.json | 68 +++++++++ 8 files changed, 459 insertions(+) create mode 100644 lib/node_modules/@stdlib/stats/base/dists/bradford/mode/README.md create mode 100644 lib/node_modules/@stdlib/stats/base/dists/bradford/mode/benchmark/benchmark.js create mode 100644 lib/node_modules/@stdlib/stats/base/dists/bradford/mode/docs/img/equation_bradford_mode.svg create mode 100644 lib/node_modules/@stdlib/stats/base/dists/bradford/mode/docs/repl.txt create mode 100644 lib/node_modules/@stdlib/stats/base/dists/bradford/mode/docs/types/index.d.ts create mode 100644 lib/node_modules/@stdlib/stats/base/dists/bradford/mode/docs/types/test.ts create mode 100644 lib/node_modules/@stdlib/stats/base/dists/bradford/mode/examples/index.js create mode 100644 lib/node_modules/@stdlib/stats/base/dists/bradford/mode/package.json diff --git a/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/README.md b/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/README.md new file mode 100644 index 000000000000..dcc0eb990aed --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/README.md @@ -0,0 +1,141 @@ + + +# Mean + +> [Bradford][bradford-distribution] distribution [mode][mode]. + + + +
+ +The [mode][mode] for a [Bradford][bradford-distribution] random variable is + + + +```math +\mathop{\mathrm{mode}}\left( X \right) = 0 +``` + + + + + +where `c` is the shape parameter. + +
+ + + + + +
+ +## Usage + +```javascript +var mode = require( '@stdlib/stats/base/dists/bradford/mode' ); +``` + +#### mode( c ) + +Returns the [mode][mode] of a [Bradford][bradford-distribution] distribution with shape parameter `c`. + +```javascript +var v = mode( 0.1 ); +// returns 0.0 + +v = mode( 10.0 ); +// returns 0.0 +``` + +If `c <= 0`, the function returns `NaN`. + +```javascript +var v = mode( NaN ); +// returns NaN + +v = mode( 0.0 ); +// returns NaN + +v = mode( -1.5 ); +// returns NaN +``` + +
+ + + + + +
+ +
+ + + + + +
+ +## Examples + + + +```javascript +var uniform = require( '@stdlib/random/array/uniform' ); +var mode = require( '@stdlib/stats/base/dists/bradford/mode' ); + +var c = uniform( 10, 0.1, 10.0 ); + +var v; +var i; +for ( i = 0; i < c.length; i++ ) { + v = mode( c[ i ] ); + console.log( 'c: %d, mode(X;c): %d', c[ i ].toFixed( 4 ), v.toFixed( 4 ) ); +} +``` + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/benchmark/benchmark.js b/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/benchmark/benchmark.js new file mode 100644 index 000000000000..e4bf70e8883a --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/benchmark/benchmark.js @@ -0,0 +1,59 @@ +/** +* @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 bench = require( '@stdlib/bench' ); +var Float64Array = require( '@stdlib/array/float64' ); +var uniform = require( '@stdlib/random/base/uniform' ); +var EPS = require( '@stdlib/constants/float64/eps' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pkg = require( './../package.json' ).name; +var mode = require( './../lib' ); + + +// MAIN // + +bench( pkg, function benchmark( b ) { + var len; + var c; + var y; + var i; + + len = 100; + c = new Float64Array( len ); + for ( i = 0; i < len; i++ ) { + c[ i ] = uniform( EPS, 10.0 ); + } + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + y = mode( c[ i % len ] ); + if ( isnan( y ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( y ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); +}); diff --git a/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/docs/img/equation_bradford_mode.svg b/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/docs/img/equation_bradford_mode.svg new file mode 100644 index 000000000000..e51bc6289018 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/docs/img/equation_bradford_mode.svg @@ -0,0 +1,27 @@ + +normal m times normal o times normal d times normal e left-parenthesis upper X right-parenthesis equals 0 + + + \ No newline at end of file diff --git a/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/docs/repl.txt b/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/docs/repl.txt new file mode 100644 index 000000000000..efa5b26aef26 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/docs/repl.txt @@ -0,0 +1,29 @@ + +{{alias}}( c ) + Returns the mode of a Bradford distribution with shape + parameter `c`. + + If `c <= 0`, the function returns `NaN`. + + Parameters + ---------- + c: number + Shape parameter. + + Returns + ------- + out: number + Mode. + + Examples + -------- + > var v = {{alias}}( 0.1 ) + 0.0 + > v = {{alias}}( 0.5 ) + 0.0 + > v = {{alias}}( 10.0 ) + 0.0 + + See Also + -------- + diff --git a/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/docs/types/index.d.ts b/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/docs/types/index.d.ts new file mode 100644 index 000000000000..3718abbaede3 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/docs/types/index.d.ts @@ -0,0 +1,60 @@ +/* +* @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. +*/ + +// TypeScript Version: 4.1 + +/** +* Returns the mode of a Bradford distribution. +* +* ## Notes +* +* - If `c <= 0`, the function returns `NaN`. +* +* @param c - shape parameter +* @returns mode +* +* @example +* var v = mode( 0.1 ); +* // returns 0.0 +* +* @example +* var v = mode( 0.5 ); +* // returns 0.0 +* +* @example +* var v = mode( 10.0 ); +* // returns 0.0 +* +* @example +* var v = mode( 0.0 ); +* // returns NaN +* +* @example +* var v = mode( -1.0 ); +* // returns NaN +* +* @example +* var v = mode( NaN ); +* // returns NaN +*/ +declare function mode( c: number ): number; + + +// EXPORTS // + +export = mode; diff --git a/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/docs/types/test.ts b/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/docs/types/test.ts new file mode 100644 index 000000000000..a1f70068852e --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/docs/types/test.ts @@ -0,0 +1,44 @@ +/* +* @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. +*/ + +import mode = require( './index' ); + + +// TESTS // + +// The function returns a number... +{ + mode( 0.3 ); // $ExpectType number +} + +// The compiler throws an error if the function is provided a value other than a number... +{ + mode( true ); // $ExpectError + mode( false ); // $ExpectError + mode( null ); // $ExpectError + mode( undefined ); // $ExpectError + mode( '5' ); // $ExpectError + mode( [] ); // $ExpectError + mode( {} ); // $ExpectError + mode( ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided insufficient arguments... +{ + mode(); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/examples/index.js b/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/examples/index.js new file mode 100644 index 000000000000..adf0da56cfbe --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/examples/index.js @@ -0,0 +1,31 @@ +/** +* @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'; + +var uniform = require( '@stdlib/random/array/uniform' ); +var mode = require( './../lib' ); + +var c = uniform( 10, 0.1, 10.0 ); + +var v; +var i; +for ( i = 0; i < c.length; i++ ) { + v = mode( c[ i ] ); + console.log( 'c: %d, mode(X;c): %d', c[ i ].toFixed( 4 ), v.toFixed( 4 ) ); +} diff --git a/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/package.json b/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/package.json new file mode 100644 index 000000000000..cfc14d7cc690 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/package.json @@ -0,0 +1,68 @@ +{ + "name": "@stdlib/stats/base/dists/bradford/mode", + "version": "0.0.0", + "description": "Bradford distribution mode.", + "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", + "stdmath", + "statistics", + "stats", + "distribution", + "dist", + "bradford", + "bradford-distribution", + "parameter", + "shape-parameter", + "continuous", + "skewed", + "mode", + "mode-value", + "mode-location" + ] +} From 0280381e23cef847c980f45690e4ee8a9a3065e6 Mon Sep 17 00:00:00 2001 From: Karan Anand Date: Wed, 19 Feb 2025 05:14:44 -0800 Subject: [PATCH 4/9] refactor: use uniform array in benchmarks --- 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: na - task: lint_repl_help status: na - 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: 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 --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: passed - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na --- --- .../base/dists/bradford/mode/benchmark/benchmark.js | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/benchmark/benchmark.js b/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/benchmark/benchmark.js index e4bf70e8883a..5f6132132bc6 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/benchmark/benchmark.js @@ -21,9 +21,7 @@ // MODULES // var bench = require( '@stdlib/bench' ); -var Float64Array = require( '@stdlib/array/float64' ); -var uniform = require( '@stdlib/random/base/uniform' ); -var EPS = require( '@stdlib/constants/float64/eps' ); +var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pkg = require( './../package.json' ).name; var mode = require( './../lib' ); @@ -32,20 +30,15 @@ var mode = require( './../lib' ); // MAIN // bench( pkg, function benchmark( b ) { - var len; var c; var y; var i; - len = 100; - c = new Float64Array( len ); - for ( i = 0; i < len; i++ ) { - c[ i ] = uniform( EPS, 10.0 ); - } + c = uniform( 100, 0.1, 10.0 ); b.tic(); for ( i = 0; i < b.iterations; i++ ) { - y = mode( c[ i % len ] ); + y = mode( c[ i % c.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } From b3d0a9c10d80c3135849c111b8c9e659e1223928 Mon Sep 17 00:00:00 2001 From: Karan Anand Date: Wed, 19 Feb 2025 11:08:14 -0800 Subject: [PATCH 5/9] fix: parameter types --- 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: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - 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: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na --- --- .../@stdlib/stats/base/dists/bradford/mode/lib/main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/lib/main.js b/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/lib/main.js index 4e269d0397db..797e533b6c5b 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/lib/main.js +++ b/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/lib/main.js @@ -28,8 +28,8 @@ var isnan = require( '@stdlib/math/base/assert/is-nan' ); /** * Returns the mode of a Bradford distribution. * -* @param {number} c - shape parameter -* @returns {number} mode +* @param {PositiveNumber} c - shape parameter +* @returns {NonNegativeNumber} mode * * @example * var v = mode( 0.1 ); From 673c74cac8b29b98f78657e1095dcba89def0e2e Mon Sep 17 00:00:00 2001 From: Karan Anand Date: Wed, 19 Feb 2025 17:14:30 -0800 Subject: [PATCH 6/9] docs: fix the description in README --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: na - 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: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: passed - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na --- --- .../@stdlib/stats/base/dists/bradford/mode/README.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/README.md b/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/README.md index dcc0eb990aed..c56cd77fa9c3 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/README.md @@ -69,13 +69,10 @@ v = mode( 10.0 ); // returns 0.0 ``` -If `c <= 0`, the function returns `NaN`. +If provided `c <= 0`, the function returns `NaN`. ```javascript -var v = mode( NaN ); -// returns NaN - -v = mode( 0.0 ); +var v = mode( 0.0 ); // returns NaN v = mode( -1.5 ); From c06940b22d733e9a187eb8b8def52b8217476bdc Mon Sep 17 00:00:00 2001 From: Karan Anand Date: Wed, 19 Feb 2025 17:27:29 -0800 Subject: [PATCH 7/9] docs: improve clarity in README --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: na - 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: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: passed - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na --- --- .../@stdlib/stats/base/dists/bradford/mode/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/README.md b/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/README.md index c56cd77fa9c3..426ce1f6dcb2 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/README.md @@ -69,7 +69,7 @@ v = mode( 10.0 ); // returns 0.0 ``` -If provided `c <= 0`, the function returns `NaN`. +If provided a shape parameter `c <= 0`, the function returns `NaN`. ```javascript var v = mode( 0.0 ); From d86dc6c65ed6443d1590caa318e6b3cd4c036086 Mon Sep 17 00:00:00 2001 From: Karan Anand Date: Wed, 19 Feb 2025 19:59:27 -0800 Subject: [PATCH 8/9] docs: fix typo in title --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: na - 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: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: passed - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na --- --- .../@stdlib/stats/base/dists/bradford/mode/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/README.md b/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/README.md index 426ce1f6dcb2..3147d7f90b5c 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/README.md @@ -18,7 +18,7 @@ limitations under the License. --> -# Mean +# Mode > [Bradford][bradford-distribution] distribution [mode][mode]. From 7b1145126b809960e920f1f41ce9df971f8cc242 Mon Sep 17 00:00:00 2001 From: Karan Anand Date: Thu, 20 Feb 2025 17:36:10 -0800 Subject: [PATCH 9/9] chore: remove extra linebreak --- 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: 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: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na --- --- .../@stdlib/stats/base/dists/bradford/mode/docs/repl.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/docs/repl.txt b/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/docs/repl.txt index efa5b26aef26..44fef0eec6ef 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/docs/repl.txt +++ b/lib/node_modules/@stdlib/stats/base/dists/bradford/mode/docs/repl.txt @@ -1,7 +1,6 @@ {{alias}}( c ) - Returns the mode of a Bradford distribution with shape - parameter `c`. + Returns the mode of a Bradford distribution with shape parameter `c`. If `c <= 0`, the function returns `NaN`.