From 4cf8ad7f9820ff00bb61360b83d75c295da8f656 Mon Sep 17 00:00:00 2001 From: Jaysukh Makvana <111515433+Jaysukh-409@users.noreply.github.com> Date: Fri, 27 Dec 2024 06:22:40 +0530 Subject: [PATCH] feat: add `stats/base/dists/planck/cdf` PR-URL: https://github.com/stdlib-js/stdlib/pull/4130 Co-authored-by: Athan Reines Reviewed-by: Athan Reines --- .../stats/base/dists/planck/cdf/README.md | 139 ++++++++++++++ .../dists/planck/cdf/benchmark/benchmark.js | 79 ++++++++ .../stats/base/dists/planck/cdf/docs/repl.txt | 64 +++++++ .../dists/planck/cdf/docs/types/index.d.ts | 114 ++++++++++++ .../base/dists/planck/cdf/docs/types/test.ts | 98 ++++++++++ .../base/dists/planck/cdf/examples/index.js | 33 ++++ .../base/dists/planck/cdf/lib/factory.js | 80 +++++++++ .../stats/base/dists/planck/cdf/lib/index.js | 57 ++++++ .../stats/base/dists/planck/cdf/lib/main.js | 79 ++++++++ .../stats/base/dists/planck/cdf/package.json | 68 +++++++ .../test/fixtures/python/large_lambda.json | 1 + .../planck/cdf/test/fixtures/python/runner.py | 87 +++++++++ .../test/fixtures/python/small_lambda.json | 1 + .../base/dists/planck/cdf/test/test.cdf.js | 133 ++++++++++++++ .../dists/planck/cdf/test/test.factory.js | 169 ++++++++++++++++++ .../stats/base/dists/planck/cdf/test/test.js | 38 ++++ 16 files changed, 1240 insertions(+) create mode 100644 lib/node_modules/@stdlib/stats/base/dists/planck/cdf/README.md create mode 100644 lib/node_modules/@stdlib/stats/base/dists/planck/cdf/benchmark/benchmark.js create mode 100644 lib/node_modules/@stdlib/stats/base/dists/planck/cdf/docs/repl.txt create mode 100644 lib/node_modules/@stdlib/stats/base/dists/planck/cdf/docs/types/index.d.ts create mode 100644 lib/node_modules/@stdlib/stats/base/dists/planck/cdf/docs/types/test.ts create mode 100644 lib/node_modules/@stdlib/stats/base/dists/planck/cdf/examples/index.js create mode 100644 lib/node_modules/@stdlib/stats/base/dists/planck/cdf/lib/factory.js create mode 100644 lib/node_modules/@stdlib/stats/base/dists/planck/cdf/lib/index.js create mode 100644 lib/node_modules/@stdlib/stats/base/dists/planck/cdf/lib/main.js create mode 100644 lib/node_modules/@stdlib/stats/base/dists/planck/cdf/package.json create mode 100644 lib/node_modules/@stdlib/stats/base/dists/planck/cdf/test/fixtures/python/large_lambda.json create mode 100644 lib/node_modules/@stdlib/stats/base/dists/planck/cdf/test/fixtures/python/runner.py create mode 100644 lib/node_modules/@stdlib/stats/base/dists/planck/cdf/test/fixtures/python/small_lambda.json create mode 100644 lib/node_modules/@stdlib/stats/base/dists/planck/cdf/test/test.cdf.js create mode 100644 lib/node_modules/@stdlib/stats/base/dists/planck/cdf/test/test.factory.js create mode 100644 lib/node_modules/@stdlib/stats/base/dists/planck/cdf/test/test.js diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/cdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/planck/cdf/README.md new file mode 100644 index 000000000000..877f402c385b --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/cdf/README.md @@ -0,0 +1,139 @@ + + +# Cumulative Distribution Function + +> Planck (discrete exponential) distribution [cumulative distribution function][cdf]. + +
+ +The [cumulative distribution function][cdf] for a Planck random variable is + + + +```math +F(x;\lambda) = 1 - e^{-\lambda (\lfloor x \rfloor + 1)} +``` + + + +where `λ` is the shape parameter and `x` denotes the count of events in a quantized system. + +
+ + + +
+ +## Usage + +```javascript +var cdf = require( '@stdlib/stats/base/dists/planck/cdf' ); +``` + +#### cdf( x, lambda ) + +Evaluates the [cumulative distribution function][cdf] for a Planck (discrete exponential) distribution with shape parameter `lambda`. + +```javascript +var y = cdf( 2.0, 0.5 ); +// returns ~0.7769 + +y = cdf( 2.0, 1.5 ); +// returns ~0.9889 +``` + +If provided `NaN` as any argument, the function returns `NaN`. + +```javascript +var y = cdf( NaN, 0.5 ); +// returns NaN + +y = cdf( 0.0, NaN ); +// returns NaN +``` + +If provided a shape parameter `lambda` which is nonpositive, the function returns `NaN`. + +```javascript +var y = cdf( 2.0, -1.0 ); +// returns NaN +``` + +#### cdf.factory( lambda ) + +Returns a function for evaluating the [cumulative distribution function][cdf] of a Planck (discrete exponential) distribution with shape parameter `lambda`. + +```javascript +var mycdf = cdf.factory( 1.5 ); +var y = mycdf( 3.0 ); +// returns ~0.9975 + +y = mycdf( 1.0 ); +// returns ~0.9502 +``` + +
+ + + +
+ +## Examples + + + +```javascript +var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var cdf = require( '@stdlib/stats/base/dists/planck/cdf' ); + +var x = discreteUniform( 10, 0, 5 ); +var lambda = uniform( 10, 0.1, 5.0 ); + +var y; +var i; +for ( i = 0; i < lambda.length; i++ ) { + y = cdf( x[ i ], lambda[ i ] ); + console.log( 'x: %d, λ: %d, F(x;λ): %d', x[ i ].toFixed( 4 ), lambda[ i ].toFixed( 4 ), y.toFixed( 4 ) ); +} +``` + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/cdf/benchmark/benchmark.js b/lib/node_modules/@stdlib/stats/base/dists/planck/cdf/benchmark/benchmark.js new file mode 100644 index 000000000000..75dbb71c9dff --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/cdf/benchmark/benchmark.js @@ -0,0 +1,79 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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 discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pkg = require( './../package.json' ).name; +var cdf = require( './../lib' ); + + +// MAIN // + +bench( pkg, function benchmark( b ) { + var lambda; + var x; + var y; + var i; + + x = discreteUniform( 100, 0, 40 ); + lambda = uniform( 100, 0.1, 10.0 ); + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + y = cdf( x[ i % x.length ], lambda[ i % lambda.length ] ); + 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(); +}); + +bench( pkg+':factory', function benchmark( b ) { + var mycdf; + var x; + var y; + var i; + + x = discreteUniform( 100, 0, 40 ); + mycdf = cdf.factory( 0.3 ); + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + y = mycdf( x[ i % x.length ] ); + 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/planck/cdf/docs/repl.txt b/lib/node_modules/@stdlib/stats/base/dists/planck/cdf/docs/repl.txt new file mode 100644 index 000000000000..488d8f043a1d --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/cdf/docs/repl.txt @@ -0,0 +1,64 @@ + +{{alias}}( x, λ ) + Evaluates the cumulative distribution function (CDF) for a Planck + distribution with shape parameter `λ` at a value `x`. + + If provided `NaN` as any argument, the function returns `NaN`. + + If `λ <= 0`, the function returns `NaN`. + + Parameters + ---------- + x: number + Input value. + + λ: number + Shape parameter. + + Returns + ------- + out: number + Evaluated CDF. + + Examples + -------- + > var y = {{alias}}( 2.0, 0.5 ) + ~0.7769 + > y = {{alias}}( 2.0, 1.5 ) + ~0.9889 + > y = {{alias}}( -1.0, 4.0 ) + 0.0 + > y = {{alias}}( NaN, 0.5 ) + NaN + > y = {{alias}}( 0.0, NaN ) + NaN + // Invalid shape parameter + > y = {{alias}}( 2.0, -1.4 ) + NaN + + +{{alias}}.factory( λ ) + Returns a function for evaluating the cumulative distribution function (CDF) + of a Planck distribution with shape parameter `λ`. + + Parameters + ---------- + λ: number + Shape parameter. + + Returns + ------- + cdf: Function + Cumulative distribution function (CDF). + + Examples + -------- + > var mycdf = {{alias}}.factory( 1.5 ); + > var y = mycdf( 3.0 ) + ~0.9975 + > y = mycdf( 1.0 ) + ~0.9502 + + See Also + -------- + diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/cdf/docs/types/index.d.ts b/lib/node_modules/@stdlib/stats/base/dists/planck/cdf/docs/types/index.d.ts new file mode 100644 index 000000000000..45434167b9fa --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/cdf/docs/types/index.d.ts @@ -0,0 +1,114 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2024 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 + +/** +* Evaluates the cumulative distribution function (CDF) for a Planck distribution. +* +* @param x - input value +* @returns evaluated CDF +*/ +type Unary = ( x: number ) => number; + +/** +* Interface for the cumulative distribution function (CDF) of a Planck distribution. +*/ +interface CDF { + /** + * Evaluates the cumulative distribution function (CDF) for a Planck distribution with shape parameter `lambda` at a value `x`. + * + * ## Notes + * + * - If `lambda <= 0`, the function returns `NaN`. + * + * @param x - input value + * @param lambda - shape parameter + * @returns evaluated CDF + * + * @example + * var y = cdf( 2.0, 0.5 ); + * // returns ~0.7769 + * + * @example + * var y = cdf( 2.0, 1.5 ); + * // returns ~0.9889 + * + * @example + * var y = cdf( -1.0, 0.5 ); + * // returns 0.0 + * + * @example + * var y = cdf( NaN, 0.5 ); + * // returns NaN + * + * @example + * var y = cdf( 0.0, NaN ); + * // returns NaN + * + * @example + * // Invalid probability + * var y = cdf( 2.0, 1.4 ); + * // returns NaN + */ + ( x: number, lambda: number ): number; + + /** + * Returns a function for evaluating the cumulative distribution function (CDF) for a Planck distribution with shape parameter `lambda`. + * + * @param lambda - shape parameter + * @returns CDF + * + * @example + * var mycdf = cdf.factory( 1.5 ); + * var y = mycdf( 3.0 ); + * // returns ~0.9975 + * + * y = mycdf( 1.0 ); + * // returns ~0.9502 + */ + factory( lambda: number ): Unary; +} + +/** +* Planck distribution cumulative distribution function (CDF). +* +* @param x - input value +* @param lambda - shape parameter +* @returns evaluated CDF +* +* @example +* var y = cdf( 2.0, 0.5 ); +* // returns ~0.7769 +* +* y = cdf( 2.0, 1.5 ); +* // returns ~0.9889 +* +* var mycdf = cdf.factory( 1.5 ); +* y = mycdf( 3.0 ); +* // returns ~0.9975 +* +* y = mycdf( 1.0 ); +* // returns ~0.9502 +*/ +declare var cdf: CDF; + + +// EXPORTS // + +export = cdf; diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/cdf/docs/types/test.ts b/lib/node_modules/@stdlib/stats/base/dists/planck/cdf/docs/types/test.ts new file mode 100644 index 000000000000..56bc2bcb12a5 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/cdf/docs/types/test.ts @@ -0,0 +1,98 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2024 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 cdf = require( './index' ); + + +// TESTS // + +// The function returns a number... +{ + cdf( 2, 0.4 ); // $ExpectType number + cdf( 1, 0.2 ); // $ExpectType number +} + +// The compiler throws an error if the function is provided values other than two numbers... +{ + cdf( true, 0.3 ); // $ExpectError + cdf( false, 0.2 ); // $ExpectError + cdf( '5', 0.1 ); // $ExpectError + cdf( [], 0.1 ); // $ExpectError + cdf( {}, 0.4 ); // $ExpectError + cdf( ( x: number ): number => x, 0.2 ); // $ExpectError + + cdf( 1, true ); // $ExpectError + cdf( 1, false ); // $ExpectError + cdf( 2, '5' ); // $ExpectError + cdf( 3, [] ); // $ExpectError + cdf( 0, {} ); // $ExpectError + cdf( 1, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + cdf(); // $ExpectError + cdf( 2 ); // $ExpectError + cdf( 2, 0.3, 4 ); // $ExpectError +} + +// Attached to main export is a `factory` method which returns a function... +{ + cdf.factory( 0.4 ); // $ExpectType Unary +} + +// The `factory` method returns a function which returns a number... +{ + const fcn = cdf.factory( 0.4 ); + fcn( 1 ); // $ExpectType number +} + +// The compiler throws an error if the function returned by the `factory` method is provided an invalid argument... +{ + const fcn = cdf.factory( 0.4 ); + fcn( true ); // $ExpectError + fcn( false ); // $ExpectError + fcn( '5' ); // $ExpectError + fcn( [] ); // $ExpectError + fcn( {} ); // $ExpectError + fcn( ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function returned by the `factory` method is provided an unsupported number of arguments... +{ + const fcn = cdf.factory( 0.4 ); + fcn(); // $ExpectError + fcn( 2, 0.2 ); // $ExpectError + fcn( 2, 0.2, 1 ); // $ExpectError +} + +// The compiler throws an error if the `factory` method is provided a value other than a number... +{ + cdf.factory( true ); // $ExpectError + cdf.factory( false ); // $ExpectError + cdf.factory( '5' ); // $ExpectError + cdf.factory( [] ); // $ExpectError + cdf.factory( {} ); // $ExpectError + cdf.factory( ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the `factory` method is provided an unsupported number of arguments... +{ + cdf.factory( 0.2, 0.2 ); // $ExpectError + cdf.factory( 0.3, 0.4, 8 ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/cdf/examples/index.js b/lib/node_modules/@stdlib/stats/base/dists/planck/cdf/examples/index.js new file mode 100644 index 000000000000..9dbb7e66c788 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/cdf/examples/index.js @@ -0,0 +1,33 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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 discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var cdf = require( './../lib' ); + +var x = discreteUniform( 10, 0, 5 ); +var lambda = uniform( 10, 0.1, 5.0 ); + +var y; +var i; +for ( i = 0; i < lambda.length; i++ ) { + y = cdf( x[ i ], lambda[ i ] ); + console.log( 'x: %d, λ: %d, F(x;λ): %d', x[ i ].toFixed( 4 ), lambda[ i ].toFixed( 4 ), y.toFixed( 4 ) ); +} diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/cdf/lib/factory.js b/lib/node_modules/@stdlib/stats/base/dists/planck/cdf/lib/factory.js new file mode 100644 index 000000000000..a4a41872fd5a --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/cdf/lib/factory.js @@ -0,0 +1,80 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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 constantFunction = require( '@stdlib/utils/constant-function' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var expm1 = require( '@stdlib/math/base/special/expm1' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var PINF = require( '@stdlib/constants/float64/pinf' ); + + +// MAIN // + +/** +* Returns a function for evaluating the cumulative distribution function (CDF) for a Planck distribution with shape parameter `lambda`. +* +* @param {PositiveNumber} lambda - shape parameter +* @returns {Function} CDF +* +* @example +* var cdf = factory( 1.5 ); +* var y = cdf( 3.0 ); +* // returns ~0.9975 +* +* y = cdf( 1.0 ); +* // returns ~0.9502 +*/ +function factory( lambda ) { + if ( isnan( lambda ) || lambda <= 0.0 ) { + return constantFunction( NaN ); + } + return cdf; + + /** + * Evaluates the cumulative distribution function (CDF) for a Planck distribution. + * + * @private + * @param {number} x - input value + * @returns {Probability} evaluated CDF + * + * @example + * var y = cdf( 2.0 ); + * // returns + */ + function cdf( x ) { + if ( isnan( x ) ) { + return NaN; + } + if ( x < 0.0 ) { + return 0.0; + } + if ( x === PINF ) { + return 1.0; + } + return -expm1( -lambda * ( floor(x)+1.0 ) ); + } +} + + +// EXPORTS // + +module.exports = factory; diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/cdf/lib/index.js b/lib/node_modules/@stdlib/stats/base/dists/planck/cdf/lib/index.js new file mode 100644 index 000000000000..d972bbb6babe --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/cdf/lib/index.js @@ -0,0 +1,57 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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'; + +/** +* Planck distribution cumulative distribution function (CDF). +* +* @module @stdlib/stats/base/dists/planck/cdf +* +* @example +* var cdf = require( '@stdlib/stats/base/dists/planck/cdf' ); +* +* var y = cdf( 2.0, 0.5 ); +* // returns 0.875 +* +* y = cdf( 2.0, 0.1 ); +* // returns ~0.271 +* +* var mycdf = cdf.factory( 0.5 ); +* y = mycdf( 3.0 ); +* // returns 0.9375 +* +* y = mycdf( 1.0 ); +* // returns 0.75 +*/ + +// MODULES // + +var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); +var main = require( './main.js' ); +var factory = require( './factory.js' ); + + +// MAIN // + +setReadOnly( main, 'factory', factory ); + + +// EXPORTS // + +module.exports = main; diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/cdf/lib/main.js b/lib/node_modules/@stdlib/stats/base/dists/planck/cdf/lib/main.js new file mode 100644 index 000000000000..ad907138eb17 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/cdf/lib/main.js @@ -0,0 +1,79 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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 expm1 = require( '@stdlib/math/base/special/expm1' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var PINF = require( '@stdlib/constants/float64/pinf' ); + + +// MAIN // + +/** +* Evaluates the cumulative distribution function (CDF) for a Planck distribution with shape parameter `lambda` at a value `x`. +* +* @param {number} x - input value +* @param {PositiveNumber} lambda - shape parameter +* @returns {Probability} evaluated CDF +* +* @example +* var y = cdf( 2.0, 0.5 ); +* // returns ~0.7769 +* +* @example +* var y = cdf( 2.0, 1.5 ); +* // returns ~0.9889 +* +* @example +* var y = cdf( -1.0, 0.5 ); +* // returns 0.0 +* +* @example +* var y = cdf( NaN, 0.5 ); +* // returns NaN +* +* @example +* var y = cdf( 0.0, NaN ); +* // returns NaN +* +* @example +* // Invalid shape parameter +* var y = cdf( 2.0, -1.4 ); +* // returns NaN +*/ +function cdf( x, lambda ) { + if ( isnan( x ) || isnan( lambda ) || lambda <= 0.0 ) { + return NaN; + } + if ( x < 0.0 ) { + return 0.0; + } + if ( x === PINF ) { + return 1.0; + } + return -expm1( -lambda * ( floor(x)+1.0 ) ); +} + + +// EXPORTS // + +module.exports = cdf; diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/cdf/package.json b/lib/node_modules/@stdlib/stats/base/dists/planck/cdf/package.json new file mode 100644 index 000000000000..81a6efca8c61 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/cdf/package.json @@ -0,0 +1,68 @@ +{ + "name": "@stdlib/stats/base/dists/planck/cdf", + "version": "0.0.0", + "description": "Planck (discrete exponential) distribution cumulative distribution function (CDF).", + "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", + "probability", + "cdf", + "cumulative distribution", + "distribution function", + "memoryless", + "life-time", + "discrete", + "planck", + "univariate" + ] +} diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/cdf/test/fixtures/python/large_lambda.json b/lib/node_modules/@stdlib/stats/base/dists/planck/cdf/test/fixtures/python/large_lambda.json new file mode 100644 index 000000000000..d1ccdeafd008 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/cdf/test/fixtures/python/large_lambda.json @@ -0,0 +1 @@ +{"x": [3.0, 4.0, 6.0, 7.0, 9.0, 5.0, 10.0, 5.0, 5.0, 2.0, 0.0, 6.0, 5.0, 7.0, 4.0, 0.0, 6.0, 10.0, 6.0, 5.0, 8.0, 10.0, 2.0, 7.0, 5.0, 7.0, 3.0, 9.0, 3.0, 4.0, 1.0, 3.0, 8.0, 3.0, 6.0, 6.0, 4.0, 6.0, 4.0, 0.0, 1.0, 9.0, 5.0, 4.0, 2.0, 3.0, 5.0, 9.0, 9.0, 6.0, 2.0, 0.0, 7.0, 5.0, 8.0, 1.0, 4.0, 10.0, 1.0, 0.0, 4.0, 1.0, 2.0, 6.0, 3.0, 6.0, 9.0, 9.0, 9.0, 5.0, 4.0, 9.0, 6.0, 5.0, 6.0, 1.0, 1.0, 3.0, 1.0, 5.0, 8.0, 9.0, 2.0, 3.0, 4.0, 8.0, 8.0, 3.0, 8.0, 9.0, 1.0, 7.0, 5.0, 6.0, 2.0, 4.0, 5.0, 2.0, 8.0, 7.0, 0.0, 6.0, 9.0, 2.0, 9.0, 7.0, 8.0, 4.0, 7.0, 9.0, 5.0, 9.0, 4.0, 2.0,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9.0, 4.0, 7.0, 2.0, 7.0, 10.0, 5.0, 2.0, 9.0, 2.0, 2.0, 6.0, 7.0, 6.0, 8.0, 9.0, 1.0, 5.0, 2.0, 5.0, 5.0, 7.0, 2.0, 9.0, 6.0, 8.0, 7.0, 5.0, 4.0, 2.0, 8.0, 7.0, 3.0, 3.0, 6.0, 10.0, 9.0, 6.0, 1.0, 9.0, 8.0, 6.0, 5.0, 2.0, 9.0, 6.0, 2.0, 9.0, 6.0, 8.0, 1.0, 3.0, 0.0, 5.0, 5.0, 3.0, 6.0, 2.0, 5.0, 5.0, 6.0, 2.0, 8.0, 7.0, 6.0, 5.0, 10.0], "lambda": [10.771843364264186, 18.201842813142164, 10.413908226020451, 19.82869390498318, 18.277344178734065, 19.940274147012538, 11.292623008075157, 12.889880987032386, 19.785068114135473, 11.911566045137832, 19.694679664035093, 15.612104029965906, 12.935969128799144, 14.802611343035174, 19.025884524369573, 16.95918736398758, 17.55285396201343, 19.95790591712703, 13.172493913638199, 16.824436462336287, 14.3084509161729, 18.375297085545558, 15.648202883022211, 18.401383501576476, 11.316122770678172, 19.03408795220699, 16.422394116168896, 18.358399358751363, 18.945732582097296, 16.32552039008385, 16.716605879650132, 17.93467373763363, 10.7453679578222, 12.6724183973889, 16.239961524834875, 16.313791660160533, 10.791914138978694, 14.034562006710985, 12.893683192364513, 16.824924587042076, 13.864235969802916, 18.233991623799547, 10.671456565143288, 14.201560291003037, 14.459841591651937, 13.104183240732294, 11.323261460450501, 13.198366540389511, 18.659312915602353, 18.757433515829668, 16.349561188690107, 19.45002909585438, 13.275011383277677, 13.05709467749751, 14.152016450370239, 11.896949380612327, 15.503024159170629, 16.050024810611742, 11.78242542784951, 12.989835184883162, 19.44568472298582, 17.23050669992004, 15.341326885207026, 16.605281389793703, 16.327502256226094, 18.582889569927158, 11.425818170561636, 11.101233274214175, 12.379072513730621, 10.216418125090915, 17.384560497627422, 18.257471265357374, 15.913826525769974, 14.660555795964036, 16.11579821456469, 15.720607449394018, 19.79535722162783, 17.318082840326568, 13.889729417238485, 18.35930484757563, 16.094629360567225, 11.293596370939607, 15.027405415488428, 16.148377379774576, 11.695947421818726, 16.053001097903028, 16.63349033180082, 18.98807787844704, 14.106094463043185, 10.986217445572374, 14.799173539443682, 10.53086148602457, 12.092156295772547, 13.012532579383235, 19.92728795477266, 16.821158430966207, 18.086638094901865, 11.427981192566778, 10.382404186857379, 12.744979543405577, 14.802571106324823, 16.021934571078127, 18.393761998286465, 16.748457201932265, 13.646249718827477, 18.059171591438343, 11.295734992473609, 13.087913789726922, 15.129819990660142, 11.27737168510996, 17.016867396147155, 14.874250884004866, 18.908030425128892, 17.17535007769611, 15.258314309790391, 19.303713737472254, 14.857386770949361, 10.939947836338726, 18.81118220401344, 19.889846388422793, 12.647807761762007, 10.803573044950575, 13.381929923713464, 17.7752972386146, 17.79174595111757, 12.551572371608602, 11.23908260460442, 16.89960135854541, 13.048871836606665, 10.595964022847578, 11.436613903849054, 12.745774813017707, 19.208209110943905, 17.56297484082184, 10.68465889391571, 12.352696595278765, 11.61660088186846, 17.906185297873222, 15.996722550853043, 18.843007172182144, 17.737895782291147, 19.438381920789332, 12.636129645679391, 16.398887803992537, 15.607471291018037, 10.62558496143221, 12.744708103650861, 16.585855459558807, 15.077298024984882, 17.429274814854445, 18.66234946142622, 17.076997893039575, 18.425533132255605, 10.684527855482731, 11.240959670336476, 17.23782638137731, 19.54787995723597, 19.703510635528396, 10.128356327097803, 13.572941803840871, 19.365635725634718, 19.152528746961273, 12.997558501347813, 11.527161681699894, 18.197032304100745, 19.632312723496703, 14.542472266866199, 15.384527347076641, 17.306261184396014, 18.420652285852654, 10.175934870491151, 16.80423645011439, 16.18148892888188, 10.920981103551526, 19.092282457476834, 15.712033870154585, 18.771848515027123, 13.078857509272236, 10.00371199242803, 16.14962876802154, 16.611939137028706, 18.691528362813795, 16.173924726752084, 16.380014360761102, 11.025286085182222, 18.811579023499487, 15.380096351840967, 15.918807972029477, 15.203139521995855, 14.190953043192662, 15.166255016897228, 13.405210896774882, 15.139357257036062, 17.187044195690454, 13.675417091123219, 12.7381594379371, 13.44211808450556, 18.834912931465254, 10.368052738868125, 11.001478323564701, 16.570950471091194, 13.659991720206008, 15.094343733087625, 17.47106527669035, 13.342155917917431, 14.293163210556108, 11.428675596257902, 13.249945580616544, 10.298954922248745, 19.098082490254765, 15.062116738923862, 13.786317371474208, 18.304994958020536, 13.588323322040672, 11.07164233407941, 19.728196804697756, 13.429601231675019, 15.340287629512373, 12.424837362705377, 17.770656384054618, 16.11790463491821, 18.628636065935083, 13.160037843545332, 16.253998163053357, 19.236870829224312, 15.4222069843997, 17.91688537411396, 17.043890937139643, 13.215303576275335, 10.836105651681663, 12.276116805496535, 16.11966073695207, 10.509844178160341, 12.052583422509574, 15.991945134595326, 18.558261114069566, 17.569156469821262, 18.798210407516905, 13.315606143030244, 13.265966535958206, 19.190291306304246, 13.353147428109924, 16.62448196451471, 12.198029003961711, 13.671736050139367, 14.984900559241861, 16.624503708845936, 18.08042437160001, 14.200507039220675, 15.001995042520115, 16.258163514695987, 18.587175399925652, 19.05096325263964, 13.388105888240643, 16.833011366670082, 13.528100965635232, 17.448384779652528, 12.944676013980914, 12.253931687646062, 18.327600086067754, 11.93020531329752, 18.06562803196333, 13.554819630663797, 14.897137685304216, 15.29225787651431, 19.709990501993524, 13.48397638652639, 10.499131971193497, 15.433236684805365, 11.997566587155509, 10.440329599854106, 11.299037870277562, 17.178871171207597, 10.859782391026462, 17.675242933719865, 13.523663425766063, 16.523323689005018, 10.007383151448204, 15.14663249969935, 10.70271853894187, 19.697427867939382, 11.50219068741338, 17.549552791253348, 12.200861234688011, 14.013629751997765, 18.908025466172795, 14.907272735231189, 11.539045738598192, 13.455622830902517, 18.127718662544584, 19.924514369186923, 12.509417393379266, 12.904640687513016, 15.125920969232007, 15.997285635932506, 12.192094201366267, 14.645359765211328, 17.85545842510052, 12.707837512130638, 18.39352636678366, 10.348341849826124, 14.605048961321778, 12.824167690130077, 14.611720364805752, 13.071344835615648, 15.029274342201726, 10.875398379153204, 18.698529950954303, 16.216586944758358, 11.362890433960137, 11.573219280751536, 10.902644632070386, 16.45885590495398, 14.060819734461205, 12.16820909600787, 13.19989328563667, 16.82977192178737, 11.60754677377695, 16.143496179121552, 19.896035197017994, 16.470012356003956, 15.1097203348662, 16.353111227827235, 12.382711699632976, 17.26230459995027, 17.436002975586746, 13.905925996490094, 16.23909371287246, 15.793194723218608, 10.078219608602582, 14.040919549726134, 19.909196189906204, 14.982297497861722, 15.743307892094137, 10.015100373097347, 12.065902606507597, 11.662721193060262, 17.342823783080714, 13.768347450126157, 15.25153159516887, 12.093987602219642, 11.707384810361127, 11.500059580806084, 16.910108533032655, 11.999962136678242, 19.402040222547754, 11.979057095209981, 17.48654625004187, 12.28125824637698, 13.2038280985068, 12.043639567835092, 17.601876264389723, 15.938124513529246, 11.958403264075033, 10.51814808615931, 12.840826646955781, 16.87017708003152, 14.901090611759582, 15.442185014005025, 11.61687932012107, 14.41145273615099, 11.239353919318981, 18.938928627815912, 11.346351734454815, 16.29778772542921, 11.062481863845354, 13.776475973471065, 13.320501547994901, 19.181896229802035, 11.531171416730656, 14.65669599200599, 13.923722862098742, 12.71678969711244, 11.168502702818019, 13.273031033426804, 17.68221153844433, 10.274710652757763, 16.57295482236737, 17.693681714065832, 17.368947883812876, 10.842646557817812, 17.815123015238203, 13.789653121151566, 13.307212133375206, 16.77194630487071, 13.127487444271257, 12.623127123095841, 18.00536674733408, 15.890235054684018, 10.447712456653033, 17.326227209816757, 14.339146362616583, 10.275987866314525, 11.58781309773985, 18.230237098819035, 18.523378991966826, 18.777136500067318, 12.802965571682865, 13.168227898975353, 14.186701542077865, 10.783152747722978, 17.596064904536536, 19.521642662921767, 13.344095257906538, 14.375832338694593, 13.152032679567382, 16.54116401417117, 14.086428536480371, 15.54089699220792, 13.418753861817192, 10.118476075887394, 18.40828829533023, 18.18689814965758, 18.40755308921719, 12.910360907677141, 16.076280111161136, 14.710246812010965, 10.58152983394005, 10.805775744166432, 14.902785865186878, 11.47171384311627, 18.248347424472918, 18.00938444622504, 10.379575742458732, 15.439280582973362, 10.906558106075458, 12.491748196315875, 15.232414472713305, 15.460280216460795, 17.67382300912474, 10.713246786784236, 12.013031073984557, 15.94986448157491, 17.520225946739988, 19.331717632574822, 14.785842184735571, 11.853019713932552, 19.762850822992373, 15.876654489261641, 18.15204743706646, 12.939611167143704, 14.989539408496299, 15.663496872100515, 16.830742822343872, 11.003438633645766, 13.649746981650235, 18.571197380233762, 18.32608849047522, 17.58533060482889, 17.85378076221383, 13.668545579372616, 10.535540275376222, 12.778535319223062, 11.707782177391376, 18.671966765479457, 16.388498798103726, 14.160538649181706, 13.709618748207076, 12.142266326798111, 19.356534906489387, 14.919289697259451, 19.296827038443944, 14.945168235850433, 12.335512584876701, 15.647032418651278, 12.98462625979131, 19.593619750685463, 19.908663228366663, 17.902806782114617, 11.513199799949026, 15.4243790272361, 17.705606167930203, 16.232294127529457, 17.985514014794937, 18.888380372457526, 14.250171065478815, 14.803382656060363, 15.911687439891185, 11.294318142608674, 13.129572589329513, 17.292631599200664, 12.902054005208008, 16.750467833203217, 19.097079386849185, 15.28300205995436, 13.335435685385464, 19.440819360435057, 13.14806104176795, 14.264758019968262, 10.388386186450848, 11.695519706096828, 15.364133669095436, 16.460674135163437, 18.371754429120642, 13.511731634405866, 14.648122599398274, 12.206880920596326, 19.32594116530752, 12.045231745538432, 12.659843787938, 14.791047716968372, 18.00050386349662, 17.96287808609552, 15.198456074155505, 16.654998136364995, 15.41791658675891, 16.809426244049497, 14.431776715647539, 12.851446671069445, 13.09823877967111, 15.100174739051855, 15.044545374092458, 17.68351225593839, 16.418162498428597, 15.387505821510857, 15.07713544110478, 15.941808333807934, 10.195924874799593, 11.291608359419854, 13.858566307415336, 15.224126594987451, 10.536020184650353, 18.746669346646755, 11.712280432393166, 11.190236498575715, 15.50216417549257, 19.205875180305902, 18.973211496927156, 16.383887840325727, 18.18394254511881, 18.09388127776478, 13.312166163316135, 12.155605314620356, 19.45652044096538, 12.427771893654636, 12.06476610980286, 15.019288184457249, 18.065203224612763, 15.154617119631473, 13.721988756994792, 19.537125668098877, 15.592488053067857, 12.247378931072216, 11.235942116320873, 18.53300356010383, 19.927581244761704, 18.004171841397095, 14.800312613237216, 12.750152005704527, 16.105753797846933, 17.738521028037518, 17.446092737586408, 11.58880995294216, 18.215955949945275, 13.89945221307675, 13.216966639951806, 12.769108080314584, 18.0182004538246, 13.596761929350942, 18.696050328307354, 10.523698719455515, 12.897367839472974, 19.065692234459462, 10.202745678817017, 17.001222537077282, 15.270571414624406, 10.2511050956983, 13.669258316247348, 18.613285781462665, 13.14124448804166, 15.630462975734442, 15.727164240321244, 17.470470366377977, 19.0693251485298, 16.176690867739126, 13.517622507659812, 19.669775184135858, 12.643751574628592, 15.206547264112798, 17.391534381100445, 11.224253718533138, 17.438608108257082, 13.637924622452086, 13.71134991190132, 14.774596289095182, 18.57146287170093, 10.577784629030498, 16.268327156443938, 17.013565139257114, 19.661770570724027, 17.69560006808516, 14.348854420466264, 19.50469983352297, 15.172627250233273, 16.91935593510517, 18.705619998457777, 17.935450230934247, 16.68111840858873, 18.301512732854853, 17.807405608323712, 14.138490373047333, 12.705596479745955, 17.684677754268584, 14.69750371313817, 12.403149371658474, 15.238112693164005, 11.454503186170836, 12.63534597347424, 15.694008571448528, 11.292100172001842, 15.1337684094526, 11.057479656210301, 17.0701259524593, 19.451088025759667, 18.329105093366874, 12.543195840555057, 13.59092355521327, 16.029940889623955, 10.141672835981472, 16.554254324917455, 14.719718908442179, 17.18923095567372, 11.34629299401371, 14.608115791933798, 16.880617019702193, 17.949792353065657, 10.560101663380067, 16.47153563409764, 14.488915850470786, 11.177164978328511, 16.30857689119341, 17.86648605497536, 17.860144476179308, 12.139707820976335, 15.079216889488226, 16.057396385664944, 12.166883719641323, 19.171535917365986, 17.90755225142211, 15.798671614945263, 16.655111841700432, 16.027471703878923, 18.326032599911294, 19.66275768919392, 12.189348651110535, 19.833035728947536, 11.211453623964333, 18.63513622526137, 16.857857222391466, 19.033881096246446, 13.389427626132381, 10.232552161095658, 11.610762894781296, 17.299117792021477, 12.983434684012032, 19.481317910244016, 11.16279474613166, 14.788366512090072, 15.963122301821029, 16.432798891804445, 16.084929410232693, 18.79182004494927, 17.436020268964672, 12.82219430204519, 13.569403950843508, 11.474354442002495, 11.756282353723943, 10.89978756196154, 10.049226193990226, 12.729787580694984, 19.95022885856045, 11.416300769039257, 11.378712151599519, 15.869474204662579, 11.370363894136531, 10.409929827158825, 16.536929423505285, 18.283303541937407, 19.636904565847352, 12.352042890619037, 16.74613112007181, 18.229640607021484, 16.19421456238034, 11.407603523542873, 15.746469479208738, 11.35093273857304, 13.365638566243401, 12.047750096475808, 15.229538594728004, 15.551999601381961, 15.106806223523794, 12.735299094438227, 11.501776560646404, 18.864091573717197, 14.427079103328808, 14.057174220873, 18.912318609743316, 13.902015798645447, 19.955037027333017, 15.202566352579673, 12.124261522496713, 11.172024925262974, 10.25152067037077, 17.972701476945797, 16.437594996947844, 15.556520791208182, 14.218887967476192, 15.30271360186827, 19.73219401465119, 19.921430966833853, 10.847007180548134, 10.18218245824685, 17.051271826708568, 18.84204437179031, 19.67092286373721, 17.764039305107104, 11.65777735666838, 12.376951257320925, 11.21628990664757, 14.178384789429572, 15.374943837111521, 18.54051207464319, 19.73709316686947, 14.991237178157808, 16.391701112463195, 12.614770419253365, 14.464476229969014, 18.05769791571972, 16.349090523516892, 11.29669661336052, 10.23807755660243, 16.47114373937653, 14.167393063870456, 14.670758584867404, 18.055843933098586, 18.551017178911664, 19.210302964009422, 13.222019514337287, 11.379417361025618, 10.496946596986799, 14.477603334581877, 14.82350899642702, 19.725776773933283, 15.487379520520062, 18.965858512303846, 13.60592705914942, 16.653772379894566, 18.034038560478045, 12.258834182052562, 19.594104745900907, 12.16226249155379, 13.303163816431262, 14.113866626798027, 11.271074435920488, 10.86243563145985, 14.723381043390528, 18.495025516203313, 11.07361169507926, 12.462878634520855, 16.25892605954168, 11.738628090489364, 11.227443643431256, 18.670799595113987, 19.70411880147605, 19.603237608328897, 11.592088511399915, 14.493616184585726, 12.593669899469013, 10.85352921118517, 15.761282040603087, 15.230710855955788, 10.079562091246048, 15.153193184381877, 12.049442636121608, 15.47269370797982, 19.949329519744506, 18.884428562642658, 14.762599573805506, 19.191329174926185, 11.009760491208816, 17.343091381974762, 15.25200184352849, 15.698240488969173, 14.908419188913896, 17.608033715373466, 19.556995755744676, 10.878688856430204, 18.482807640304227, 16.640402114639045, 16.242007879534626, 16.32088538881341, 14.561502795280084, 14.624240962642862, 17.43584736217403, 15.860744738546863, 19.196066692380484, 13.428003582068964, 14.968253218175668, 14.5833404743823, 18.313322689465096, 17.896161042942566, 16.238410682069212, 18.15363620522406, 11.318269951623428, 14.832563823751542, 18.022189100102832, 10.547112686399128, 16.09347362086468, 12.288083428968875, 14.990456043352903, 19.209982394712963, 19.350185921370198, 10.55132030365461, 14.806437659494351, 14.426409489738933, 11.247961824625836, 10.869793683209284, 18.53296368204233, 11.239587338322286, 10.013412357169472, 14.57334755252969, 17.692031260197716, 10.608338455899851, 12.28506618070787, 14.341860781112482, 17.637025826322894, 17.308354541947047, 15.330004318547575, 18.334410059764743, 17.764845444862107, 16.660739690179792, 15.019454664441996, 11.120660082715915, 17.669945448580744, 17.229793424040317, 11.09685729704006, 11.154361474096955, 15.805804136934961, 16.98094589145385, 18.51781450688714, 17.646322394288486, 16.020217862510915, 17.577939784704313, 15.356485318913993, 13.824696709089528, 10.955980539622207, 14.388370382355614, 13.319287314399306, 15.996351789906633, 17.108381859079383, 18.15013699801593, 15.575788484743098, 18.187706406364235, 17.093573398442803, 19.897457064435866, 13.223130911877682, 18.945985287587444, 17.75829498059752, 19.23912541635724, 19.53627164484648, 13.537211255587216, 10.17309158473729, 18.232643867430447, 12.874096047441647, 18.392756120951404, 19.232629121992517, 16.028468977234173, 16.09317659042584, 11.4654718843911, 17.26782662605968, 18.762728794772705, 19.359999026596547, 15.624099779787077, 15.00689391035446, 16.705187251271774, 19.392088943083806, 11.500793850152057, 15.008604439128014, 12.074116034326039, 16.43029710317976, 12.3374954004104, 18.410392111884185, 10.838367146400671, 13.8623216453628, 17.037597585168527, 12.049903477778749, 17.82722699494682, 14.688423350154046, 17.51183426910678, 18.734975287601117, 15.950001391857764, 13.677702881800098, 14.07071101005328, 19.930721905669877, 13.18272649517414, 10.988622477187805, 17.264704780337773, 16.539398052213464, 15.50682284081396, 17.777511770243432, 18.44650116050018, 17.078070530775236, 10.551011624938408, 10.559657804361018, 13.639360380972658, 16.487710530763295, 12.180659202826643, 19.816106482037547, 12.237218201232633, 10.548912110286489, 19.737645208381906, 19.588808301929877, 13.32399291156397, 12.128722289880098, 10.641149290292573, 11.435902474430819, 16.24084516273801, 17.388358313007277, 12.171639001460672, 18.064322705580224, 12.736770778363688, 15.8082168781182, 17.427370302292825, 11.097883338314773, 10.241765555517867, 15.437817520102193, 16.564566270429786, 19.198822412384615, 10.267881307982515, 17.32169271462246, 18.685930431326923, 18.543911666521698, 11.671896875125597, 15.370104909284906, 17.85879693195116, 17.500234130299027, 15.05800665608195, 10.405734877247998, 12.764743584599703, 13.052621623050719, 17.922997928969696, 10.387330857263557, 19.103819703053595, 19.7482186738662, 13.266877581719974, 16.010019719022416, 12.262874501301358, 10.455860428365408, 14.831890623642764, 18.881971728165183, 14.757640956739452, 15.966704630167428, 10.314798543111014, 13.410646448756754, 12.30269176928023, 13.982876749963062, 12.935841659683192, 11.457577314712337, 19.356661740167645, 16.0735526129492, 17.57409669827497, 11.320986072987495, 13.163375944542764, 18.577603666790473, 14.626193106408163, 11.859063082607195, 14.003841095955702, 14.844603283574015, 15.8885852267279, 19.554518264118066, 18.706802564514845, 18.112780274956435, 17.882967531906026, 11.526041880224307, 15.931592224381646, 17.79011491201384, 10.429670034001399, 14.757102153798304, 11.088822684137916, 16.12049210626435, 10.91230976150668, 16.563609394932918, 14.38967829600174, 14.210377734626569, 18.80099945082004, 14.208106364223976, 19.769811609669123, 13.857735484201765, 11.254835518691987, 10.823844718734968, 14.12763546816283, 10.211333954699295, 13.543476218967776, 11.302688095387376, 13.594362302208479, 16.55123183770432, 11.62600475548187, 15.385162363061758, 10.722986142983181, 13.622169854251913], "expected": [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999999999999997, 0.9999999972028916, 1.0, 1.0, 1.0, 1.0, 0.9999999568760524, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.999999999999997, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999999506794293, 0.9999999999990928, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999999964276032, 1.0, 1.0, 1.0, 0.9999999999536082, 1.0, 1.0, 0.9999999999416669, 0.9999977165775933, 1.0, 0.9999999999999989, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999999999999779, 1.0, 1.0, 0.9999999999991379, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999999999998602, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999999999999987, 1.0, 1.0, 0.9999996273294705, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999999996854555, 1.0, 1.0, 1.0, 0.9999999999999916, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.999999999991505, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999998870953919, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999999999999999, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999999984055112, 1.0, 0.9999999961130293, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999999999999974, 0.999999906142572, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999999979540917, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999999997348094, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999983946293892, 1.0, 1.0, 1.0, 0.9999999988664481, 1.0, 1.0, 0.9999999999989398, 1.0, 1.0, 1.0, 1.0, 0.9999999999978363, 1.0, 0.9999999999838592, 0.9999999999999997, 1.0, 1.0, 0.9999999999962903, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999999999999923, 1.0, 1.0, 1.0, 0.9999999999660172, 0.9999998865547091, 1.0, 1.0, 1.0, 1.0, 0.9999999999969986, 0.9999999953680658, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999996947073593, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999999735599195, 1.0, 1.0, 0.9999999999999999, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999999999999998, 0.9999999991456321, 1.0, 1.0, 1.0, 1.0, 0.9999999999982073, 1.0, 0.9999999979690584, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999999999998873, 0.9999999999050899, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999998871589489, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999999999927378, 1.0, 1.0, 1.0, 0.9999999999999932, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999992175374182, 1.0, 1.0, 1.0, 0.9999999999999992, 1.0, 1.0, 1.0, 0.9999999999999248, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999999999999993, 0.9999999999999991, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999999999999998, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999999998271691, 1.0, 1.0, 1.0, 0.9999999999999961, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999999999999972, 1.0, 0.9999999999999996, 1.0, 1.0, 0.9999999793113731, 1.0, 0.9999999996178826, 1.0, 1.0, 0.9999999999972362, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.999999999999524, 1.0, 0.9999999771899567, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999999999977889, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999996628661705, 0.9999999999999989, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.999999999505015, 0.9999999999999998, 1.0, 1.0, 1.0, 1.0, 0.9999999999493479, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999999890078943, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999999999998955, 0.9999999999999999, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.999999999999999, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999999999999994, 0.9999997874595831, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999997168065039, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999861916420223, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999959942186132, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.999999830851372, 0.999995202324034, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999999999991546, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999999999986602, 1.0, 1.0, 0.9999999999999735, 1.0, 0.9999999999999993, 1.0, 1.0, 0.9999999999981856, 1.0, 1.0, 1.0, 0.9999999720132424, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999999999999999, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999999924794006, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999999999999983, 1.0, 1.0, 1.0, 0.9999999999999826, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999999999999999, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999999999999991, 1.0, 1.0, 1.0, 1.0, 0.9999999999999863, 1.0, 1.0, 1.0, 1.0, 0.999999999992709, 1.0, 1.0, 0.9999999999999996, 0.9999999996591488, 1.0, 1.0, 1.0, 1.0, 0.9999999998692095, 1.0, 1.0, 0.9999999990920753, 1.0, 1.0, 0.9999999970365289, 0.9999956790829175, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999999998617373, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999990828692576, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999999999999947, 1.0, 0.9999999999995537, 1.0, 1.0, 1.0, 1.0, 0.9999999999999458, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999999999999999, 1.0, 1.0, 0.9999885716947247, 0.9999999999999789, 1.0, 0.9999999999998668, 1.0, 1.0, 1.0, 0.9999999999984793, 1.0, 1.0, 1.0, 1.0, 0.9999999999727106, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999999999999999, 0.9999999997592407, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999999999997423, 1.0, 0.9999999999999928, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999999999999768, 0.9999996647600151, 1.0, 1.0, 1.0, 0.9999999999999999, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999999999999997, 1.0, 0.9999999999999998, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999999960525101, 0.9999999999999821, 1.0, 1.0, 1.0, 0.9999809757044635, 1.0, 1.0, 0.9999999979934012, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999999997808622, 1.0, 1.0, 0.9999999997701777, 1.0, 0.9999999999999813, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999999940862476, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999999999999989, 1.0, 1.0, 1.0, 0.9999999999999731, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999999999999998, 0.9999999999999947, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999999999658346, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999981171547515, 0.9999999997146329, 1.0, 0.9999999999999957, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.999999999999982, 1.0, 1.0, 1.0, 1.0, 0.9999999999999863, 0.9999891993309257, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999999999999966, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999999999999991, 1.0, 1.0, 0.9999999999999993, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9999999999999998, 1.0, 1.0, 1.0, 1.0, 0.9999999999999742, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.999999999999546, 1.0, 0.9999993246983548, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]} diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/cdf/test/fixtures/python/runner.py b/lib/node_modules/@stdlib/stats/base/dists/planck/cdf/test/fixtures/python/runner.py new file mode 100644 index 000000000000..1ad7814631ac --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/cdf/test/fixtures/python/runner.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# +# @license Apache-2.0 +# +# Copyright (c) 2024 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. + +"""Generate fixtures.""" + +import os +import json +import numpy as np +from scipy.stats import planck + +# Get the file path: +FILE = os.path.realpath(__file__) + +# Extract the directory in which this file resides: +DIR = os.path.dirname(FILE) + + +def gen(x, lam, name): + """ + Generate fixture data and write to file. + + # Arguments + + * `x`: input values. + * `lam`: shape parameter. + * `name::str`: output filename. + + # Examples + + ```python + python> x = np.random.rand(1000) * 10 + python> lam = np.random.rand(1000) + python> gen(x, lam, "data.json") + ``` + """ + # Compute CDF values: + z = np.array(planck.cdf(x, lam)) + + # Store data to be written to file as a dictionary: + data = { + "x": x.tolist(), + "lambda": lam.tolist(), + "expected": z.tolist() + } + + # Based on the script directory, create an output filepath: + filepath = os.path.join(DIR, name) + + # Write the data to the output filepath as JSON: + with open(filepath, "w", encoding='utf-8') as outfile: + json.dump(data, outfile) + + # Include trailing newline: + with open(filepath, "a", encoding='utf-8') as outfile: + outfile.write("\n") + + +def main(): + """Generate fixture data.""" + # Large shape paramter: + x = np.round(np.random.rand(1000) * 10.0) + lam = (np.random.rand(1000) * 10.0) + 10.0 + gen(x, lam, "large_lambda.json") + + # Small shape parameter: + x = np.round(np.random.rand(1000) * 10.0) + lam = np.random.rand(1000) * 0.5 + gen(x, lam, "small_lambda.json") + + +if __name__ == "__main__": + main() diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/cdf/test/fixtures/python/small_lambda.json b/lib/node_modules/@stdlib/stats/base/dists/planck/cdf/test/fixtures/python/small_lambda.json new file mode 100644 index 000000000000..6655415bfd42 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/cdf/test/fixtures/python/small_lambda.json @@ -0,0 +1 @@ +{"x": [8.0, 7.0, 6.0, 7.0, 4.0, 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.0, 10.0, 1.0, 8.0, 9.0, 9.0, 4.0, 6.0, 3.0, 2.0, 6.0, 3.0, 6.0, 2.0, 7.0, 4.0, 4.0, 10.0, 3.0, 2.0, 4.0, 0.0, 4.0, 6.0, 5.0, 9.0, 2.0, 4.0, 2.0, 6.0, 2.0, 2.0, 1.0, 9.0, 6.0, 8.0, 10.0, 7.0, 10.0, 9.0, 2.0, 9.0, 1.0, 1.0, 4.0, 9.0, 0.0, 9.0, 6.0, 4.0, 4.0, 10.0, 9.0, 7.0, 5.0, 8.0, 1.0, 7.0, 3.0, 8.0, 9.0, 8.0, 8.0, 8.0, 3.0, 8.0, 2.0, 5.0, 1.0, 1.0, 7.0, 7.0, 7.0, 8.0, 8.0, 9.0, 2.0, 7.0, 5.0, 8.0, 1.0, 2.0, 5.0, 3.0, 4.0, 4.0, 4.0, 4.0, 7.0, 8.0, 5.0, 8.0, 1.0, 7.0, 5.0, 9.0, 2.0, 2.0, 4.0, 1.0, 7.0, 2.0, 6.0, 5.0, 10.0, 9.0, 1.0, 8.0, 9.0, 9.0, 6.0, 2.0, 8.0, 4.0, 1.0, 2.0, 9.0, 6.0, 4.0, 6.0, 6.0, 6.0, 6.0, 10.0, 9.0, 2.0, 1.0, 2.0, 7.0, 7.0, 7.0, 4.0, 2.0, 5.0, 10.0, 10.0, 2.0, 10.0, 10.0, 6.0, 10.0, 7.0, 4.0, 4.0, 3.0, 7.0, 2.0, 4.0, 0.0, 2.0, 3.0, 3.0, 8.0, 6.0, 7.0, 8.0, 6.0, 6.0, 1.0, 5.0, 7.0, 5.0, 9.0, 5.0, 10.0, 9.0, 7.0, 8.0, 9.0, 9.0, 6.0, 0.0, 6.0, 2.0, 2.0, 2.0], "lambda": [0.07842686188634496, 0.17958736552724597, 0.4839286467449087, 0.4665159711765329, 0.08264412878987926, 0.2696969533086487, 0.15957184327312773, 0.44335211373965305, 0.23426154227900992, 0.061711975811249764, 0.37588079809017494, 0.46075211177949793, 0.22057669587980394, 0.07596734457112597, 0.19411518527620947, 0.20987596085220372, 0.3324392073951293, 0.3393326699110831, 0.14516483237461641, 0.012163301925520897, 0.09012760314329138, 0.3482907954819407, 0.23330536033005617, 0.3174461314572514, 0.49914175540106426, 0.32629575634314306, 0.006995776167679824, 0.3581877662096815, 0.29361387821574436, 0.1324106366256393, 0.3855790576084666, 0.2704045448621042, 0.14606021703999383, 0.0310047193297312, 0.15986411021244895, 0.33428766227810264, 0.15615257922261755, 0.20632942159471135, 0.07288141215675653, 0.3425453670055901, 0.4912963576198846, 0.2676047905213925, 0.03783464653015778, 0.4077380293357126, 0.4737594012775818, 0.21383951839178522, 0.37031519942028746, 0.4188690216822833, 0.06273602687405788, 0.16953237372125063, 0.011854051490812867, 0.20037600901429442, 0.002770497619670853, 0.03784968427006302, 0.14027927874413593, 0.34594424232953314, 0.022862092792808875, 0.22997569623529457, 0.1619672417957611, 0.3537306487843561, 0.11143838528081174, 0.48005673837486973, 0.1892530467944687, 0.2546613158654465, 0.2571701099490301, 0.0014139791102650845, 0.2832288822011035, 0.4628668523664705, 0.03962358225225404, 0.06689991407174534, 0.1549441154475703, 0.427595630235707, 0.31184289863246745, 0.33410213639856884, 0.05792770659941909, 0.37068646332847544, 0.20695224208560314, 0.34185634033089496, 0.30713546287511073, 0.4323939365811673, 0.06026866989637797, 0.3725175553152371, 0.2861204616416677, 0.05937754719162586, 0.24813295927235424, 0.10901502584405848, 0.3115615054071705, 0.2502762609408565, 0.3723888931860779, 0.07601551332217027, 0.26187778971383585, 0.48931366164691686, 0.04909969108210249, 0.42753195923845805, 0.24508973411151497, 0.48229768879005636, 0.1490731265286982, 0.07568618186222842, 0.17568764099613582, 0.4063901665965217, 0.139077937187862, 0.4019431676951358, 0.1024833371744332, 0.26798418958246584, 0.4646124444837126, 0.0616566072987062, 0.018823461043025402, 0.0988138985085667, 0.3753963427855406, 0.15852689265785325, 0.34569513189198653, 0.40150550309771726, 0.3690680460612886, 0.42509958741870274, 0.40289379262084807, 0.33499178446449074, 0.26328924902274004, 0.1614106851855644, 0.28770783806207517, 0.12114496766211152, 0.15898932757666417, 0.08466821561784671, 0.4209897076494435, 0.10964677688186691, 0.31469343260831595, 0.031086362615022844, 0.2998263638588178, 0.14107963523843398, 0.43934813682673796, 0.3485806726273004, 0.23903396044099262, 0.0763150130939641, 0.3966882515902458, 0.3356630508371128, 0.32034804011656054, 0.323979802848664, 0.06942549466100056, 0.060277866718777995, 0.11858007312598046, 0.2666517852268565, 0.24151974785831776, 0.4961992020853661, 0.4040658831850831, 0.42430991041479305, 0.4534190166520037, 0.4280490783007227, 0.3516198885726273, 0.26188058432789596, 0.31449730657798075, 0.33478041732524283, 0.21869296498275892, 0.4924643466499261, 0.3508765708416339, 0.2714146897090601, 0.1983904966467686, 0.08789220198919251, 0.4295683816462953, 0.14990773825359682, 0.02109969953784724, 0.3163836953242176, 0.21758022147867867, 0.11498517456115986, 0.4857815687164887, 0.07459527372080715, 0.41435478827010236, 0.39880987675548146, 0.06319752415778596, 0.19931587926948297, 0.25910695999718364, 0.1365952471387462, 0.4176796903380738, 0.0056262391227939745, 0.06370924345347567, 0.4892227875518836, 0.4580204595952335, 0.4466579470978921, 0.3464280468787687, 0.2292870051280942, 0.14199612033607584, 0.11485441692029391, 0.4836113845665428, 0.35128445802010283, 0.1578509301734521, 0.42443136405312226, 0.07531674979472952, 0.06263278294648289, 0.4111639937633377, 0.07505540671618727, 0.35545014023108046, 0.20393721438192902, 0.39222056991042287, 0.05111887562327011, 0.45493177102453225, 0.4761597793731682, 0.49408534211537675, 0.12272782472922411, 0.36695945354349147, 0.2520562618050237, 0.053765433855289535, 0.1792914157816728, 0.46054057315641483, 0.47567827394986123, 0.10482768681994403, 0.3610301110645707, 0.349089999979475, 0.3980583343690739, 0.04260899541790841, 0.3921625918873168, 0.4773771893465576, 0.497839171627753, 0.27762721297236725, 0.33808984816409154, 0.4489237515819249, 0.014338229476653086, 0.46671513417883204, 0.1705857089184203, 0.06451019987720402, 0.013542994488243643, 0.13563768143516525, 0.2810557337006123, 0.29882173325177475, 0.03031760099633729, 0.14352434550373216, 0.4825596906216776, 0.06791672336734111, 0.21411051931550262, 0.2710916246071354, 0.46358331967560085, 0.3416738576794174, 0.47400077817179453, 0.30135870423536565, 0.07302881592257832, 0.49415856560951554, 0.10788139329903723, 0.4667563261747217, 0.28562065229476113, 0.23729673703112342, 0.3829424853966696, 0.24841010057881352, 0.05745951506282926, 0.378801756650921, 0.1557894651841164, 0.04746870011498572, 0.13996551674640384, 0.3421051848120712, 0.30059389112827684, 0.49793462203563227, 0.3022337046954728, 0.15620654590949629, 0.39243682546733094, 0.1400615552931198, 0.10055758302709827, 0.08883672989996044, 0.36005658074739477, 0.1884137665905382, 0.4912531274921867, 0.1836412406838751, 0.2789559352676284, 0.2535965422672797, 0.41666504805159515, 0.3244097751792424, 0.062106934317846696, 0.016793290300286923, 0.3560376374742062, 0.122280340106868, 0.2781722967107348, 0.44316841124616524, 0.22546226710526218, 0.023537395348532997, 0.17509207225301865, 0.4526656181301187, 0.3589889457824063, 0.07038824660013704, 0.2929493336246723, 0.29222959689156003, 0.1838156413271877, 0.048075148265762535, 0.1525212557839099, 0.11278374435142008, 0.3392078332659861, 0.3018615382912085, 0.19716471702883537, 0.18128708494755402, 0.2394245285670925, 0.4161660766123813, 0.3984893803271755, 0.4884144018689262, 0.05026497099484578, 0.022555023419827902, 0.17278834377833097, 0.2219994630148172, 0.04532274664538832, 0.026195950680501012, 0.010464940369348197, 0.07134908355607233, 0.46028904431912654, 0.4739536250406565, 0.22640389660886828, 0.0833757973602352, 0.42494596341745794, 0.09253655413995271, 0.2855627965326135, 0.060022958860252884, 0.3170960832550685, 0.4845132087292854, 0.0900573550595965, 0.43934532476367094, 0.06326701260959672, 0.3106473692958535, 0.22493785884422635, 0.22050938974187334, 0.4460249838707604, 0.33583337853217005, 0.13110535951501634, 0.3805177503651347, 0.39312966235739577, 0.26864765738060775, 0.09353109767217438, 0.24252261496490923, 0.16359692283931238, 0.13093510186868318, 0.3880252745981556, 0.21457106646804125, 0.016406795740806723, 0.3554279764689229, 0.4623029976123774, 0.48152943416135985, 0.39103124519511506, 0.21025308026173523, 0.13961047554821177, 0.1694027978763637, 0.10196511172331829, 0.26894113108683887, 0.25042991530623565, 0.008894427705899155, 0.49227933309365673, 0.43457460318486035, 0.2197230483989815, 0.35895192184557634, 0.21795132834135067, 0.16931638348603206, 0.34753477375407743, 0.2359022507299135, 0.4486906279366177, 0.34612512369118825, 0.009532925954158666, 0.30119270625129296, 0.2655018053980539, 0.09012381921764456, 0.25134113962412075, 0.27346748181775443, 0.35336723697923006, 0.13654398615143648, 0.43577592437793744, 0.27130640675411977, 0.44562000947144115, 0.47486533250369634, 0.23773965691004573, 0.18415368866287474, 0.19882911246768636, 0.17488797621959512, 0.2091049681048005, 0.1893494962412463, 0.2662450088370521, 0.2727184021578039, 0.4903101860975683, 0.029923709809658194, 0.36408558511217753, 0.2935391906231074, 0.359794286150956, 0.4286951744663627, 0.06360048902899279, 0.278770938953928, 0.3849538290504603, 0.3948071106806106, 0.1077720917189044, 0.10581781791578904, 0.38641593382329814, 0.06213013990301264, 0.4554471643245206, 0.42497067061312266, 0.052989714153321266, 0.0851602363631096, 0.49047950523299927, 0.37221465913123547, 0.17035834080465745, 0.3994498064898801, 0.35762890216074067, 0.3895039716410367, 0.170183238697378, 0.08128832738882719, 0.4213997384901869, 0.14805724440630635, 0.33379697036387884, 0.48457854415997625, 0.11792555406342081, 0.36779888796716503, 0.42799231825982775, 0.11788323226850672, 0.3987856881963383, 0.07058630410439931, 0.33294905373348077, 0.07033202670918048, 0.32477197498599475, 0.262925219052183, 0.47309163413460953, 0.19417347192923917, 0.2533052828497309, 0.07543992186523868, 0.20009250311991061, 0.30392256978203963, 0.47414617107814666, 0.2670630858926156, 0.031044317190721038, 0.06464953054072281, 0.23669770080772345, 0.1952431908783545, 0.02214374046453993, 0.11990318937903233, 0.3429857527422358, 0.040568266513002216, 0.06642486161057376, 0.4250749653386946, 0.10760683995171094, 0.40025797615638975, 0.09284642643592372, 0.059569383571346, 0.1298539056244809, 0.4153398790090275, 0.20862360494064158, 0.06179823406003515, 0.3694067676948172, 0.22939283964743867, 0.02392132929455465, 0.15590531273254243, 0.14860871230878991, 0.21444313982034147, 0.36933286482647276, 0.1688256196106458, 0.19941634796747104, 0.38655719683028755, 0.4287674706122763, 0.3743909490123615, 0.1066116083603475, 0.45106582799340167, 0.03873563155779863, 0.4955909274501391, 0.052721106047855015, 0.4136274031736613, 0.21988967154753425, 0.10909599941582099, 0.4096148161811996, 0.06900490369457735, 0.2849937949111779, 0.27363891830683373, 0.48281311785229897, 0.11711358412838296, 0.016719640987647, 0.31029278220056244, 0.29385632061558087, 0.14914372437869078, 0.3099149355157535, 0.09618711724629597, 0.23213161146412647, 0.3045887745743551, 0.01984697976034866, 0.3250154478542689, 0.44361727728720857, 0.48806255634492823, 0.2640117173736707, 0.06838525512790772, 0.4245483580750341, 0.27289949018220694, 0.4171628278841125, 0.2246911801176349, 0.49099344485594415, 0.4832918809955537, 0.49023264625091384, 0.20331875762789275, 0.3114937103867196, 0.06784082315094464, 0.136187297525661, 0.4135676512693245, 0.25055770765359203, 0.22384306356489175, 0.19882869948129311, 0.29572274726493103, 0.06051832920693506, 0.07910275671448752, 0.38260312750329495, 0.14284338052258821, 0.2814209213446198, 0.3341213976424197, 0.06725387181887788, 0.23864248044415715, 0.40289821740488924, 0.4967766260181278, 0.261862965190752, 0.346166090690316, 0.024450032693759116, 0.23893353845343845, 0.4690514112637928, 0.1565127037267574, 0.3762840602628488, 0.487105057540648, 0.22489070336465694, 0.4449820077672855, 0.04039578186454551, 0.35341315646864696, 0.1505870975833289, 0.0430624892776621, 0.4754730835700386, 0.07442861356033142, 0.48339517553932676, 0.32194530495935586, 0.2490051972548772, 0.3976981398535629, 0.15465464889963365, 0.04108546333670221, 0.31720765594539074, 0.019650481917162232, 0.09323998161719599, 0.03295931699311927, 0.32864081531714956, 0.22922605248151406, 0.08602610566481278, 0.2816151832175793, 0.20831827442115003, 0.40730078811487863, 0.4290107870891573, 0.4428593017950119, 0.12734419328234453, 0.04764428724922826, 0.30979900215679823, 0.2737525511068495, 0.057254219205892576, 0.3038461490449687, 0.10036522957406796, 0.20978917611759645, 0.1297511532695515, 0.21289287342596608, 0.1965003587081547, 0.19093756176858834, 0.15474738025403145, 0.2166780874137773, 0.27391650693723707, 0.3116804973076793, 0.04586922901671714, 0.2124315641542066, 0.39016826426418566, 0.12998774719224926, 0.02707405871838281, 0.4161073686545303, 0.38214532787097955, 0.34298281308676076, 0.3049097876226492, 0.03176563751417838, 0.4947238730151909, 0.3294746925416251, 0.05290575089549665, 0.25982921716029495, 0.24022657601118436, 0.45250944198252585, 0.38815421091783625, 0.11017656607917209, 0.12052246540330697, 0.21135294827889956, 0.27955379645963474, 0.41998062267577313, 0.0072549356333576065, 0.14403894622818925, 0.31424902190865955, 0.16053116214994562, 0.0364289169279709, 0.03996056308682966, 0.42695787662719265, 0.37864645182898937, 0.0037307579480252984, 0.40521568108463546, 0.33965342494458, 0.09024471533528527, 0.07789918209057844, 0.00916864026955444, 0.07890563649705534, 0.16205311546063, 0.03279095293877732, 0.28184569573541074, 0.21800170057480273, 0.19272236708802037, 0.11826463513095281, 0.1477251331214775, 0.39114230196069066, 0.4121701980037696, 0.11846524634445316, 0.2137262337554573, 0.11658498402571532, 0.46753731093174067, 0.3803986787580999, 0.3599202759273132, 0.35286253977317095, 0.4473549063523221, 0.22395219289406937, 0.3925384909551321, 0.15753555002045527, 0.1899502956450444, 0.08015795442439783, 0.3364473401637093, 0.19497145319801207, 0.30027466337731384, 0.44162024361952595, 0.2777603748428788, 0.23519596503275098, 0.35311601722051766, 0.016748785557146484, 0.2776081397066978, 0.37805696450606907, 0.2874774687329284, 0.42403359749170866, 0.45910965606615106, 0.45531136604600986, 0.4288612112477848, 0.4285692533629653, 0.4030140303664867, 0.034386680979861584, 0.3435189248986287, 0.04586218620108762, 0.09696771401886695, 0.372423357834441, 0.35113855185053067, 0.14516282492142069, 0.16858218158028998, 0.0228451241910696, 0.2706124976994316, 0.4087279062002861, 0.15519293504917164, 0.1879467649832452, 0.3831784607780979, 0.35367563594338586, 0.044075037815084595, 0.17758234404994266, 0.27268514185017617, 0.2471654927853732, 0.09221979924195017, 0.3189113743379737, 0.49223195268201286, 0.3426981139136802, 0.026244698585227322, 0.47312384707528066, 0.4930363099642066, 0.3180949022431659, 0.12632934766625786, 0.43119158179587125, 0.3497581210099752, 0.30004309658753225, 0.21613049775505921, 0.2713977800431889, 0.3179259612799313, 0.4055792470193919, 0.3252438342660415, 0.21995284497434148, 0.35249183074156226, 0.23308555262891734, 0.38276883874124, 0.3969120554904545, 0.14957689163733057, 0.10199006331058691, 0.16394923339852152, 0.29016789913563956, 0.36170339234558835, 0.3266487607330839, 0.33263343975557325, 0.07404552221121757, 0.2519529362729399, 0.46863296303271745, 0.46299396094909195, 0.05315789907280494, 0.0559995200971678, 0.09879911128052771, 0.31843353314838274, 0.20129919420563913, 0.3493611033912229, 0.4911739742297465, 0.17445728866657928, 0.42031595351202045, 0.2436202902111801, 0.22895771239320806, 0.18492734143671297, 0.01822261592708324, 0.1927627473256226, 0.4677754634288953, 0.14294819354188715, 0.1784307485870012, 0.13333947081878395, 0.21881598347845377, 0.47827302146128026, 0.48329861058860346, 0.2900285026496399, 0.3845248686926576, 0.10754525439683121, 0.45679927442222124, 0.3164358607839953, 0.3803894182808729, 0.2659004316644401, 0.2151552969416849, 0.24418466812773398, 0.48270466335840345, 0.3210714543899517, 0.14962663727282738, 0.20869763774574923, 0.4518398760431549, 0.1404417281075087, 0.048715270109240705, 0.09953580221550512, 0.26302001700877237, 0.3636359398665542, 0.4984033515991975, 0.18717356090248716, 0.19726619673847517, 0.4756892529314316, 0.4310776049987837, 0.11013506258498135, 0.4539402344733369, 0.025490678193491878, 0.30876437423919373, 0.15794835099560484, 0.04672581574995199, 0.06760167336202899, 0.09470971819409812, 0.45045350114233323, 0.03907192877084803, 0.3171072185772688, 0.16008264529777827, 0.37674246316018617, 0.4960844253846286, 0.3964423247926457, 0.18130411315435818, 0.34506098131907303, 0.3520560822899956, 0.16631381491925695, 0.3165959673802065, 0.38954735947306807, 0.16623833837894203, 0.14484179819020448, 0.053440027947401936, 0.27995797853939347, 0.4175051547336277, 0.1629926230377567, 0.4720406873016686, 0.41360417984335107, 0.1377886286435973, 0.3609065864521695, 0.243116894573709, 0.19486297720757845, 0.328204710386463, 0.4369879505166702, 0.14811258667177524, 0.08073398912972307, 0.37031243969775307, 0.03135438229243048, 0.2960056091753039, 0.3511201302860212, 0.12553287715693567, 0.20716568352623282, 0.24669689287245272, 0.12407796116715941, 0.3623576571847533, 0.4180269009560961, 0.12527259415015857, 0.44523264681971525, 0.28459373975329977, 0.16634405135972652, 0.46167166875923543, 0.09542433637927267, 0.16105544375645003, 0.48373678507649187, 0.004951905824916947, 0.06022002929765452, 0.3202683757941184, 0.32420221242646063, 0.06446788061998654, 0.30829004295973916, 0.044957599156515204, 0.31514485515576685, 0.19475284020125483, 0.3830866848738057, 0.4546537596775338, 0.39340057759744135, 0.19337954229416976, 0.3884406657341985, 0.16788973612603175, 0.07622668690847761, 0.2525948494437876, 0.47349977184600434, 0.3226096743930181, 0.4777619864320921, 0.3005611157709454, 0.3298302626991179, 0.05137499171871268, 0.13273067601235983, 0.16418386901438686, 0.19203809094755753, 0.21544904663191466, 0.16028480628091768, 0.08153113944091656, 0.22060861773011275, 0.1590154529664325, 0.4939901291150736, 0.48285366438602395, 0.3883193416604855, 0.10589627014887737, 0.04923002253290143, 0.3242205147156962, 0.27598035311417385, 0.011828474831007518, 0.2869552187908147, 0.05372937387860072, 0.06788441397658396, 0.42621337871699216, 0.4277195493690237, 0.20592390818416118, 0.24686858439323872, 0.4964440229086508, 0.18676053174264373, 0.24110476898665745, 0.3273742084008108, 0.46081629731949003, 0.4714261286846134, 0.3536854541308462, 0.1842138119980401, 0.4369658393860428, 0.37680985715533444, 0.20950204671563688, 0.1660576084391412, 0.050168374645974845, 0.04372113898128516, 0.4391503643322107, 0.3241369781455645, 0.07610652148297353, 0.017906902633199717, 0.2059282683736931, 0.4505212425867809, 0.08528746240072904, 0.4041711973550643, 0.33695710751154323, 0.11348837348638235, 0.47667998295213254, 0.22994924352937895, 0.3198209321570049, 0.0511740344448644, 0.13677610078376112, 0.4109704592441461, 0.40776713111613977, 0.12060491377673443, 0.3874894110954738, 0.040846925184726324, 0.4368506585305541, 0.16468884522365684, 0.4175314634535013, 0.3794429450891736, 0.31503313891701357, 0.15920186717600932, 0.1356643314076479, 0.146545904244598, 0.0383710311329995, 0.38125093232111995, 0.2553300156998008, 0.17488650266276368, 0.04311372720687612, 0.47973314690193797, 0.20088174721522073, 0.17773031823352714, 0.04051387813095242, 0.22543769608411718, 0.39799735718399326, 0.09460000199012086, 0.026014306082798422, 0.43163108944996637, 0.47215775479472033, 0.287424892614665, 0.38620909358794897, 0.07038914455826806, 0.01836189056714238, 0.02172356759680011, 0.0239336931915049, 0.0038088128402983257, 0.07504051834225411, 0.35282866919149414, 0.1592430386920337, 0.12360639934253465, 0.05193148731755931, 0.2545960666318865, 0.3605241830430316, 0.47557114942762513, 0.2012123363722007, 0.13746700255836847, 0.33912685788505725, 0.08155028478443216, 0.3366728822781616, 0.48579324734052515, 0.4026235785534067, 0.48769330781456827, 0.1265071571193493, 0.003654362542929057, 0.3362212120000546, 0.021660834042964483, 0.428680959910425, 0.4535707320047458, 0.12405875603450611, 0.2514650728500355, 0.3967307916825584, 0.3403544359552806, 0.2837711820274431, 0.47791777462281665, 0.37528889183662034, 0.14183706278664265, 0.46217580706318373, 0.09489273928354197, 0.29509772230999276, 0.4539634978671768, 0.21250193588507515, 0.42336865453868244, 0.38147537895188005, 0.24424886792199135, 0.4932953745836498, 0.4342838992733323, 0.3633958290536279, 0.03232551647072762, 0.05618698568352026, 0.08898295553514357, 0.4114320275415351, 0.29469331589648384, 0.30640753408033444, 0.48809702372131647, 0.4280114825662701, 0.49514156679316734, 0.08648999652954487, 0.049573415527084164, 0.4002826727450292, 0.4574667973247629, 0.23683023675705728, 0.42630288850228354, 0.4550005826366375, 0.10886526502175581, 0.37130862475634646, 0.37772283860546635, 0.29912402803867416, 0.010822876145530402, 0.21452134369817144, 0.42745330225334793, 0.14668121272133405, 0.37829229752785853, 0.43724412153624687, 0.460356697665091, 0.12588541662828012, 0.28987907585377237, 0.08461398265203401, 0.396467825455885, 0.3803582726240571, 0.09603955793928703, 0.48054131287589774, 0.2417565357507992, 0.27131361987051655, 0.36773145494727627, 0.4099801923159307, 0.12312217855623575, 0.4632242388782521, 0.3257784189416183, 0.2224460872812345, 0.36509209723681774, 0.4558382077655347, 0.02241337477973243, 0.04237711864091731, 0.3765819295607394, 0.09159272067698704, 0.4123077229223859, 0.203508809866643, 0.02381451517567945, 0.17580787549726323, 0.35250774899843507, 0.10298711270580202, 0.3542571253200123, 0.05857125034879218, 0.2678657585877085, 0.3592028214056745, 0.4888069846703118, 0.0009127438179019065, 0.2593564670220277, 0.3283176077905965, 0.4383757303734415, 0.29013626984226265, 0.37871869726477253, 0.41134829707088366, 0.0992351612628058, 0.005212950260748861, 0.3155677337083193, 0.3599321514810244, 0.15188298936283307, 0.46522829694376777, 0.13072502682173193, 0.1304077452503523], "expected": [0.5063071700812891, 0.7622888324970656, 0.9662069637969042, 0.9760581611113842, 0.33848369284648444, 0.5547373115805322, 0.5497080894277074, 0.988127389108617, 0.878562297037282, 0.46050391882126984, 0.9505625173657659, 0.936993203072816, 0.8898339998880721, 0.20379774300663686, 0.7430326633557164, 0.7698747897891232, 0.8102781139846539, 0.9664032754068302, 0.7292294488268158, 0.11452673947893803, 0.4678837093086471, 0.9783163931862772, 0.6067152761737636, 0.8511292484502887, 0.9696206533450401, 0.4793053599920848, 0.0207686271817918, 0.6585531669525034, 0.8282444904146204, 0.41118459380822786, 0.5375228437849469, 0.8025810718258515, 0.7314026748309027, 0.21966951837285606, 0.14774040552712844, 0.950638719640175, 0.14457134022676985, 0.7100296288206618, 0.354214886992498, 0.745939148550918, 0.967905625176293, 0.551933836713456, 0.14044338455626795, 0.9423961691310282, 0.9774060975051739, 0.8821561910067377, 0.5231867617548717, 0.9769438145233156, 0.4984722281843582, 0.5715845465611838, 0.0904746527026612, 0.7540512413948802, 0.002766663332918693, 0.14049508615656942, 0.3435034472679335, 0.9777494080365488, 0.18597063210496406, 0.8737866141701631, 0.7263041797586356, 0.9159307606329621, 0.4271846848808164, 0.6171505609999294, 0.8493099902643125, 0.22482100566628666, 0.9409204955680732, 0.008447988154205893, 0.8172019510586886, 0.9938514277342836, 0.11207743978407353, 0.28430384767955813, 0.818115838519431, 0.97868535048726, 0.967621863552161, 0.8118490442050086, 0.20682454444957374, 0.9754456102773235, 0.7651165145999754, 0.819004245113025, 0.9143155316850482, 0.9515274468697027, 0.2142170577473104, 0.6729207118094798, 0.4357404415233873, 0.11197474349407073, 0.5249802409520873, 0.2789487609164162, 0.8457790604681864, 0.5280247743588646, 0.9649682343349785, 0.14103837036930636, 0.8769325029614751, 0.9469161197294662, 0.41730803949723916, 0.9786731328620923, 0.38748354292052595, 0.986972323188653, 0.5254392466880409, 0.26121233548684547, 0.2962803890029237, 0.8031986956096271, 0.6713045028932165, 0.8659732454950035, 0.6411437439836137, 0.882800013456962, 0.9847246063036286, 0.3092239779997229, 0.1715796716177536, 0.3898616184502128, 0.8948511229833659, 0.5473492686204752, 0.9110664594193092, 0.9398274205731904, 0.8420284349684997, 0.9219649757720482, 0.7014092516747419, 0.7381457264687336, 0.6511652609794887, 0.8306042417698203, 0.5781576083402518, 0.7362080736295897, 0.6147781841202304, 0.4920365206050587, 0.9902538874289863, 0.4220303292337978, 0.7926748951757714, 0.17015652116366028, 0.8345288108744505, 0.7190888121689658, 0.9538305501272282, 0.7519990471057969, 0.9084014286839395, 0.26306829137053356, 0.9810676374291207, 0.8665433142398931, 0.9593794182498306, 0.8568523719263149, 0.1296422886113835, 0.41870726399228464, 0.377692099911691, 0.9305062078698079, 0.5154619148281969, 0.8625914684520142, 0.3323998638033281, 0.9215943636890656, 0.743405189209207, 0.9861641299899931, 0.8787280011049509, 0.8400931930964917, 0.919216169626694, 0.9313162977493961, 0.7307615309096152, 0.9681669565519653, 0.5042845179208315, 0.6623207365901527, 0.6958830598146062, 0.2964165638422698, 0.924029508959539, 0.25904506833986163, 0.0413213981144128, 0.9420081768135341, 0.7819566865440696, 0.49837931243749384, 0.9118669649014061, 0.07188095550817741, 0.5633876622405083, 0.32888171558950297, 0.31558111576277725, 0.8336802125556544, 0.7887349473178137, 0.6647108473160203, 0.9462686061249823, 0.011189405907295568, 0.3993085962569132, 0.38689727987673206, 0.3674654653255761, 0.9820456261262015, 0.6462922036111399, 0.8730018863969113, 0.5734291140604159, 0.20523502251645362, 0.9791184874098048, 0.9144788192920714, 0.27072315589555085, 0.9906159609338893, 0.45257729117767553, 0.4654488357179355, 0.9437611768020187, 0.201616499694588, 0.9169365895559926, 0.8043636529059813, 0.5436253198341098, 0.14217625574203552, 0.9586019871117734, 0.9946878443895697, 0.9484143658236509, 0.5764546865548181, 0.8893913210286862, 0.5305384059147268, 0.4464591754201401, 0.8608503871966042, 0.8415256126336502, 0.9423906065414638, 0.2698337714795956, 0.9611975154489097, 0.8254335835801563, 0.9813252576334336, 0.25789383603192056, 0.9357605739090902, 0.7612006377326931, 0.9170233352361821, 0.8915013668502291, 0.9659831225397828, 0.9323591040711381, 0.028269191584863063, 0.9850109629377902, 0.15682918072741278, 0.44043288264302655, 0.10268109479157252, 0.5568407481781211, 0.7547013100911524, 0.8335283741685374, 0.23879944082752155, 0.3498635639551133, 0.7648846588551275, 0.526253995806324, 0.776596033020034, 0.9335241294522113, 0.843442712035344, 0.9538133608734477, 0.9859622760246868, 0.260187648678136, 0.5521589797894774, 0.8614652749555949, 0.4169060558942225, 0.9392226417790096, 0.9235092813734176, 0.6129444081681682, 0.9782778945794549, 0.8629323671636095, 0.4370672743597154, 0.9773595594408305, 0.37335080689140593, 0.1327310132723606, 0.24416413298199527, 0.8716033667510256, 0.9097120371328159, 0.9170629265703889, 0.7793480097745336, 0.6649400544974118, 0.7919022383712396, 0.7165030736403706, 0.26041994645615424, 0.5504600574665772, 0.6604621131690105, 0.816533630234215, 0.9142454074950297, 0.6677433093195162, 0.8124548404439053, 0.8305463423724269, 0.9643255447100504, 0.8572211930886297, 0.16999271652054163, 0.09584976370088483, 0.8313935853150651, 0.6673029826434963, 0.5659158588833909, 0.9881055587810785, 0.79366121418908, 0.13170553120590853, 0.7064315672110789, 0.9732527855839251, 0.762112113906046, 0.4692659440225682, 0.8275582881183774, 0.9461900007229261, 0.42388438847960397, 0.09167251266176998, 0.5335508551627033, 0.5943521883421036, 0.4925797212091783, 0.9511311638355524, 0.7484599403444445, 0.8368150158345837, 0.2129193267933445, 0.9176680851467969, 0.796879833385265, 0.9672515882114362, 0.18213654683080405, 0.14605215965548546, 0.4045066345168013, 0.48623966112559985, 0.2380973442932322, 0.23045781570160268, 0.10873577269264213, 0.13298427673487542, 0.8998859478701273, 0.7587353644526731, 0.492983478849701, 0.6003370735323276, 0.5725388734706212, 0.16895647453149126, 0.8981752796938748, 0.38133025024852574, 0.9580367411380305, 0.766258535312957, 0.5936634616701937, 0.9876420197146196, 0.3971796784538663, 0.26702770115942254, 0.20143415897810885, 0.35661937589646797, 0.8320518428312084, 0.4891436057116477, 0.3251845808022307, 0.8508180760684131, 0.5444543394996695, 0.883420432823446, 0.3735306875457573, 0.5169175060059943, 0.6818328673431466, 0.6491795816058414, 0.9793543935718306, 0.7773150897648982, 0.09375063585340339, 0.9799536410687203, 0.7501536107174651, 0.38216227330117025, 0.5425384723588678, 0.5687262850874428, 0.6236641547600694, 0.398427605155835, 0.0969389426366863, 0.23581175874472773, 0.714110405677854, 0.034952263338449224, 0.860419995391277, 0.9870381653016727, 0.4827190586488252, 0.9723883976186308, 0.8251121953121439, 0.6943194523917426, 0.9561864857113318, 0.757174816590745, 0.8939084777219299, 0.4995513322287898, 0.07342789175397235, 0.963597570744004, 0.6542389057953346, 0.41768451944585727, 0.9190085265776398, 0.4212791046368028, 0.756702169915936, 0.5592440318539598, 0.7294579589878752, 0.7424475869512503, 0.7373308512849734, 0.9776051142300352, 0.21159207906819405, 0.6687633260173421, 0.8329499836340782, 0.5031921288945539, 0.5667411278298604, 0.17250275102772286, 0.8811579609624718, 0.9140909086728299, 0.9472325690460127, 0.05809176066164214, 0.8874675338164536, 0.7695441449515875, 0.9607635287366553, 0.8199968085309417, 0.17370338105732175, 0.9534151700542006, 0.7855793022006654, 0.9064110224904985, 0.19389734691516147, 0.2719994343160551, 0.9545584080279326, 0.46275518743026595, 0.9894799428927891, 0.9906714657456117, 0.44171564838295785, 0.08163488287537714, 0.38766729295958047, 0.524994700545051, 0.28873960718723546, 0.9590579837851361, 0.9599913708524951, 0.9345538624086834, 0.8176509163513662, 0.4339191076936613, 0.5694963501478506, 0.4469069223592229, 0.8650406722933126, 0.766304345621053, 0.37606071576592653, 0.7703492384008717, 0.8194900310400536, 0.653872851569688, 0.6977065560275975, 0.4314638803669326, 0.48618813784499093, 0.0679157083570665, 0.8970388786779185, 0.8779594304726256, 0.9858469440103531, 0.5400759389113998, 0.9205837942172, 0.49285549525846867, 0.63229066946641, 0.26208199860973824, 0.941858583844533, 0.4138187118383767, 0.1167767408898606, 0.36399363878716456, 0.8092676048091145, 0.8580715056014319, 0.21618412937332007, 0.5679968182716494, 0.9543554823608038, 0.1145902967197678, 0.23333048187181915, 0.9219534466127935, 0.3497688473228947, 0.5509028084040877, 0.47791506053303207, 0.4149888968238559, 0.22872308867940414, 0.9172589372893274, 0.6476456820983901, 0.11626361525579659, 0.6698540016390153, 0.840409276195224, 0.046716233709007765, 0.2678798399839618, 0.5900222027720757, 0.777115589114739, 0.8422374657237228, 0.39738505927940504, 0.6310454229105813, 0.9691622216701364, 0.9789089655316218, 0.5270577060434698, 0.4131922595220371, 0.9827439496477008, 0.1097089922257563, 0.9957101358017015, 0.30860759902527346, 0.8735789170728332, 0.19739265649601118, 0.6253878274637643, 0.9143673717303346, 0.4626169549446023, 0.5747088920841135, 0.5599719283588594, 0.9105491162505733, 0.20881793597087217, 0.15396657430315863, 0.7880625110009405, 0.9047119209605827, 0.7749510272482181, 0.4619640346875136, 0.2506591696257622, 0.7516185646879374, 0.7819310262468447, 0.019651324980993087, 0.9612317814887751, 0.8911828563255543, 0.9953397590202747, 0.7948615791901872, 0.3804096752609526, 0.9217064573277163, 0.5589947375205979, 0.9765870373584608, 0.8342922262327185, 0.9678375004058051, 0.6196197094133372, 0.9472080138634131, 0.33411448009791267, 0.4636602306900383, 0.06559080194797286, 0.23843107230062072, 0.8087685118748673, 0.8269031394473123, 0.5915444789707116, 0.18030970532017182, 0.4464734134814658, 0.4199639155815905, 0.46890908288063143, 0.9680450489438307, 0.7235127094958916, 0.815208206470358, 0.7372324795991824, 0.48958885847787564, 0.8832572314536641, 0.7014132152471689, 0.9885640072005731, 0.9270973035205572, 0.9686223965630688, 0.024153551881468536, 0.8521368814184844, 0.8468298134004568, 0.5427676160960211, 0.5288449851452104, 0.966950055857761, 0.6751700670433944, 0.5893294697540379, 0.215237920977909, 0.915743713496446, 0.7002171142999172, 0.32129072090391825, 0.9072052689100853, 0.5249266831538223, 0.619698283713914, 0.6193351367159925, 0.5262216069228114, 0.32813519373611444, 0.7870177582888167, 0.11596302474713766, 0.8509160838109562, 0.16209817328515008, 0.3726181471949741, 0.06379296337271705, 0.8608001894261654, 0.7472504786593994, 0.08242972287461325, 0.43063317358549424, 0.7673518193755772, 0.8695159054609631, 0.9910769606665852, 0.9880687350556216, 0.6389553146796374, 0.17351800698733172, 0.7103830260919421, 0.5601219076591536, 0.20468488900098147, 0.5980945620986364, 0.5046826481634656, 0.7697349478298461, 0.5409090404578467, 0.5732562204317755, 0.44539607914383345, 0.7372528017290496, 0.6048478038264752, 0.6615539019815573, 0.8530136492507974, 0.4638605557777976, 0.24059145132219345, 0.34614072616965846, 0.79000531477908, 0.5974412501222256, 0.0780111752449698, 0.7130140749215493, 0.8520271753570197, 0.2903495918446074, 0.965055970821379, 0.24865529483285445, 0.9808947284403309, 0.7323027952313529, 0.23243242245437573, 0.7896484926298989, 0.513578490772152, 0.8959149795941456, 0.9339325755886186, 0.42355931368083766, 0.30341635260429556, 0.46956552538645274, 0.7528522596991742, 0.7163294836528213, 0.04259579870552376, 0.6351513334611273, 0.8891683785636417, 0.7642021619154671, 0.33016112876098136, 0.27362183017086494, 0.7222054951684775, 0.9668866272117708, 0.018480884585586083, 0.9884072165626033, 0.639029945218541, 0.3030062681761257, 0.1442682808576568, 0.06216427810525663, 0.4243983604070874, 0.6217949207421621, 0.15121958414624717, 0.5706732896061585, 0.6637863650875999, 0.31985191616576486, 0.21063722289140152, 0.644445213979542, 0.5426400694706737, 0.9892609879071855, 0.5087447741863856, 0.34783159955320725, 0.6065022276290852, 0.8458993384582051, 0.31641117746411207, 0.8346352071409228, 0.7562105068606421, 0.5912738114194254, 0.73912480272094, 0.3246596486428613, 0.46748392820630547, 0.7812011282887493, 0.47337346052132595, 0.8140424209340306, 0.6227538044172481, 0.6991365144555737, 0.9707817553766586, 0.9378126544962853, 0.8476489254277209, 0.29750431294777313, 0.03294273989989272, 0.9177895829921854, 0.9771903057061218, 0.8997230829781142, 0.9663677139803525, 0.9898582687498266, 0.9587118424523857, 0.986276040602283, 0.5756253081202232, 0.9404594813549765, 0.157964753276591, 0.6431917565472881, 0.36784575875655046, 0.5821820326720447, 0.9262418296020217, 0.7545235363448954, 0.765811340016318, 0.8147079066030788, 0.16703278349701803, 0.41796517449233483, 0.9619868546800159, 0.46247055559734057, 0.6762166274027592, 0.3183087667179054, 0.940952028404012, 0.08437654635514744, 0.5884857871143591, 0.9140651885582067, 0.9340474952255339, 0.4249617941592396, 0.9220190719760285, 0.9805100361732785, 0.8197644314541783, 0.14569601270502813, 0.9858510466195936, 0.9806350486777051, 0.470694656355081, 0.7172786447082684, 0.5778451814363569, 0.8773657249028608, 0.2592137053676184, 0.6606259843494335, 0.5570034692047224, 0.47051578342861705, 0.9884534861323333, 0.8973783997716728, 0.8278902216937989, 0.9151985650876244, 0.207914194397504, 0.985160418258181, 0.9582182836870493, 0.6490242834266644, 0.6393692268474009, 0.2795638358167825, 0.7656265500153595, 0.8361029777893759, 0.7292596520197766, 0.9301264094021084, 0.35870976079388084, 0.9195025170484763, 0.9623879477441721, 0.6038601295556505, 0.2333995165269548, 0.10595488439048836, 0.4992226956252527, 0.9430682329972452, 0.8907690833527776, 0.9388783309737333, 0.9954965599402257, 0.40748071975224287, 0.5685621913087736, 0.8883719159947512, 0.8986907059271938, 0.7722299545333084, 0.0532004226882955, 0.7405883848921431, 0.9762981863257922, 0.5106811552371672, 0.7600790988958857, 0.736419039623815, 0.8263177620172704, 0.6157823318781712, 0.8553147292775949, 0.5810842729084726, 0.9004553719397974, 0.19353155561203209, 0.59892167591651, 0.9204593356051229, 0.6805543901420603, 0.8445300823416465, 0.9062110530585707, 0.7050423052751826, 0.944768839333849, 0.47383630570763074, 0.6979048056456547, 0.18835939197024656, 0.9335323061585972, 0.6258476070399922, 0.41483883338254646, 0.09474246093717908, 0.545728413218414, 0.5167745092575998, 0.392500150557778, 0.1707002101259409, 0.32600486990680555, 0.3785434319477512, 0.951078741117044, 0.4234396797548223, 0.934364686140113, 0.11966555358512458, 0.7864366718220993, 0.6123646132210829, 0.2444844344471977, 0.33342994770791023, 0.31534407951316235, 0.9889412688248147, 0.1106067464354013, 0.7951620484918813, 0.7221464665940975, 0.6770401895913861, 0.9490294137232548, 0.9580609790708595, 0.30414100064766725, 0.49848510074426716, 0.8790449746424913, 0.7356577250012858, 0.8909743138389881, 0.32263659275206047, 0.56447004057838, 0.6861168152942021, 0.34787578642291045, 0.6736653577533893, 0.9645645035928915, 0.38674710132581236, 0.6109632141249997, 0.33873735944648165, 0.4978935566481925, 0.9200493816213764, 0.7034633539896709, 0.6893777897460791, 0.9276064218486652, 0.9696786624317554, 0.7363184832515725, 0.4317182382893765, 0.8915943032362699, 0.1970643265656778, 0.5885290379793623, 0.9143803881776659, 0.6336854971845929, 0.8740231142468182, 0.8221612876958263, 0.6726422438112308, 0.9616583656574177, 0.3416554819103615, 0.632921938973822, 0.9308443751134837, 0.7590024951263626, 0.6878927372900362, 0.9373398758765152, 0.533918464386528, 0.7653121612950867, 0.8555680967520223, 0.01961274116765497, 0.05844265940953142, 0.4729905250595385, 0.8023012876805025, 0.2755477327465227, 0.6034170796009914, 0.3901447168641161, 0.9687767855113217, 0.8573738491845615, 0.535211757573004, 0.9893961442793752, 0.3252415996566391, 0.8808265120047034, 0.3218865439497163, 0.2852192825815666, 0.3169132638275268, 0.8674451551165975, 0.9773591203990102, 0.8556707377777775, 0.37983021175905596, 0.6994810492945829, 0.6282340495216456, 0.26526835134910115, 0.2331479204068572, 0.6265993152628606, 0.8224215540224282, 0.4760437758742978, 0.5513104390655144, 0.4348804493153289, 0.7865302887610282, 0.6148385638083008, 0.8613719062919661, 0.9950649393097349, 0.5400505483805801, 0.41108967161208226, 0.2557513814094468, 0.9609223719022724, 0.8090764358417397, 0.07946414169174174, 0.7618313145464086, 0.23558685432969279, 0.23779341865199552, 0.9493843089531175, 0.8821800593761425, 0.8074484300857112, 0.7726379291334118, 0.9930181421436054, 0.8137834035420115, 0.8150617665521206, 0.7300441450680015, 0.9937111639338151, 0.6104847483217315, 0.958545924840936, 0.8415217818422019, 0.9873444369522927, 0.8480265258865858, 0.769271671347705, 0.4853305524228086, 0.1397266779909801, 0.2636487062753804, 0.8273694396723491, 0.8965802001180121, 0.204130112528566, 0.13346711677476386, 0.6428649730167726, 0.8948751106171847, 0.608653564273057, 0.8014441363378715, 0.6360982344150007, 0.43302602026758974, 0.3791588227328835, 0.6832828635990995, 0.893407968888793, 0.2643819190366933, 0.7453234595507174, 0.7085571588689172, 0.8698198027436687, 0.30358862786374674, 0.9336244078160881, 0.11533016869460963, 0.7303288366041503, 0.2806287342237227, 0.9846296451503028, 0.929778490772171, 0.9412989843699795, 0.8264380250294103, 0.6622045186030756, 0.8005127484483097, 0.31867122818034155, 0.6813789447689497, 0.922175591027542, 0.29515193168129794, 0.08261445590347023, 0.9091609240892642, 0.8658527862721589, 0.16283183796261225, 0.33311574663398524, 0.7936257214541584, 0.8633027682382497, 0.37686993502286287, 0.2488555986283968, 0.9866509611702539, 0.9771147352986871, 0.8217466374603306, 0.9690654575961796, 0.13131811342257216, 0.13661547948042202, 0.08322597932863109, 0.19378372299989738, 0.03737189772441177, 0.4910292171095966, 0.9582250341812422, 0.7614526243238003, 0.3900788529917767, 0.373360200483961, 0.5341018355195141, 0.885037018019268, 0.6137004981510471, 0.3313032918831006, 0.6670410335495656, 0.9336634905608936, 0.47920681732512344, 0.9516870645994571, 0.9873757943683387, 0.9821586375732546, 0.768477894858884, 0.6365295422424168, 0.021687543949591354, 0.9514902712320152, 0.04239668990389804, 0.7236377792642967, 0.9342190102539949, 0.39118146279479593, 0.7155862868106623, 0.8624343413522904, 0.8176399372935896, 0.7580092822914241, 0.9781453638022011, 0.9658707341443108, 0.5730218238249055, 0.9843859208724914, 0.17286344656880015, 0.9056535636560191, 0.9343738469017038, 0.8805693437959083, 0.7191981345791909, 0.681593412822906, 0.7051369711971178, 0.6271543489622726, 0.9690155927875316, 0.6638465366602371, 0.20250412383947272, 0.2861781903465643, 0.6242429585809994, 0.9836629586751401, 0.4453326042367634, 0.9365604507438787, 0.9924103533035336, 0.9861589273151143, 0.9687579697570686, 0.22853964051067244, 0.3599191226439759, 0.8648558596344273, 0.5994567765791622, 0.5085969982130538, 0.985920407705427, 0.9586219229580595, 0.4197674602032083, 0.9256640335181161, 0.9289278606254073, 0.8767903861303138, 0.07296145417008355, 0.9055547314151828, 0.9860814531506753, 0.35599168287061833, 0.5307335719926801, 0.7306469656886689, 0.9748488983778152, 0.634717164256644, 0.9016312992006739, 0.344967163970172, 0.6955972066219391, 0.8979354309162704, 0.6523069182445782, 0.9949378016911301, 0.5158059908602148, 0.9494326829042716, 0.9824911008494849, 0.9432932113541397, 0.7418834273472865, 0.97541930526553, 0.8038532341693712, 0.6711752800860702, 0.7678492627905011, 0.9739231064698062, 0.06502933483358626, 0.19094274608041203, 0.3137971049181183, 0.24025935614643085, 0.8078023273825282, 0.5569334256226768, 0.19291850976209018, 0.7078988488002018, 0.9403977522673842, 0.6042149485052632, 0.9162400138053414, 0.33634892192068366, 0.4147589803373568, 0.8841219493578761, 0.9799686328669492, 0.005461494421674661, 0.9252469055482436, 0.8605299849556555, 0.9919504012547766, 0.9450517089343677, 0.951672261065821, 0.9753291938994425, 0.6292960867969724, 0.050794065760512624, 0.8901867557897556, 0.30227633601763526, 0.654644488892733, 0.7523366440941444, 0.32441417827434893, 0.3237708193406661]} diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/cdf/test/test.cdf.js b/lib/node_modules/@stdlib/stats/base/dists/planck/cdf/test/test.cdf.js new file mode 100644 index 000000000000..2f74737e8cf0 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/cdf/test/test.cdf.js @@ -0,0 +1,133 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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 PINF = require( '@stdlib/constants/float64/pinf' ); +var NINF = require( '@stdlib/constants/float64/ninf' ); +var EPS = require( '@stdlib/constants/float64/eps' ); +var cdf = require( './../lib' ); + + +// FIXTURES // + +var smallLambda = require( './fixtures/python/small_lambda.json' ); +var largeLambda = require( './fixtures/python/large_lambda.json' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof cdf, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'if provided `NaN` for any parameter, the function returns `NaN`', function test( t ) { + var y = cdf( NaN, 0.5 ); + t.equal( isnan( y ), true, 'returns expected value' ); + y = cdf( 4.0, NaN ); + t.equal( isnan( y ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'if provided `+infinity` for `x` and a valid `lambda`, the function returns `1`', function test( t ) { + var y = cdf( PINF, 0.5 ); + t.equal( y, 1.0, 'returns expected value' ); + t.end(); +}); + +tape( 'if provided a negative number for `x` and a valid `lambda`, the function returns `0`', function test( t ) { + var y = cdf( NINF, 0.5 ); + t.equal( y, 0.0, 'returns expected value' ); + + y = cdf( -4.0, 0.5 ); + t.equal( y, 0.0, 'returns expected value' ); + + t.end(); +}); + +tape( 'if provided a shape parameter `lambda` which is nonpositive, the function returns `NaN`', function test( t ) { + var y; + + y = cdf( 2.0, 0.0 ); + t.equal( isnan( y ), true, 'returns expected value' ); + + y = cdf( 2.0, -1.0 ); + t.equal( isnan( y ), true, 'returns expected value' ); + + y = cdf( 0.0, -1.5 ); + t.equal( isnan( y ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function evaluates the CDF for `x` given small parameter `lambda`', function test( t ) { + var expected; + var lambda; + var delta; + var tol; + var x; + var y; + var i; + + expected = smallLambda.expected; + x = smallLambda.x; + lambda = smallLambda.lambda; + for ( i = 0; i < x.length; i++ ) { + y = cdf( x[ i ], lambda[ i ] ); + if ( y === expected[ i ] ) { + t.equal( y, expected[ i ], 'x: '+x[ i ]+', lambda: '+lambda[ i ]+', y: '+y+', expected: '+expected[ i ] ); + } else { + delta = abs( y - expected[ i ] ); + tol = 1.0 * EPS * abs( expected[ i ] ); + t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. lambda: '+lambda[ i ]+'. y: '+y+'. E: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' ); + } + } + t.end(); +}); + +tape( 'the function evaluates the CDF for `x` given large parameter `lambda`', function test( t ) { + var expected; + var lambda; + var delta; + var tol; + var x; + var y; + var i; + + expected = largeLambda.expected; + x = largeLambda.x; + lambda = largeLambda.lambda; + for ( i = 0; i < x.length; i++ ) { + y = cdf( x[ i ], lambda[ i ] ); + if ( y === expected[ i ] ) { + t.equal( y, expected[ i ], 'x: '+x[ i ]+', lambda: '+lambda[ i ]+', y: '+y+', expected: '+expected[ i ] ); + } else { + delta = abs( y - expected[ i ] ); + tol = 1.0 * EPS * abs( expected[ i ] ); + t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. lambda: '+lambda[ i ]+'. y: '+y+'. E: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' ); + } + } + t.end(); +}); diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/cdf/test/test.factory.js b/lib/node_modules/@stdlib/stats/base/dists/planck/cdf/test/test.factory.js new file mode 100644 index 000000000000..2c0ef47e6ee3 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/cdf/test/test.factory.js @@ -0,0 +1,169 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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 PINF = require( '@stdlib/constants/float64/pinf' ); +var NINF = require( '@stdlib/constants/float64/ninf' ); +var EPS = require( '@stdlib/constants/float64/eps' ); +var factory = require( './../lib/factory.js' ); + + +// FIXTURES // + +var smallLambda = require( './fixtures/python/small_lambda.json' ); +var largeLambda = require( './fixtures/python/large_lambda.json' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof factory, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function returns a function', function test( t ) { + var cdf = factory( 1.0 ); + t.equal( typeof cdf, 'function', 'returns a function' ); + t.end(); +}); + +tape( 'if provided `NaN` for any parameter, the created function returns `NaN`', function test( t ) { + var cdf; + var y; + + cdf = factory( 0.5 ); + y = cdf( NaN ); + t.equal( isnan( y ), true, 'returns expected value' ); + + cdf = factory( NaN ); + y = cdf( 0.0 ); + t.equal( isnan( y ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if provided a valid `lambda`, the function returns a function which returns `1` when provided `+infinity` for `x`', function test( t ) { + var cdf; + var y; + + cdf = factory( 0.5 ); + y = cdf( PINF ); + t.equal( y, 1.0, 'returns expected value' ); + + t.end(); +}); + +tape( 'if provided a valid `lambda`, the function returns a function which returns `0` when provided a negative number for `x`', function test( t ) { + var cdf; + var y; + + cdf = factory( 0.5 ); + y = cdf( NINF ); + t.equal( y, 0.0, 'returns expected value' ); + + y = cdf( -20.0 ); + t.equal( y, 0.0, 'returns expected value' ); + + t.end(); +}); + +tape( 'if provided a shape parameter `lambda` which is nonpositive, the created function always returns `NaN`', function test( t ) { + var cdf; + var y; + + cdf = factory( 0.0 ); + y = cdf( 2.0 ); + t.equal( isnan( y ), true, 'returns NaN' ); + y = cdf( 0.0 ); + t.equal( isnan( y ), true, 'returns NaN' ); + + cdf = factory( -1.0 ); + y = cdf( 2.0 ); + t.equal( isnan( y ), true, 'returns NaN' ); + y = cdf( 0.0 ); + t.equal( isnan( y ), true, 'returns NaN' ); + + cdf = factory( NINF ); + y = cdf( 2.0 ); + t.equal( isnan( y ), true, 'returns NaN' ); + y = cdf( 0.0 ); + t.equal( isnan( y ), true, 'returns NaN' ); + + t.end(); +}); + +tape( 'the created function evaluates the CDF for `x` given small parameter `lambda`', function test( t ) { + var expected; + var lambda; + var delta; + var cdf; + var tol; + var x; + var y; + var i; + + expected = smallLambda.expected; + x = smallLambda.x; + lambda = smallLambda.lambda; + for ( i = 0; i < x.length; i++ ) { + cdf = factory( lambda[ i ] ); + y = cdf( x[ i ] ); + if ( y === expected[ i ] ) { + t.equal( y, expected[ i ], 'x: '+x[ i ]+', lambda: '+lambda[ i ]+', y: '+y+', expected: '+expected[ i ] ); + } else { + delta = abs( y - expected[ i ] ); + tol = 1.0 * EPS * abs( expected[ i ] ); + t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. lambda: '+lambda[ i ]+'. y: '+y+'. E: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' ); + } + } + t.end(); +}); + +tape( 'the created function evaluates the CDF for `x` given large parameter `lambda`', function test( t ) { + var expected; + var lambda; + var delta; + var cdf; + var tol; + var x; + var y; + var i; + + expected = largeLambda.expected; + x = largeLambda.x; + lambda = largeLambda.lambda; + for ( i = 0; i < x.length; i++ ) { + cdf = factory( lambda[ i ] ); + y = cdf( x[ i ] ); + if ( y === expected[ i ] ) { + t.equal( y, expected[ i ], 'x: '+x[ i ]+', lambda: '+lambda[ i ]+', y: '+y+', expected: '+expected[ i ] ); + } else { + delta = abs( y - expected[ i ] ); + tol = 1.0 * EPS * abs( expected[ i ] ); + t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. lambda: '+lambda[ i ]+'. y: '+y+'. E: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' ); + } + } + t.end(); +}); diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/cdf/test/test.js b/lib/node_modules/@stdlib/stats/base/dists/planck/cdf/test/test.js new file mode 100644 index 000000000000..394217b65976 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/cdf/test/test.js @@ -0,0 +1,38 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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 cdf = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof cdf, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'attached to the main export is a `factory` method for generating CDF functions', function test( t ) { + t.equal( typeof cdf.factory, 'function', 'exports a factory method' ); + t.end(); +});