diff --git a/lib/node_modules/@stdlib/stats/base/dists/chi/kurtosis/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/stats/base/dists/chi/kurtosis/benchmark/benchmark.native.js index f35c89a1d91a..12d8d4706000 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/chi/kurtosis/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/stats/base/dists/chi/kurtosis/benchmark/benchmark.native.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/chi/kurtosis/benchmark/c/Makefile b/lib/node_modules/@stdlib/stats/base/dists/chi/kurtosis/benchmark/c/Makefile index a4bd7b38fd74..979768abbcec 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/chi/kurtosis/benchmark/c/Makefile +++ b/lib/node_modules/@stdlib/stats/base/dists/chi/kurtosis/benchmark/c/Makefile @@ -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/chi/kurtosis/benchmark/c/benchmark.c b/lib/node_modules/@stdlib/stats/base/dists/chi/kurtosis/benchmark/c/benchmark.c index b51a45ab5c55..30ef73b4af34 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/chi/kurtosis/benchmark/c/benchmark.c +++ b/lib/node_modules/@stdlib/stats/base/dists/chi/kurtosis/benchmark/c/benchmark.c @@ -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/chi/kurtosis/binding.gyp b/lib/node_modules/@stdlib/stats/base/dists/chi/kurtosis/binding.gyp index 68a1ca11d160..0d6508a12e99 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/chi/kurtosis/binding.gyp +++ b/lib/node_modules/@stdlib/stats/base/dists/chi/kurtosis/binding.gyp @@ -1,6 +1,6 @@ # @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/chi/kurtosis/examples/c/Makefile b/lib/node_modules/@stdlib/stats/base/dists/chi/kurtosis/examples/c/Makefile index 25ced822f96a..c8f8e9a1517b 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/chi/kurtosis/examples/c/Makefile +++ b/lib/node_modules/@stdlib/stats/base/dists/chi/kurtosis/examples/c/Makefile @@ -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/chi/kurtosis/examples/c/example.c b/lib/node_modules/@stdlib/stats/base/dists/chi/kurtosis/examples/c/example.c index a87c6740437d..eab33c4495fc 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/chi/kurtosis/examples/c/example.c +++ b/lib/node_modules/@stdlib/stats/base/dists/chi/kurtosis/examples/c/example.c @@ -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/chi/kurtosis/include.gypi b/lib/node_modules/@stdlib/stats/base/dists/chi/kurtosis/include.gypi index ecfaf82a3279..bee8d41a2caf 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/chi/kurtosis/include.gypi +++ b/lib/node_modules/@stdlib/stats/base/dists/chi/kurtosis/include.gypi @@ -1,6 +1,6 @@ # @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/chi/kurtosis/include/stdlib/stats/base/dists/chi/kurtosis.h b/lib/node_modules/@stdlib/stats/base/dists/chi/kurtosis/include/stdlib/stats/base/dists/chi/kurtosis.h index 8ce151bbe346..1de2301bd958 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/chi/kurtosis/include/stdlib/stats/base/dists/chi/kurtosis.h +++ b/lib/node_modules/@stdlib/stats/base/dists/chi/kurtosis/include/stdlib/stats/base/dists/chi/kurtosis.h @@ -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/chi/kurtosis/lib/index.js b/lib/node_modules/@stdlib/stats/base/dists/chi/kurtosis/lib/index.js index 717c36d3de82..2e5a954c611a 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/chi/kurtosis/lib/index.js +++ b/lib/node_modules/@stdlib/stats/base/dists/chi/kurtosis/lib/index.js @@ -35,7 +35,14 @@ // MODULES // -var main = require( './main.js' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var polyfill = require( './main.js' ); + + +// VARIABLES // + +var kurtosis = tryRequire( require.resolve( './native.js' ) ); +var main = ( kurtosis instanceof Error ) ? polyfill : kurtosis; // EXPORTS // diff --git a/lib/node_modules/@stdlib/stats/base/dists/chi/kurtosis/lib/native.js b/lib/node_modules/@stdlib/stats/base/dists/chi/kurtosis/lib/native.js index b40b51ada1e1..92e3fd4b1d5d 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/chi/kurtosis/lib/native.js +++ b/lib/node_modules/@stdlib/stats/base/dists/chi/kurtosis/lib/native.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/chi/kurtosis/src/Makefile b/lib/node_modules/@stdlib/stats/base/dists/chi/kurtosis/src/Makefile index 7733b6180cb4..2caf905cedbe 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/chi/kurtosis/src/Makefile +++ b/lib/node_modules/@stdlib/stats/base/dists/chi/kurtosis/src/Makefile @@ -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/chi/kurtosis/src/addon.c b/lib/node_modules/@stdlib/stats/base/dists/chi/kurtosis/src/addon.c index a97ded269b07..59f04ce75ebe 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/chi/kurtosis/src/addon.c +++ b/lib/node_modules/@stdlib/stats/base/dists/chi/kurtosis/src/addon.c @@ -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/chi/kurtosis/src/main.c b/lib/node_modules/@stdlib/stats/base/dists/chi/kurtosis/src/main.c index fa087198e52d..28eab5c7db82 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/chi/kurtosis/src/main.c +++ b/lib/node_modules/@stdlib/stats/base/dists/chi/kurtosis/src/main.c @@ -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/chi/kurtosis/test/test.js b/lib/node_modules/@stdlib/stats/base/dists/chi/kurtosis/test/test.js index 062fbe2f3d97..85d8512453f1 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/chi/kurtosis/test/test.js +++ b/lib/node_modules/@stdlib/stats/base/dists/chi/kurtosis/test/test.js @@ -21,6 +21,7 @@ // MODULES // var tape = require( 'tape' ); +var proxyquire = require( 'proxyquire' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var abs = require( '@stdlib/math/base/special/abs' ); var NINF = require( '@stdlib/constants/float64/ninf' ); @@ -83,3 +84,21 @@ tape( 'the function returns the excess kurtosis of a chi distribution', function } t.end(); }); + +tape( 'if a native implementation is not available, the main export is a JavaScript implementation', function test( t ) { + var kurtosis; + var main; + + main = require( './../lib/main.js' ); + + kurtosis = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( kurtosis, main, 'returns expected value' ); + t.end(); + + function tryRequire() { + return new Error( 'Cannot find module' ); + } +}); diff --git a/lib/node_modules/@stdlib/stats/base/dists/chi/kurtosis/test/test.main.js b/lib/node_modules/@stdlib/stats/base/dists/chi/kurtosis/test/test.main.js new file mode 100644 index 000000000000..7e77ec4befc2 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/chi/kurtosis/test/test.main.js @@ -0,0 +1,89 @@ +/** +* @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 // + +var tape = require( 'tape' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var abs = require( '@stdlib/math/base/special/abs' ); +var NINF = require( '@stdlib/constants/float64/ninf' ); + + +// FIXTURES // + +var data = require( './fixtures/julia/data.json' ); + + +// VARIABLES // + +var kurtosis = require( './../lib/main.js' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof kurtosis, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'if provided `NaN` for `k`, the function returns `NaN`', function test( t ) { + var v = kurtosis( NaN ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'if provided a degrees of freedom parameter `k` that is not a positive number, the function returns `NaN`', function test( t ) { + var v; + + v = kurtosis( -1.0 ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); + + v = kurtosis( 0.0 ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); + + v = kurtosis( NINF ); + t.strictEqual( isnan( v ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns the excess kurtosis of a chi distribution', function test( t ) { + var expected; + var delta; + var tol; + var k; + var i; + var y; + + expected = data.expected; + k = data.k; + for ( i = 0; i < expected.length; i++ ) { + y = kurtosis( k[i] ); + if ( y === expected[i] ) { + t.strictEqual( y, expected[i], 'k:'+k[i]+', y: '+y+', expected: '+expected[i] ); + } else { + delta = abs( y - expected[ i ] ); + tol = 1e-8 * abs( expected[ i ] ); + t.ok( delta <= tol, 'within tolerance. k: '+k[i]+'. y: '+y+'. E: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' ); + } + } + t.end(); +}); diff --git a/lib/node_modules/@stdlib/stats/base/dists/chi/kurtosis/test/test.native.js b/lib/node_modules/@stdlib/stats/base/dists/chi/kurtosis/test/test.native.js index 5ca82b0a697b..436a42532944 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/chi/kurtosis/test/test.native.js +++ b/lib/node_modules/@stdlib/stats/base/dists/chi/kurtosis/test/test.native.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.