From f0733d3ee514efb730d4749f4cada7b3d11eb3d2 Mon Sep 17 00:00:00 2001 From: Jaysukh-409 Date: Wed, 25 Dec 2024 19:03:41 +0530 Subject: [PATCH 1/6] feat: add stats/base/dists/planck/logcdf --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: passed - task: lint_repl_help status: passed - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: passed - task: lint_python status: passed - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na --- --- .../stats/base/dists/planck/logcdf/README.md | 149 ++++++++++++++++ .../planck/logcdf/benchmark/benchmark.js | 79 +++++++++ .../base/dists/planck/logcdf/docs/repl.txt | 65 +++++++ .../dists/planck/logcdf/docs/types/index.d.ts | 114 ++++++++++++ .../dists/planck/logcdf/docs/types/test.ts | 98 +++++++++++ .../dists/planck/logcdf/examples/index.js | 33 ++++ .../base/dists/planck/logcdf/lib/factory.js | 83 +++++++++ .../base/dists/planck/logcdf/lib/index.js | 57 ++++++ .../base/dists/planck/logcdf/lib/main.js | 82 +++++++++ .../base/dists/planck/logcdf/package.json | 70 ++++++++ .../test/fixtures/python/large_lambda.json | 1 + .../logcdf/test/fixtures/python/runner.py | 87 ++++++++++ .../test/fixtures/python/small_lambda.json | 1 + .../dists/planck/logcdf/test/test.factory.js | 164 ++++++++++++++++++ .../base/dists/planck/logcdf/test/test.js | 38 ++++ .../dists/planck/logcdf/test/test.logcdf.js | 133 ++++++++++++++ 16 files changed, 1254 insertions(+) create mode 100644 lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/README.md create mode 100644 lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/benchmark/benchmark.js create mode 100644 lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/docs/repl.txt create mode 100644 lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/docs/types/index.d.ts create mode 100644 lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/docs/types/test.ts create mode 100644 lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/examples/index.js create mode 100644 lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/lib/factory.js create mode 100644 lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/lib/index.js create mode 100644 lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/lib/main.js create mode 100644 lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/package.json create mode 100644 lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/fixtures/python/large_lambda.json create mode 100644 lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/fixtures/python/runner.py create mode 100644 lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/fixtures/python/small_lambda.json create mode 100644 lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/test.factory.js create mode 100644 lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/test.js create mode 100644 lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/test.logcdf.js diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/README.md new file mode 100644 index 000000000000..fc2993ed17a1 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/README.md @@ -0,0 +1,149 @@ + + +# Logarithm of Cumulative Distribution Function + +> Planck distribution logarithm of [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. `x` denotes the count of events in a quantized system. + +
+ + + +
+ +## Usage + +```javascript +var logcdf = require( '@stdlib/stats/base/dists/planck/logcdf' ); +``` + +#### logcdf( x, lambda ) + +Evaluates the logarithm of the [cumulative distribution function][cdf] for a Planck distribution with shape parameter `λ`. + +```javascript +var y = logcdf( 2.0, 0.5 ); +// returns ~-0.2525 + +y = logcdf( 2.0, 1.5 ); +// returns ~-0.0112 +``` + +If provided `NaN` as any argument, the function returns `NaN`. + +```javascript +var y = logcdf( NaN, 0.5 ); +// returns NaN + +y = logcdf( 0.0, NaN ); +// returns NaN +``` + +If provided a shape parameter `λ` which is nonpositive, the function returns `NaN`. + +```javascript +var y = logcdf( 2.0, -1.0 ); +// returns NaN +``` + +#### logcdf.factory( lambda ) + +Returns a function for evaluating the logarithm of the [cumulative distribution function][cdf] of a Planck distribution with shape parameter `λ`. + +```javascript +var mylogcdf = logcdf.factory( 1.5 ); +var y = mylogcdf( 3.0 ); +// returns ~-0.0025 + +y = mylogcdf( 1.0 ); +// returns ~-0.0511 +``` + +
+ + + +
+ +## Notes + +- In virtually all cases, using the `logpmf` or `logcdf` functions is preferable to manually computing the logarithm of the `pmf` or `cdf`, respectively, since the latter is prone to overflow and underflow. + +
+ + + +
+ +## Examples + + + +```javascript +var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var logcdf = require( '@stdlib/stats/base/dists/planck/logcdf' ); + +var lambda = uniform( 10, 0.1, 5.0 ); +var x = discreteUniform( 10, 0, 5 ); + +var y; +var i; +for ( i = 0; i < lambda.length; i++ ) { + y = logcdf( x[ i ], lambda[ i ] ); + console.log( 'x: %d, λ: %d, ln(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/logcdf/benchmark/benchmark.js b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/benchmark/benchmark.js new file mode 100644 index 000000000000..daee4efec857 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/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 logcdf = 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 = logcdf( 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 mylogcdf; + var x; + var y; + var i; + + x = discreteUniform( 100, 0, 40 ); + mylogcdf = logcdf.factory( 0.3 ); + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + y = mylogcdf( 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/logcdf/docs/repl.txt b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/docs/repl.txt new file mode 100644 index 000000000000..0a948f2663f8 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/docs/repl.txt @@ -0,0 +1,65 @@ + +{{alias}}( x, λ ) + Evaluates the logarithm of 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 logCDF. + + Examples + -------- + > var y = {{alias}}( 2.0, 0.5 ) + ~-0.2525 + > y = {{alias}}( 2.0, 1.5 ) + ~-0.0112 + > y = {{alias}}( -1.0, 4.0 ) + -Infinity + > 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 logarithm of the cumulative + distribution function (CDF) of a Planck distribution with shape + parameter `λ`. + + Parameters + ---------- + λ: number + Shape parameter. + + Returns + ------- + logcdf: Function + Logarithm of cumulative distribution function (CDF). + + Examples + -------- + > var mylogcdf = {{alias}}.factory( 1.5 ); + > var y = mylogcdf( 3.0 ) + ~-0.0025 + > y = mylogcdf( 1.0 ) + ~-0.0511 + + See Also + -------- + diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/docs/types/index.d.ts b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/docs/types/index.d.ts new file mode 100644 index 000000000000..3bddfffabb08 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/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 natural logarithm of the cumulative distribution function (CDF) for a Planck distribution. +* +* @param x - input value +* @returns evaluated logCDF +*/ +type Unary = ( x: number ) => number; + +/** +* Interface for the logarithm of the cumulative distribution function (CDF) of a Planck distribution. +*/ +interface LogCDF { + /** + * Evaluates the logarithm of 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 logCDF + * + * @example + * var y = logcdf( 2.0, 0.5 ); + * // returns ~-0.2525 + * + * @example + * var y = logcdf( 2.0, 1.5 ); + * // returns ~-0.0112 + * + * @example + * var y = logcdf( -1.0, 0.5 ); + * // returns -Infinity + * + * @example + * var y = logcdf( NaN, 0.5 ); + * // returns NaN + * + * @example + * var y = logcdf( 0.0, NaN ); + * // returns NaN + * + * @example + * // Invalid shape parameter + * var y = logcdf( 2.0, -1.4 ); + * // returns NaN + */ + ( x: number, lambda: number ): number; + + /** + * Returns a function for evaluating the logarithm of the cumulative distribution function (CDF) for a Planck distribution with shape parameter `lambda`. + * + * @param lambda - shape parameter + * @returns logCDF + * + * @example + * var mylogcdf = logcdf.factory( 1.5 ); + * var y = mylogcdf( 3.0 ); + * // returns ~-0.0025 + * + * y = mylogcdf( 1.0 ); + * // returns ~-0.0511 + */ + factory( lambda: number ): Unary; +} + +/** +* Planck distribution logarithm of cumulative distribution function (CDF). +* +* @param x - input value +* @param lambda - shape parameter +* @returns evaluated logCDF +* +* @example +* var y = logcdf( 2.0, 0.5 ); +* // returns ~-0.2525 +* +* y = logcdf( 2.0, 1.5 ); +* // returns ~-0.0112 +* +* var mylogcdf = logcdf.factory( 1.5 ); +* y = mylogcdf( 3.0 ); +* // returns ~-0.0025 +* +* y = mylogcdf( 1.0 ); +* // returns ~-0.0511 +*/ +declare var logCDF: LogCDF; + + +// EXPORTS // + +export = logCDF; diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/docs/types/test.ts b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/docs/types/test.ts new file mode 100644 index 000000000000..8e9d97fe00c8 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/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 logcdf = require( './index' ); + + +// TESTS // + +// The function returns a number... +{ + logcdf( 2, 0.4 ); // $ExpectType number + logcdf( 1, 0.2 ); // $ExpectType number +} + +// The compiler throws an error if the function is provided values other than two numbers... +{ + logcdf( true, 0.3 ); // $ExpectError + logcdf( false, 0.2 ); // $ExpectError + logcdf( '5', 0.1 ); // $ExpectError + logcdf( [], 0.1 ); // $ExpectError + logcdf( {}, 0.4 ); // $ExpectError + logcdf( ( x: number ): number => x, 0.2 ); // $ExpectError + + logcdf( 9, true ); // $ExpectError + logcdf( 9, false ); // $ExpectError + logcdf( 5, '5' ); // $ExpectError + logcdf( 8, [] ); // $ExpectError + logcdf( 9, {} ); // $ExpectError + logcdf( 8, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + logcdf(); // $ExpectError + logcdf( 2 ); // $ExpectError + logcdf( 2, 0.8, 4 ); // $ExpectError +} + +// Attached to main export is a `factory` method which returns a function... +{ + logcdf.factory( 0.4 ); // $ExpectType Unary +} + +// The `factory` method returns a function which returns a number... +{ + const fcn = logcdf.factory( 0.4 ); + fcn( 2 ); // $ExpectType number +} + +// The compiler throws an error if the function returned by the `factory` method is provided an invalid argument... +{ + const fcn = logcdf.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 = logcdf.factory( 0.4 ); + fcn(); // $ExpectError + fcn( 2, 0 ); // $ExpectError + fcn( 2, 0, 1 ); // $ExpectError +} + +// The compiler throws an error if the `factory` method is provided a value other than a number... +{ + logcdf.factory( true ); // $ExpectError + logcdf.factory( false ); // $ExpectError + logcdf.factory( '5' ); // $ExpectError + logcdf.factory( [] ); // $ExpectError + logcdf.factory( {} ); // $ExpectError + logcdf.factory( ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the `factory` method is provided an unsupported number of arguments... +{ + logcdf.factory( 0, 0.2 ); // $ExpectError + logcdf.factory( 0, 0.4, 8 ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/examples/index.js b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/examples/index.js new file mode 100644 index 000000000000..bae7c5cd7073 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/examples/index.js @@ -0,0 +1,33 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2018 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var logcdf = require( './../lib' ); + +var lambda = uniform( 10, 0.1, 5.0 ); +var x = discreteUniform( 10, 0, 5 ); + +var y; +var i; +for ( i = 0; i < lambda.length; i++ ) { + y = logcdf( 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/logcdf/lib/factory.js b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/lib/factory.js new file mode 100644 index 000000000000..76c5ebd6bb98 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/lib/factory.js @@ -0,0 +1,83 @@ +/** +* @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 floor = require( '@stdlib/math/base/special/floor' ); +var expm1 = require( '@stdlib/math/base/special/expm1' ); +var ln = require( '@stdlib/math/base/special/ln' ); +var NINF = require( '@stdlib/constants/float64/ninf' ); +var PINF = require( '@stdlib/constants/float64/pinf' ); + + +// MAIN // + +/** +* Returns a function for evaluating the logarithm of the cumulative distribution function (CDF) for a Planck distribution with shape parameter `lambda`. +* +* @param {PositiveNumber} lambda - shape parameter +* @returns {Function} logCDF +* +* @example +* var logcdf = factory( 1.5 ); +* var y = logcdf( 3.0 ); +* // returns ~-0.0025 +* +* y = logcdf( 1.0 ); +* // returns ~-0.0511 +*/ +function factory( lambda ) { + if ( isnan( lambda ) || lambda <= 0.0 ) { + return constantFunction( NaN ); + } + return logcdf; + + /** + * Evaluates the logarithm of the cumulative distribution function (CDF) for a Planck distribution. + * + * @private + * @param {number} x - input value + * @returns {number} evaluated logCDF + * + * @example + * var y = logcdf( 2.0 ); + * // returns + */ + function logcdf( x ) { + if ( isnan( x ) ) { + return NaN; + } + if ( x < 0.0 ) { + return NINF; + } + if ( x === PINF ) { + return 0.0; + } + x = floor( x ); + return ln( -expm1( -lambda * (x + 1) ) ); + } +} + + +// EXPORTS // + +module.exports = factory; diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/lib/index.js b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/lib/index.js new file mode 100644 index 000000000000..5065cc5b230b --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/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 logarithm of cumulative distribution function (CDF). +* +* @module @stdlib/stats/base/dists/planck/logcdf +* +* @example +* var logcdf = require( '@stdlib/stats/base/dists/planck/logcdf' ); +* +* var y = logcdf( 2.0, 0.5 ); +* // returns ~-0.2525 +* +* y = logcdf( 2.0, 1.5 ); +* // returns ~-0.0112 +* +* var mylogcdf = logcdf.factory( 1.5 ); +* y = mylogcdf( 3.0 ); +* // returns ~-0.0025 +* +* y = mylogcdf( 1.0 ); +* // returns ~-0.0511 +*/ + +// 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/logcdf/lib/main.js b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/lib/main.js new file mode 100644 index 000000000000..602049b75d88 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/lib/main.js @@ -0,0 +1,82 @@ +/** +* @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 floor = require( '@stdlib/math/base/special/floor' ); +var expm1 = require( '@stdlib/math/base/special/expm1' ); +var ln = require( '@stdlib/math/base/special/ln' ); +var NINF = require( '@stdlib/constants/float64/ninf' ); +var PINF = require( '@stdlib/constants/float64/pinf' ); + + +// MAIN // + +/** +* Evaluates the logarithm of 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 {number} evaluated logCDF +* +* @example +* var y = logcdf( 2.0, 0.5 ); +* // returns ~-0.2525 +* +* @example +* var y = logcdf( 2.0, 1.5 ); +* // returns ~-0.0112 +* +* @example +* var y = logcdf( -1.0, 0.5 ); +* // returns -Infinity +* +* @example +* var y = logcdf( NaN, 0.5 ); +* // returns NaN +* +* @example +* var y = logcdf( 0.0, NaN ); +* // returns NaN +* +* @example +* // Invalid shape parameter +* var y = logcdf( 2.0, -1.4 ); +* // returns NaN +*/ +function logcdf( x, lambda ) { + if ( isnan( x ) || isnan( lambda ) || lambda <= 0.0 ) { + return NaN; + } + if ( x < 0.0 ) { + return NINF; + } + if ( x === PINF ) { + return 0.0; + } + x = floor( x ); + return ln( -expm1( -lambda * (x + 1) ) ); +} + + +// EXPORTS // + +module.exports = logcdf; diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/package.json b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/package.json new file mode 100644 index 000000000000..fa7fb92e5ac0 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/package.json @@ -0,0 +1,70 @@ +{ + "name": "@stdlib/stats/base/dists/planck/logcdf", + "version": "0.0.0", + "description": "Planck distribution logarithm of 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", + "logarithm", + "log", + "planck", + "univariate" + ] +} diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/fixtures/python/large_lambda.json b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/fixtures/python/large_lambda.json new file mode 100644 index 000000000000..e9eee202e27f --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/fixtures/python/large_lambda.json @@ -0,0 +1 @@ +{"x": [5.0, 9.0, 5.0, 7.0, 3.0, 6.0, 7.0, 1.0, 3.0, 4.0, 8.0, 7.0, 9.0, 10.0, 6.0, 5.0, 2.0, 9.0, 1.0, 5.0, 9.0, 5.0, 6.0, 4.0, 5.0, 9.0, 7.0, 8.0, 4.0, 4.0, 5.0, 2.0, 3.0, 1.0, 4.0, 6.0, 7.0, 7.0, 4.0, 7.0, 0.0, 1.0, 1.0, 3.0, 6.0, 7.0, 7.0, 2.0, 8.0, 1.0, 9.0, 9.0, 6.0, 5.0, 7.0, 4.0, 9.0, 9.0, 3.0, 4.0, 5.0, 4.0, 9.0, 10.0, 8.0, 3.0, 2.0, 7.0, 7.0, 2.0, 6.0, 10.0, 3.0, 1.0, 7.0, 1.0, 8.0, 2.0, 4.0, 3.0, 5.0, 1.0, 2.0, 5.0, 9.0, 8.0, 2.0, 2.0, 3.0, 4.0, 6.0, 9.0, 4.0, 4.0, 3.0, 3.0, 0.0, 0.0, 4.0, 4.0, 8.0, 4.0, 7.0, 4.0, 5.0, 3.0, 9.0, 6.0, 9.0, 7.0, 5.0, 1.0, 7.0, 1.0, 10.0, 8.0, 8.0, 0.0, 5.0, 3.0, 8.0, 4.0, 2.0, 1.0, 3.0, 2.0, 7.0, 1.0, 6.0, 8.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, 2.0, 3.0, 1.0, 7.0, 7.0, 1.0, 7.0, 1.0, 6.0, 7.0, 8.0, 10.0, 9.0, 10.0, 0.0, 6.0, 3.0, 5.0, 10.0, 1.0, 2.0, 4.0, 6.0, 7.0, 7.0, 4.0, 3.0, 7.0, 1.0, 9.0, 6.0, 10.0, 8.0, 3.0, 7.0, 7.0, 1.0, 1.0, 1.0, 1.0, 3.0, 8.0, 9.0, 9.0, 4.0, 10.0, 7.0, 3.0, 1.0, 9.0, 7.0], "lambda": [11.48827193433165, 12.798454667846233, 10.365638686852142, 13.641597361422045, 11.759709883647467, 10.940211333639073, 14.394810927333683, 16.982869757000838, 10.025846452073958, 15.030249971864798, 18.500630998647765, 16.076519689304444, 12.541116709838422, 16.876857878581227, 17.030742510449038, 10.988364468054696, 11.202354635117985, 12.942713675120894, 14.983785668676305, 10.567922697717005, 15.289768188369653, 16.840716263602502, 16.603958350964465, 12.558093358320361, 14.945078744955879, 10.50033399467875, 14.643891419036906, 18.513496335433157, 12.94584759455427, 13.843677907726194, 19.064887948544, 12.188208809259184, 14.511406562548336, 13.739776617486115, 19.517555323704507, 13.116070043006077, 15.755149727806277, 16.849786983005657, 11.260952604794586, 15.661138323876745, 16.04390312309414, 10.23467290628455, 14.38919368840515, 17.683282296548132, 13.242988571418707, 14.602525593543543, 15.47531289280661, 15.653369647573518, 15.708735660685385, 17.49341083881065, 12.526170772171879, 18.186901825586475, 18.796683777349756, 10.758616131418492, 14.903729835139938, 18.755385683315783, 11.479336998808977, 12.678586604867899, 19.294986361241552, 18.00805454637773, 18.301067614779818, 15.483645633404699, 16.300265500157685, 15.142006585112817, 17.225378565534992, 15.560115987450056, 17.727259866714018, 16.74739243341511, 11.174585528637081, 14.949986168250646, 11.80526474642171, 11.079408522439223, 12.764068562511081, 13.713477275658406, 10.941938167338288, 17.599991040006707, 16.84096295272932, 12.473691436397644, 12.913568818843398, 13.397580262335328, 15.99520106807972, 10.098056144454825, 19.9572340703411, 18.523616010956403, 10.376167285131615, 18.726928433964837, 14.641194740364586, 11.287864609411656, 10.693332926054705, 12.679971566226522, 14.169254257930838, 17.071008029247103, 17.72950392273546, 11.724283975275775, 13.592840118188619, 19.161086953788256, 14.771636494634167, 14.504599099704636, 19.77479755007323, 15.150773848744187, 12.621097397858822, 12.64709054326902, 16.107739089969183, 16.199742200625263, 10.225554256599914, 17.342188102891825, 14.47620360869449, 12.97960221083472, 10.348652093012987, 19.8041649811283, 18.559048437428046, 13.155941468559297, 12.023320057349821, 13.2861797074491, 19.538504007832348, 16.95813331468123, 17.583042655739824, 14.829565795217245, 13.866560362472967, 19.210350057192567, 19.036717243297208, 14.444387350052075, 16.55013797797946, 15.630410608511484, 16.714986629422278, 12.998862282019326, 10.090442371267772, 10.646702202051861, 19.407306093813958, 17.886487264755672, 16.46895184556133, 11.715503903553564, 17.45401062436336, 18.135402163608582, 12.950896238488058, 16.35536630535784, 15.186716326803982, 10.415869515615832, 18.266084996671896, 19.517743065212727, 16.84842818962082, 10.574057567355052, 13.07867081873642, 14.370587201258001, 15.69537659995902, 17.701938768337946, 16.517210860014597, 12.961360884144723, 17.344752746685014, 11.528794937515615, 10.41916455350304, 19.303553787878133, 11.159205486677646, 19.312403327733733, 17.510683134924733, 12.577212657696881, 16.517560681653237, 11.139489551200143, 16.83144344131533, 12.484215187641325, 10.213130498041561, 13.871347746952402, 16.455078261319688, 16.964376076948273, 11.299314203632534, 19.452945813496076, 17.56579947202003, 16.961526191667602, 18.98750497899419, 14.80846099591807, 19.483245989512646, 18.879533313296044, 13.142554598230339, 12.116833682107004, 18.039873505775248, 17.95673774572423, 19.729110696783785, 16.535938044161522, 15.395153662189822, 11.88924060463885, 12.236038157880998, 13.500368694576537, 14.409526112461542, 12.333929974385082, 14.039482608852964, 12.836538878615166, 11.699979761376111, 18.284596485828033, 12.16324606180284, 11.72950497474229, 17.622358703702872, 19.627776900345033, 11.407805341165263, 17.405795083802026, 14.675342082321706, 10.994865643597713, 15.864940736731729, 13.001818559790848, 17.668301347230532, 10.516529285525241, 13.542683238551607, 15.574981923937575, 12.317810373458116, 17.659070267267317, 17.090482390395284, 12.3593003802883, 10.176886490092853, 16.916966367046996, 18.503822403044254, 12.913086282143704, 11.61177513395612, 17.676712713889025, 17.214023177196488, 14.562390763717461, 19.60450551030327, 11.581441495280728, 15.845175550082203, 12.852188331406893, 19.014822936816934, 15.760311863723263, 15.62894964138194, 15.548698431334163, 11.233581607638389, 18.632620849601626, 19.818256619412075, 15.235028016810872, 17.444395376439083, 11.136449011968315, 14.448471077503015, 18.6710124481233, 13.248729557485579, 10.00585875475916, 15.748936833925864, 11.227631616880434, 11.17272087479254, 14.56053298546437, 17.74634002074473, 16.42978349748934, 13.784555755059946, 10.547363004702575, 14.904645634269823, 13.170154543910304, 12.15912988317967, 10.915093974112285, 12.718284865073343, 19.898105020172586, 15.510735351469673, 10.96638060230135, 19.60562265858521, 11.812811874797028, 11.998663109434828, 15.139238120226043, 19.850074432714962, 16.08068181406832, 15.294201474689144, 18.65640347411913, 15.4820479883188, 15.035426193567321, 19.690773220441674, 10.65110430753524, 12.163269810911487, 14.04091512101993, 11.78945380668443, 18.666556644771987, 12.893344252647424, 15.841714831277393, 17.434355994736226, 10.372106865480623, 16.083983049690787, 16.08393221533339, 17.402634876806818, 17.069650549637867, 10.603396013704234, 12.120802734972962, 19.718191248177302, 13.198517394561609, 10.539964895470819, 17.675959215912535, 19.758946135208465, 18.989403053860617, 12.25123529374681, 14.037450819943341, 10.992882249392512, 15.082824464256507, 17.383920108498756, 15.826011326916884, 10.803729590807292, 19.27185384934934, 18.829193345315996, 16.86225013600196, 13.376250763558375, 18.941829660892843, 10.227244607653027, 11.726210358515974, 17.093064842011216, 11.897742061464818, 14.393330637644468, 10.9588880455138, 13.238089729910067, 16.536161988152244, 10.032652644527952, 13.518069137572809, 17.338939333141617, 11.637505688296539, 19.83030650615444, 12.621736954326925, 10.993279169789297, 13.63978176693997, 15.998664484468465, 15.732264867123583, 11.447047272451153, 10.900402620865153, 13.69878471177135, 19.968745170917643, 19.66022617101054, 12.999129236715348, 13.240213261962328, 19.437607677006625, 16.955359754143586, 13.870061915234688, 19.908201319759236, 15.537684334051816, 13.95349030513831, 10.813405359607003, 13.73328440067281, 12.844165116301546, 17.32294333958692, 16.422583684702303, 16.177784342414412, 11.542320324451252, 12.966278781771575, 14.076030046058712, 10.417791496169375, 11.516575811621415, 12.397992570643716, 16.825905552230207, 14.010356248086394, 16.51834847163471, 11.848430228961597, 12.03431138361296, 11.501574619223586, 14.555908780986632, 17.683882477300102, 14.08009475279516, 13.942860601853553, 12.350961579173944, 13.656115497571644, 11.491414704989287, 19.215080802731933, 13.41936960688584, 12.55353211615839, 15.766566785135607, 16.781775811463, 14.411033724286266, 11.31211045969848, 17.39967772492027, 12.542181499721824, 16.75006255461481, 18.943989903304725, 14.044248466625277, 12.752632151542958, 17.695719283325396, 19.100601769406026, 13.25782498856997, 18.920004508982665, 16.832347438825, 19.69939602386185, 14.619360211115136, 16.430853598835792, 12.89556111365064, 14.60863364825325, 12.872881783307719, 12.77784392414383, 12.082522593748212, 17.53866232655725, 19.98195179323742, 17.890056133571523, 12.022952804488725, 12.567265301951338, 18.224521252028765, 16.34415009017964, 16.36814322993876, 14.637529639053882, 14.285825971616514, 16.24946537920679, 13.036045839746802, 10.171989854396879, 12.013235999343628, 17.707719809529884, 18.350068962022313, 12.913235599038416, 16.60115868987438, 17.582537126818778, 16.939412390096336, 14.485003431917475, 11.592909108300123, 10.080236389683186, 12.373371518870755, 14.508110774134293, 19.1012137530389, 10.038095486686364, 12.177348285912972, 16.201399642276613, 13.718400209078748, 10.070320457307046, 19.866472690353277, 15.209708730570314, 14.817110574814214, 12.26064112285846, 11.424335870726583, 17.50980550667491, 11.944216293085919, 15.374000833402613, 18.181869851830257, 15.455210522928523, 13.827465263779525, 12.347490503354742, 17.183614841355833, 11.554286279592873, 15.045111976048226, 14.76750414813906, 15.274956537212658, 10.916020153946691, 15.63152597820691, 11.687480518069876, 17.820798696353833, 14.000416287676218, 18.272429292166713, 17.107024840550668, 17.89233163006059, 10.989036150036043, 14.490490413276191, 18.061574112701166, 13.483735436543489, 16.08381517362534, 17.219498205663577, 19.80830158402198, 10.02912652132485, 17.01860671683496, 19.811208880357192, 11.977553866231212, 18.89919476302866, 17.333549016022015, 16.404537216353653, 19.087521030985748, 10.742665223939893, 19.03546320182144, 12.942922844634719, 18.2653454529938, 13.133063965713406, 16.242145799538257, 15.556919702086315, 11.402895419889168, 19.88789680656962, 10.61128473064923, 15.324066960344723, 17.32630489951361, 12.49418994394006, 13.650037698196074, 12.529265479427458, 11.374770944270221, 14.432865300494722, 16.558314008457522, 11.463157775551519, 11.111945186041275, 15.060726738704854, 14.040053829092521, 19.50255123464563, 15.0403340879005, 18.695140834308255, 10.07891831112882, 10.071281902718173, 18.173069121917727, 16.663905001933905, 13.858132260495097, 10.088591361033464, 17.938149106387733, 14.918540264223822, 19.106905929789043, 17.89373832467124, 17.96842196815281, 17.556364024375476, 10.256008469194558, 17.351642400806263, 10.311961914765366, 12.904807570512176, 14.327348044854102, 13.569273197368426, 11.150299878255698, 14.907558383213306, 18.778657938706225, 11.985428695116255, 15.83919869445151, 10.673177819991796, 13.971837925894876, 18.109106459127403, 11.707795532543862, 10.665899186285579, 15.1622845324454, 17.61241347449431, 13.864993841275435, 11.038247910834013, 12.113296079744014, 16.595572876046578, 16.773601461558606, 13.119323429982096, 18.896070871229007, 10.844398727134813, 15.894335578266105, 15.625449352080382, 10.118201698090768, 13.417839567572521, 11.635783040964524, 16.843385009147532, 19.843778678210505, 17.881394179719745, 10.697832253614393, 14.646580694562921, 18.24123674135741, 10.79298013357305, 13.080027905911592, 15.041457477199703, 10.682880321770842, 14.785560066410914, 18.512304385453078, 11.078780780996262, 17.302080899358593, 13.80957343943235, 12.174896898942695, 14.564221501909127, 16.09582531453527, 18.026506040468767, 13.237671388485879, 13.409239092104627, 17.65390190597619, 17.359847414731032, 15.62351014703945, 15.880360030801787, 11.680172339187344, 17.432951088841477, 13.392175548012048, 13.335041875921355, 16.490675490657317, 14.079486187654346, 12.575956754294623, 13.988416461353008, 16.155477014016697, 15.896890148439063, 16.022503033084654, 10.239412326732804, 18.253623576155356, 13.286445430739352, 13.766737904942719, 17.615575875973533, 11.977917129529704, 11.91702429751367, 12.520258933938475, 15.36555700266224, 15.574987101833544, 10.290365804057595, 10.560831022808914, 17.059609072713254, 11.657604712773546, 16.88808761426302, 18.5763051633607, 11.097599683870836, 16.780329097983742, 13.005486284340702, 12.363472063141515, 10.12312435433579, 14.620700475838897, 14.057383283335362, 16.543597637491775, 13.341021440013566, 17.885593526018923, 12.431350777978372, 11.253458688341825, 11.10846733316092, 12.913375623334048, 17.88066602533798, 18.65736524132084, 13.302417633804975, 17.198035836733656, 13.728065370067162, 15.254671614547709, 18.766578143511055, 16.324259321029512, 14.249378670062418, 15.166570959330926, 17.587276267556124, 14.588210015526332, 10.83223266228851, 10.748474706380296, 19.818022789115687, 19.749874880711747, 13.836260613760444, 15.723746556733289, 15.74243437933355, 12.979081433138598, 17.851332272896073, 17.47354797651643, 18.214864428561302, 10.243868689849235, 16.607043468863598, 13.719729364800452, 15.744936452674526, 17.222941132810174, 13.337539374113662, 19.590421697145516, 12.656166223514568, 18.513812238480966, 17.860160206530168, 17.003090245971766, 16.155052856017633, 10.313330869901646, 10.069451280545294, 10.419660478186533, 13.84211305749884, 14.152477163368538, 12.689110495191308, 16.674288496843317, 19.645288608006975, 14.513682432147007, 13.633571458544202, 12.868173478864755, 10.985833768417477, 15.585303586525928, 13.335218869828935, 10.621013330629989, 14.45399262383784, 12.263005526826314, 17.332301234763545, 17.908885898119102, 18.048209524690826, 17.544451149628017, 14.06509480501241, 12.35246214523277, 12.417800385547057, 10.221149557679933, 11.034026349048236, 10.071423645461026, 13.872498054819534, 13.707699137717256, 11.746877137935815, 16.74923237212147, 13.51742144105747, 11.881669353750706, 17.662188875551344, 16.992994253173904, 15.308889555982702, 14.314494349692946, 17.88822971820774, 16.87779978174918, 15.75651940523889, 12.355228980474411, 12.54613142728457, 16.96707627910196, 16.147766359135186, 11.2734490927209, 19.52081680536554, 10.772841606960805, 15.19478229449519, 14.547115863711413, 10.569427655105386, 19.36644564541219, 17.93680740495701, 18.561628445728765, 12.86042844086251, 17.419599676608076, 11.052714495429745, 14.96621496981718, 18.798615780424868, 13.963100986244205, 11.340142221598256, 15.981244454013051, 10.14264489212896, 16.772894267166652, 17.10041819841502, 11.910121297414465, 15.328148260272453, 11.13372400484372, 11.073180769075869, 17.33920295610723, 10.053519376365506, 18.464376395988108, 11.278981869577024, 14.59388559067171, 12.93791537114921, 19.022050395995528, 13.32716745003254, 12.195936755806866, 16.984817151433248, 14.045732639888454, 12.33021537600205, 11.223887155287107, 10.980269642533418, 18.415269079496987, 16.13660737140931, 15.983866692129013, 19.891078369624417, 17.664181100685607, 13.805272171941242, 17.111154258638443, 18.891753639326183, 19.041696619326633, 13.282146242131397, 16.088358802152275, 16.186459627148015, 15.756804005210316, 12.518526290208634, 11.827253947262246, 12.35576692050601, 12.35297454116396, 17.789876721365694, 13.944685917914775, 18.45679929885533, 13.64043830445348, 10.572810833589525, 19.817862794534975, 19.94983903273009, 17.531140924960894, 17.590480279627368, 15.56413542167067, 19.02053029760608, 11.796477788913748, 14.324547583103175, 13.316075864891532, 12.471774762777848, 13.057015760071629, 18.80959780429927, 11.858271116188831, 11.59682549522866, 15.09652120967402, 12.089044535570768, 18.492473940467768, 18.27496963946873, 17.604735477990623, 13.551678045212391, 14.581888311633264, 11.670308393439283, 14.810778829666688, 12.304038682603316, 17.405926756989373, 13.650681284766488, 15.649419418529682, 11.324997075996874, 17.449902014493208, 18.057774414095373, 18.733356988879624, 15.542426091291688, 19.41849155256648, 14.856525764684724, 10.049066296561406, 15.064786265964184, 18.004132849829908, 17.40829417853183, 17.102390109819687, 18.856237712027877, 13.822488643968262, 15.452415771391674, 10.084050211908014, 14.106538463126585, 10.705233756820032, 13.909406012403682, 14.483101833575658, 16.59260105147876, 15.385018279423555, 19.180849397128465, 18.907735768738064, 15.242092095944663, 12.074538728362949, 19.410555941778473, 16.964616283861968, 15.424576457654194, 14.206824069684554, 18.23156947723782, 14.863811452618233, 18.756392591100628, 16.92581161893385, 13.111490505962252, 16.221024118334384, 14.254993889471393, 16.88124225039703, 18.42335343144645, 12.251931263346833, 10.160219604218254, 16.197229294955157, 11.996032591032467, 10.507676105287636, 18.693309687670748, 11.31899245235324, 17.73545378532112, 12.926566319471824, 10.337365594375212, 19.33601752230166, 10.233196138762969, 15.30757777704708, 12.343578965844433, 10.278045336870102, 13.57476872403678, 12.276895811166511, 15.525730571249717, 12.457444084627511, 19.424095718000295, 17.592022929547582, 11.020967670962694, 17.475905876330362, 16.058330987416795, 10.546008847813987, 14.08974753358827, 17.144149591359472, 17.857223777587812, 19.60756874967967, 11.815897835600024, 18.63207921603931, 16.725232796074835, 18.554620887915533, 11.344878793706846, 12.933330599845698, 16.98418775749217, 14.58189118807278, 19.11040447221448, 14.627894505594071, 14.999477946997576, 17.249011441208317, 19.678277067544204, 19.26211057936491, 13.51299925768371, 16.20213234454928, 10.246693040659355, 15.216049433037599, 12.23082996696149, 18.477109507470463, 18.204253939463925, 14.220042579110238, 13.259282102925457, 19.316102774559205, 14.107739533112758, 12.683326546768741, 18.2617593825736, 15.92832118801769, 11.926242126389127, 15.645402548372417, 17.7443495568275, 16.3361735810222, 19.43668745069641, 13.40735490693641, 10.513013990854695, 15.874652099909166, 11.932367154953099, 13.420830927826284, 12.775758215327798, 19.518883600948058, 14.931115802480495, 10.02615352767496, 15.214838768463661, 19.798469557735665, 14.71854417831901, 11.374577196666722, 10.335925577325565, 12.830505623125216, 10.930392629983967, 13.568230125944783, 13.939630097200244, 11.906998513733345, 14.333001942991999, 13.901375172991225, 13.220771653053873, 17.876622825746214, 13.42721726373786, 12.269681539080295, 17.10057143714378, 18.98641776282198, 10.809652402656306, 16.53558288962355, 16.91246201002733, 19.232106762553585, 17.265217689660194, 12.2643289179043, 13.241299399618729, 13.81772876502174, 17.245037215394582, 13.385866336178315, 15.43754017220463, 19.39619760855755, 16.984385340068965, 13.57514706776156, 12.558868538826113, 17.892167025754144, 12.44840538666411, 10.444252191052637, 12.522604207439512, 16.154567383522313, 11.259987325898527, 13.143030190061086, 15.18638832160919, 15.077477563422006, 10.53173827222371, 18.977192545582934, 11.676635675862476, 14.794322438113673, 10.600795672742663, 14.426569900971366, 15.995121876313194, 14.550515913927807, 11.955160529668657, 14.279556653590518, 16.35381043565586, 13.785438395975286, 12.596409577530949, 11.944464531329128, 19.283367792336136, 11.639437623010371, 17.97983765531956, 10.717696693966188, 15.08105176622243, 12.791116411754839, 10.720877376802632, 18.58528081890258, 13.218999134690948, 11.351593733126135, 15.61980034039232, 10.30117312031787, 11.496393080549215, 16.992381146867263, 11.738043769017638, 16.593867018137413, 19.538085649410867, 19.87785010179163, 16.713006463295997, 12.066481185893297, 11.686513877010789, 17.98776378238582, 19.051014215645445, 12.278613139306636, 14.961467110424717, 15.796014794963003, 12.789236937750776, 11.293003075303202, 19.701246450050387, 19.636861108812532, 16.31502936820576, 14.8308393674508, 17.186097339310635, 19.036931858397324, 13.982623422460989, 17.21590403827298, 18.749903590789557, 14.225076911652096, 15.732289722424701, 11.123096341060563, 15.112982952395468, 17.729355516319885, 16.023579626290836, 15.996067698791014, 16.913417313250157, 15.778857085371026, 18.69204607642372, 18.450441371755748, 13.441615906903351, 18.05650663158024, 10.055179006804995, 12.115781361310024, 11.729231570063085, 12.692098118890106, 14.802483507722942, 15.841772887537168, 13.76661133083853, 13.177599723445041, 18.780687937095024, 13.698023157054124, 11.856354762813192, 17.196494023041346, 16.73702304871125, 13.44877908649745, 10.794106727523046, 16.203658562043017, 19.19403147360876, 14.534762142066132, 19.939300762767992, 13.571686382523788, 18.134832515396514, 15.955496574507944, 17.75254343113413, 12.882064117097187, 11.644464713232717, 10.782547039477127, 16.444416589455656, 17.958203566359437, 18.16769181309713, 19.221928508458788, 17.631700462183627, 12.587726970546658, 18.717246979189675, 10.037926418188706, 19.52827756291973, 18.525018985738868, 15.775308004904447, 19.07889160046713, 17.744264510202072], "expected": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.776356839400252e-15, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -2.5535129566378632e-15, 0.0, -9.67004254448558e-14, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.1102230246251565e-16, 0.0, -1.163513729807841e-12, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.0770141992021795e-07, -1.2890687414705697e-09, -3.1752378504284516e-13, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -6.661338147750941e-16, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.2263523530017e-12, 0.0, -5.551115123125785e-16, 0.0, -1.1102230246251565e-16, 0.0, 0.0, 0.0, -1.6941033035206296e-09, 0.0, 0.0, 0.0, 0.0, 0.0, -1.9984014443252837e-15, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -3.8437918818910696e-07, -5.020335691693048e-07, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -3.7402303476666846e-12, 0.0, -2.8824720388384484e-12, 0.0, 0.0, 0.0, -3.627450417377693e-07, 0.0, 0.0, 0.0, 0.0, 0.0, -2.6534330288541595e-14, 0.0, 0.0, 0.0, -5.654471337201914e-10, 0.0, 0.0, 0.0, -6.668721131087056e-11, 0.0, 0.0, 0.0, -6.217248937900896e-15, -6.439293542826115e-14, -8.972029789805798e-10, 0.0, 0.0, 0.0, 0.0, -4.365285910533181e-12, 0.0, 0.0, 0.0, -4.551914400963152e-15, 0.0, 0.0, 0.0, -2.6645352591004114e-14, 0.0, -1.424366424005794e-05, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.887379141862768e-15, 0.0, -2.351095246149534e-08, 0.0, 0.0, -1.3722356584367876e-13, 0.0, 0.0, 0.0, 0.0, 0.0, -2.2204460492503136e-16, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -4.773959005888184e-15, 0.0, 0.0, -4.440892098500627e-16, -2.708539939830755e-05, 0.0, 0.0, -1.1102230246251565e-16, 0.0, 0.0, 0.0, -5.506706202140928e-14, -1.9984014443252837e-15, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -3.061057190190014e-09, 0.0, 0.0, -6.8663963404227795e-12, 0.0, 0.0, 0.0, 0.0, -1.7483769988864883e-10, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.1324274851177238e-13, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -5.1958437552458677e-14, 0.0, 0.0, 0.0, 0.0, 0.0, -1.1102230246251565e-16, 0.0, 0.0, 0.0, 0.0, -1.743050148661511e-14, 0.0, -3.064215547965479e-14, -1.0347011627674136e-07, 0.0, -7.771561172376099e-16, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -4.130472631445448e-10, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -6.661338147750941e-16, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -7.3750088091564e-08, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -4.4408920985006364e-15, -7.149796565311335e-06, 0.0, 0.0, 0.0, -4.440892098500627e-16, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.746626900794667e-06, 0.0, 0.0, 0.0, -2.0039525594486082e-13, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -4.440892098500627e-16, 0.0, 0.0, 0.0, -5.551115123125785e-16, 0.0, 0.0, 0.0, -1.7555690250281803e-09, 0.0, 0.0, 0.0, -8.348877145181526e-14, -2.647826402614822e-11, 0.0, 0.0, -1.7907327858825763e-09, 0.0, 0.0, 0.0, -1.1102230246251565e-16, 0.0, -6.661338147750941e-16, 0.0, 0.0, -1.1102230246251565e-16, 0.0, 0.0, -1.884103983957871e-11, -3.445489275515374e-08, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.3322676295501888e-15, -3.33066907387547e-16, -4.773959005888184e-15, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -2.393098356560436e-06, 0.0, 0.0, -7.771561172376126e-15, 0.0, 0.0, 0.0, -6.069531545870411e-10, 0.0, -8.881784197001256e-16, 0.0, 0.0, -3.6191778548628673e-06, 0.0, -2.908784324518333e-13, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -2.0652501932972746e-10, 0.0, 0.0, 0.0, -1.743050148661511e-14, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -3.009714699731875e-11, 0.0, 0.0, 0.0, 0.0, -3.807807403447544e-10, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.1546319456101694e-14, -1.8973711490845725e-13, 0.0, 0.0, 0.0, 0.0, -1.2101430968414279e-14, 0.0, -9.124484987016757e-09, 0.0, -8.881784197001256e-16, 0.0, -5.158347303639386e-06, -2.2370993946199406e-13, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.333644306109616e-11, 0.0, 0.0, -3.3959265522646206e-05, 0.0, -1.5543122344752203e-15, 0.0, 0.0, 0.0, -2.294813228595113e-10, 0.0, 0.0, -1.1102230246251565e-16, 0.0, -4.4700312450098687e-07, 0.0, 0.0, 0.0, 0.0, -1.1102230246251565e-16, 0.0, 0.0, 0.0, 0.0, -7.89240254045801e-09, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.1102230246251565e-16, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.0162315433655544e-11, 0.0, 0.0, 0.0, -9.637174234491813e-08, 0.0, 0.0, -2.6534330288541595e-14, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -2.897682094271701e-14, 0.0, 0.0, -2.788880237858782e-13, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.6369461342114676e-11, -4.8183679268732955e-14, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -3.33066907387547e-16, -2.1350538676239774e-08, 0.0, 0.0, -3.6859404417561993e-13, 0.0, 0.0, -1.4355905784308952e-07, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -6.754152792632412e-12, 0.0, 0.0, -1.0014211682119413e-13, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.9503398896082778e-11, -1.7826062849647498e-10, 0.0, 0.0, -9.816586170597889e-08, -1.3100631690576932e-14, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -4.304865048984302e-06, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -5.551115123125785e-16, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -4.55846471681882e-12, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -2.5535129566378925e-14, 0.0, 0.0, -2.2204460492503136e-16, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -2.2204460492503136e-16, 0.0, 0.0, 0.0, 0.0, 0.0, -7.271960811295039e-14, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -2.4012841944698326e-07, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -4.661971917264865e-08, -1.1102230246251565e-16, 0.0, 0.0, 0.0, 0.0, -7.467040322185545e-10, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.1819613073051543e-09, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -5.77871084317561e-13, 0.0, 0.0, 0.0, -5.455591534235852e-11, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.9695356456852216e-13, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.4839098161211176e-06, 0.0, 0.0, 0.0, 0.0, -2.467627112903632e-07, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -4.546873988534714e-11, 0.0, -8.422151864809984e-13, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -9.992007221626415e-16, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.1102230246251565e-16, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -7.116203184810031e-10, 0.0, -7.20780102296145e-11, 0.0, -6.198204174057344e-10, -2.9465319073555996e-13, 0.0, 0.0, 0.0, -3.953504190690964e-13, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -3.785860513971856e-14, 0.0, -1.776356839400252e-15, -7.984249440460488e-06, 0.0, 0.0, 0.0, -2.997602166487927e-15, 0.0, -8.406463583501702e-06, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -3.622833536602759e-07, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -7.460698725481331e-14, 0.0, 0.0, -1.2767564783189382e-14, 0.0, -1.9761969838327982e-14, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -8.054919440174429e-06, 0.0, 0.0, 0.0, 0.0, -3.581690499749632e-12, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -7.686817849201893e-11, -4.3092196487085515e-10, -5.218048215738249e-15, -2.2204460492503136e-16, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.98729921407905e-14, 0.0, 0.0]} diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/fixtures/python/runner.py b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/fixtures/python/runner.py new file mode 100644 index 000000000000..fb9acb413c82 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/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.logcdf(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) + 10 + 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/logcdf/test/fixtures/python/small_lambda.json b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/fixtures/python/small_lambda.json new file mode 100644 index 000000000000..7d71196067f8 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/fixtures/python/small_lambda.json @@ -0,0 +1 @@ +{"x": [7.0, 3.0, 7.0, 10.0, 7.0, 2.0, 4.0, 7.0, 7.0, 7.0, 7.0, 4.0, 8.0, 3.0, 9.0, 9.0, 6.0, 7.0, 4.0, 9.0, 9.0, 4.0, 10.0, 3.0, 9.0, 4.0, 4.0, 1.0, 0.0, 1.0, 8.0, 9.0, 3.0, 8.0, 0.0, 3.0, 9.0, 7.0, 4.0, 4.0, 5.0, 9.0, 2.0, 2.0, 1.0, 7.0, 3.0, 0.0, 3.0, 8.0, 5.0, 0.0, 9.0, 0.0, 7.0, 4.0, 8.0, 7.0, 9.0, 9.0, 9.0, 6.0, 5.0, 2.0, 3.0, 8.0, 7.0, 7.0, 3.0, 4.0, 4.0, 3.0, 2.0, 2.0, 7.0, 5.0, 6.0, 7.0, 5.0, 7.0, 9.0, 5.0, 5.0, 1.0, 9.0, 9.0, 6.0, 9.0, 6.0, 1.0, 10.0, 6.0, 6.0, 5.0, 8.0, 10.0, 5.0, 7.0, 5.0, 6.0, 3.0, 1.0, 1.0, 1.0, 7.0, 2.0, 7.0, 7.0, 9.0, 3.0, 4.0, 0.0, 6.0, 5.0, 6.0, 9.0, 1.0, 3.0, 5.0, 8.0, 3.0, 6.0, 5.0, 9.0, 6.0, 0.0, 0.0, 3.0, 4.0, 8.0, 3.0, 3.0, 5.0, 7.0, 7.0, 8.0, 2.0, 10.0, 1.0, 2.0,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4.0, 7.0, 9.0, 1.0, 1.0, 0.0, 10.0, 7.0, 10.0, 5.0, 5.0, 8.0, 1.0, 0.0, 1.0, 6.0, 7.0, 0.0, 3.0, 5.0, 1.0, 7.0, 7.0, 8.0, 6.0, 2.0, 8.0, 5.0, 7.0, 9.0, 5.0, 9.0, 0.0, 1.0, 1.0, 0.0, 5.0, 7.0, 10.0, 5.0, 9.0], "lambda": [0.30830304479621806, 0.14274977924838517, 0.12688711143578885, 0.10758017849124846, 0.22917072226460472, 0.1066539862941151, 0.14475773498140643, 0.3980171522404479, 0.036877997659053086, 0.3464926470195145, 0.28771928965291416, 0.15803290424147293, 0.4005827006137605, 0.4548076345165267, 0.39266216593582737, 0.0825785949736515, 0.4737027355890948, 0.4084093096877464, 0.10152703267254487, 0.16949682228498547, 0.45319524100550296, 0.10477855984867457, 0.291387239299784, 0.15929673501208796, 0.28362973030860716, 0.04151960597089305, 0.28073821940013377, 0.38426822012075884, 0.14649083663510343, 0.3832497609550138, 0.29678973718844764, 0.03062331799898399, 0.35084697061035813, 0.37865524865130595, 0.3136620508839505, 0.06123051413594349, 0.3504099315542259, 0.12961040881479874, 0.008392187018566144, 0.33322975626677787, 0.4853607917622187, 0.23016272154656076, 0.30609352243833754, 0.4447014947123472, 0.45462476912457817, 0.4362509678619658, 0.111503041945545, 0.40034418872164546, 0.13653229757681262, 0.07428863368024385, 0.4340635246333843, 0.3874988555533108, 0.15858400904890013, 0.1928994282578737, 0.22388892651907688, 0.2951079482635557, 0.018436320774481818, 0.07742194246444084, 0.43673576890891913, 0.02888675231632115, 0.4004402467702195, 0.3521587762731515, 0.39572074477903824, 0.37748837247106404, 0.32863019152148426, 0.09729462378022813, 0.19656640761399158, 0.011303720106276338, 0.4139576938426236, 0.37183247918726553, 0.39574835454215684, 0.3379629757295122, 0.4095143656526782, 0.1299194920526286, 0.09839005808528711, 0.46690491596650435, 0.37542502889596924, 0.11791043529779383, 0.09250751298458187, 0.22696107175061608, 0.2519194858947354, 0.27791559502628144, 0.35675866203128637, 0.3844679855734584, 0.06559201188340552, 0.1616161285161834, 0.4731645990883329, 0.4608511299883844, 0.24104078904892262, 0.25529344614525973, 0.02512205897074704, 0.2772656275458782, 0.09723767886230344, 0.3385872889728319, 0.30983934116517065, 0.3446441114431949, 0.1929001496895344, 0.2587359945553486, 0.3487701632433245, 0.04087388299931355, 0.18049862491990304, 0.1403234564403334, 0.12444216444258388, 0.24346257236451824, 0.4400228309248817, 0.4134789125067874, 0.03082530776247505, 0.07142176761686131, 0.4962682720895084, 0.15846265818652994, 0.4006482476081337, 0.3315116812487655, 0.09795883361990948, 0.4640314285517196, 0.20591305292410517, 0.23644112015131608, 0.46305685480874076, 0.4808311714593914, 0.21601570819779087, 0.35393987052619147, 0.4246853291936112, 0.490910487868139, 0.017542164420987216, 0.009491556336083062, 0.06330548328952573, 0.3891075489258217, 0.3885919373798656, 0.3945561689406641, 0.2677517922221697, 0.41904886435751526, 0.43157407578676177, 0.10188954999947747, 0.4374058341303787, 0.34639435476734665, 0.045664990675605366, 0.4001497824607713, 0.49106866434250734, 0.2033737591103607, 0.1282145958119238, 0.327408090057884, 0.4476435599174165, 0.25642483693252704, 0.4492946311761681, 0.06312700030799312, 0.4487622879319572, 0.06520327798685999, 0.0364840714879201, 0.2823821241955445, 0.2732664482814524, 0.4076011037338625, 0.18153641528858877, 0.09560047343080075, 0.3637514525466534, 0.11976844204908849, 0.26399577725613466, 0.4968097383060108, 0.06457668434417096, 0.24774035093584257, 0.05989639357730947, 0.31820771430083633, 0.3474920546372544, 0.36710626519668027, 0.4575314610158496, 0.3425893260783442, 0.4486704916194913, 0.01545203687534491, 0.24905432161135954, 0.21574756387417215, 0.381287641801328, 0.35546635930634746, 0.28516445610655206, 0.15657584281737885, 0.37207707047609906, 0.4531148310764335, 0.08206747939798942, 0.1625957422357443, 0.3704004939932478, 0.15534558870339749, 0.02242365584707201, 0.07736877746774695, 0.4415349405765723, 0.2562743700318308, 0.21887734614555376, 0.23700161179896473, 0.013358919127757551, 0.35078776492399044, 0.06440991537363727, 0.19899855588776671, 0.15142707423426222, 0.10549248787177579, 0.02680447719061141, 0.24360484768168322, 0.04402700704523088, 0.441683561377673, 0.32452495153600536, 0.20277782002589267, 0.25147672461530335, 0.3619272463632155, 0.30168253755668906, 0.16531497322671568, 0.22639762081198955, 0.1262580192153866, 0.4138553561232387, 0.0869108067353771, 0.47061581205661795, 0.22577265110142597, 0.10104677715882326, 0.043388885945759514, 0.09090738416082944, 0.4103987487266639, 0.49031624147307945, 0.44958092961699103, 0.39341812827976036, 0.3939307533094942, 0.3070291238001346, 0.1353439863423037, 0.24101288431267015, 0.07155697196596705, 0.4472550306025745, 0.35472789320497045, 0.49063863090776216, 0.052268576807636136, 0.31768460158706924, 0.4358417338904829, 0.4798832093804706, 0.09891201964202195, 0.3526970407347692, 0.3044173024542465, 0.07219901319598737, 0.4566325156430866, 0.3290262523278308, 0.16383226540678786, 0.4126767960807502, 0.1517976779468887, 0.09796229116639882, 0.12921569744696998, 0.2693124081768429, 0.010022591713478468, 0.22195220834357732, 0.40090193313488326, 0.16813472377321304, 0.26548211086505363, 0.3131523875477046, 0.23567480608612829, 0.4009125035630749, 0.3442757406406897, 0.14248038587272233, 0.3351786760359136, 0.3769575239782849, 0.19592727995778653, 0.2383180777272495, 0.08799193880168066, 0.09320334924972384, 0.42156030024572827, 0.20149870826053856, 0.07875995048224999, 0.27085348388641767, 0.17551490329378605, 0.386968793589214, 0.23434464123079812, 0.46623974158387005, 0.14481925194013018, 0.0991542551101876, 0.018423766094115945, 0.3882848450620229, 0.3900044655284675, 0.14116436749745653, 0.08862753013044072, 0.48234746363525843, 0.14639805807691653, 0.3356806508514393, 0.03938253135192937, 0.3822346781309808, 0.4330741297724466, 0.1700804251848047, 0.1485928422518637, 0.2172648132084719, 0.39312317995786494, 0.1262699814906636, 0.3366618331532812, 0.351386810102187, 0.4452101673147856, 0.12904954552965542, 0.45279077223464864, 0.24398658630816578, 0.30800108343221877, 0.12414355219052875, 0.4309652012220964, 0.42595296029069274, 0.4695866152176274, 0.20641503632683528, 0.07377740703660318, 0.3195127374577303, 0.2581539959808019, 0.10031584211083472, 0.35863105269642737, 0.41419340766825014, 0.4819870084186964, 0.3099773975788953, 0.0776808423195337, 0.37502290402286526, 0.23623228873921115, 0.18956658580867014, 0.35346939488540513, 0.11949446922256424, 0.2798367670454251, 0.28256434975649364, 0.3764505184806846, 0.4484386111015889, 0.25050583186591896, 0.028863152241295653, 0.22545856996816083, 0.4156565633571413, 0.05049189533616688, 0.3750452392561451, 0.11882143128456263, 0.2903061735324763, 0.12631681651333854, 0.20413394972918703, 0.419702936938919, 0.1183579944973227, 0.3829673075804786, 0.4711261403837141, 0.3301991059488337, 0.4659689675587805, 0.188477606229129, 0.26223457762437186, 0.35018585423423315, 0.1337376920786063, 0.30877064824903366, 0.24636483175476054, 0.10266818313614506, 0.2821054166324824, 0.21318677142775921, 0.433546369809562, 0.16330294036160625, 0.22732906156938976, 0.10183924641642761, 0.2034405919906604, 0.06382931773548789, 0.19780951278292203, 0.26972686962545855, 0.47371891890509693, 0.18627961924312259, 0.05302981979799448, 0.4318094473484964, 0.16056543757237612, 0.11001001281831829, 0.4439790742268885, 0.4218229511458535, 0.1203915864510518, 0.20220181155044487, 0.4139466070498531, 0.11093519133303825, 0.021248783016080575, 0.4218614341255433, 0.498102395601659, 0.20061344709344286, 0.061505378361012664, 0.02083484414514214, 0.20276390812560852, 0.07346844190160268, 0.17689782531525072, 0.4819077870158263, 0.020663536208910704, 0.2542408070857983, 0.28663517805103494, 0.31328002395906657, 0.2332799388614758, 0.3702401963104198, 0.385570444697542, 0.10590955007554315, 0.12025467614829682, 0.13906823221395898, 0.21579435828226723, 0.42975358999142405, 0.18480999410263632, 0.4447175125359321, 0.16118792072309918, 0.3840329055539622, 0.18378502494509963, 0.21261349270538826, 0.1490177462951479, 0.47273950211900706, 0.3722785149914568, 0.156459025021355, 0.27933666203280416, 0.1252205771347984, 0.24567925468182178, 0.39887845989501186, 0.4060628019249382, 0.33782787329095043, 0.25619497748433273, 0.3502202793464364, 0.3425547518862921, 0.2643278023348169, 0.49547779330747277, 0.44852269938241884, 0.29281146787585505, 0.003729316844119923, 0.11990776475435083, 0.3387436939528765, 0.30012179550056317, 0.48003386887342003, 0.038251150129952116, 0.47388845921452527, 0.3062055813188606, 0.09750770951146998, 0.052584295541873605, 0.32890842390106073, 0.44279280055010767, 0.443090381251753, 0.002997617102275807, 0.013525794341941677, 0.03490159975929663, 0.3091419952337083, 0.3162552465057637, 0.37932597863689965, 0.44573642131126673, 0.17359421132419656, 0.19414604616276793, 0.07074159113107154, 0.432517966389333, 0.45507543378075754, 0.31370663273075405, 0.10507200350621815, 0.37955761116148024, 0.34502299580857443, 0.4855507421262535, 0.4427977841539085, 0.4419386253917843, 0.36546438701827627, 0.08814648999390845, 0.1414221699187851, 0.44547549989536656, 0.25634140330306404, 0.1648604316836234, 0.03118597691510916, 0.49318245316654463, 0.43669382109110866, 0.4252849769273478, 0.055229559947271134, 0.30559584015768604, 0.10407758584716986, 0.24003242153600002, 0.12031573697105236, 0.15881807073570053, 0.024074975614243543, 0.19021772218553834, 0.07438550403177663, 0.2515187203334762, 0.01950628655813197, 0.43160721993283685, 0.0701884955562444, 0.47647107267848643, 0.0021650354915648817, 0.359012234500253, 0.1731962699305632, 0.45536587657132244, 0.33729044670852193, 0.2355639415421315, 0.21731002632669172, 0.3069125780543201, 0.0468437965053316, 0.3446227547671951, 0.17112309750318327, 0.47408377776856064, 0.3893133796603212, 0.40410513989869445, 0.4154149725947468, 0.20245976519767628, 0.10097372300346974, 0.001552004446712718, 0.4931804683908877, 0.29400273700424007, 0.025562226943210642, 0.4352068510220451, 0.2090212815562143, 0.38202701105918546, 0.44741215215930746, 0.03155875202064501, 0.2855324687240172, 0.47769316864917727, 0.03627244339483188, 0.03453650963273136, 0.3351529519488261, 0.3836401486123962, 0.3133804393655481, 0.3126407061877377, 0.016325647233454754, 0.46999661153650263, 0.17524203223164098, 0.14954314880907144, 0.033234699849970295, 0.4070892010848597, 0.24904611766153412, 0.05379448405705384, 0.29262521429305627, 0.17940120620949918, 0.14384223982670336, 0.2033557779300304, 0.38108512981527953, 0.17832098635054017, 0.32218025025110464, 0.455647040883694, 0.23332906296501216, 0.4031645166539136, 0.32012704441590656, 0.15507663819256146, 0.09600508231475441, 0.40051640153852286, 0.3329456651846833, 0.3895238060472168, 0.058620051772226844, 0.3577912713752993, 0.027820584497488032, 0.27482951873751355, 0.1067171434539248, 0.33840116620654015, 0.3304073375381037, 0.2680451890633681, 0.2765628336057374, 0.13247670116295895, 0.00838555364532173, 0.08369607933752593, 0.02857593366744532, 0.041810869767725356, 0.3280896867305268, 0.12100211020860058, 0.13741292985004294, 0.1969903492353206, 0.00291515518039559, 0.25881303298275304, 0.41925956813038134, 0.20162969620659887, 0.03968010835227198, 0.28406837564841186, 0.0383019978405163, 0.27703746613531, 0.0019107942726236393, 0.18857430960447352, 0.491412863544804, 0.05007483251658035, 0.4118180002889562, 0.30270490220051843, 0.03979702487537912, 0.291140946219772, 0.01120557833287289, 0.09711378503662432, 0.20071038096378052, 0.44548656218288285, 0.06752417300772828, 0.041967813017091515, 0.19339626524679365, 0.4229164729482492, 0.024393695498639678, 0.46993256158605745, 0.46417112846803094, 0.3487198036579335, 0.34777913895742046, 0.3991482859268255, 0.45951969050298974, 0.11001024581448487, 0.3392040285424986, 0.48197734121019314, 0.2215987254791955, 0.2660494522292161, 0.47000284635110295, 0.10288726227812639, 0.3131393679370595, 0.2435435190702671, 0.29438945762444624, 0.08319886071457155, 0.13680943618202568, 0.005481488174919613, 0.42944399986556614, 0.33080589298999097, 0.23128365183447824, 0.362970831000763, 0.22541861590791573, 0.17020188789387264, 0.2916106321989387, 0.27771829130653397, 0.4494877307353446, 0.34916788277164984, 0.19980142821086777, 0.27521704917357337, 0.36851746066133595, 0.023612382821026345, 0.4510601333383883, 0.018468687525329153, 0.009368595147662917, 0.28596710372469303, 0.43327199966603064, 0.45055621895150794, 0.21388145527101105, 0.2541033989631543, 0.31692561863226143, 0.059735111429117194, 0.2049606322188089, 0.37380830034752277, 0.024241935560636085, 0.4836250951973247, 0.3180402602742014, 0.17958324881974524, 0.35727321358968983, 0.23584716687322532, 0.00307202917054078, 0.0012965728206402183, 0.4459177412075296, 0.2892251356547777, 0.17953324934204906, 0.06140077002459776, 0.4792135791958711, 0.22796715185893096, 0.14771998142673748, 0.03879305318693865, 0.45366124547668835, 0.1343324996589877, 0.3116212414553921, 0.2539477589194624, 0.09025581570052371, 0.045138438780837176, 0.005259300500602859, 0.26577208801512553, 0.330232258117476, 0.13621824348003497, 0.24013107900141956, 0.03671035247115584, 0.0183189870850477, 0.45378767208261417, 0.16208860414329446, 0.030625660083428874, 0.012344296765644192, 0.4204357802647204, 0.2759722082761378, 0.4963367939065104, 0.4747541632268979, 0.37322863481494895, 0.4469840681248975, 0.0394271227582384, 0.21384052299731976, 0.16224195270894087, 0.04311252974619956, 0.40429219451866605, 0.01884920164989473, 0.28750406275233537, 0.03154876463162504, 0.21022320812730866, 0.2898961911752012, 0.39078348839646787, 0.007541612071833237, 0.4615956556859283, 0.3236390435950074, 0.3957152603531925, 0.4882912890487089, 0.10271155467442433, 0.42876074996659963, 0.1577908276391543, 0.15424512010089797, 0.06979880869845767, 0.047382566958447114, 0.42401607643401057, 0.19208983683653752, 0.4856708612313007, 0.298877062392847, 0.27770752169002133, 0.16398796483601924, 0.16888472595300863, 0.41467964880904096, 7.878343177114555e-05, 0.2073738327173475, 0.44763289392393635, 0.23519111833871276, 0.15703393398241228, 0.4304156521024631, 0.3932618010965882, 0.35105488155127607, 0.4717968511409812, 0.02316840831709438, 0.06752644712356792, 0.23432752927697864, 0.21992689095221712, 0.04101509179078566, 0.3521617972412432, 0.26404616756511534, 0.4540489093575621, 0.042190726641449516, 0.16487082576954504, 0.4969861935043495, 0.2870364090501656, 0.3900482286290008, 0.37181387516600817, 0.0639614659434849, 0.2418756754938206, 0.2453710846422128, 0.1782610254285616, 0.11974233355662489, 0.0649836070426919, 0.19802743290842129, 0.17793206267839112, 0.2516481391596677, 0.3844323528422842, 0.38309302704559445, 0.47943970729347096, 0.29757975804292586, 0.1106241952825896, 0.172876205613416, 0.10032950852054356, 0.35845029285172564, 0.32997544873103446, 0.16130435895273337, 0.14910070930636343, 0.4427420645928367, 0.023049396958365054, 0.4259732229474531, 0.1824343055606028, 0.39501526862913405, 0.10420424140929929, 0.3616407061795217, 0.13331178548200046, 0.34131367403949936, 0.34714027052457347, 0.2438982541996057, 0.30082490989668476, 0.46024668639301425, 0.08933573504207243, 0.2874768949809389, 0.0469212338134124, 0.31158472418935257, 0.13115087291187816, 0.4402976481906471, 0.06732545559776154, 0.011864307647747374, 0.40711622412057913, 0.027561880712476117, 0.07845489529339761, 0.07706649318185449, 0.3948229383980616, 0.05032129440554034, 0.4519880859375949, 0.10020188078659548, 0.15362777826438556, 0.36150338778554736, 0.16208318187623527, 0.4961539351239876, 0.19769950914943274, 0.1285835571515836, 0.4675041617173258, 0.29764552259523974, 0.05972190342333816, 0.3413042772855992, 0.15640571787026225, 0.26026158135902827, 0.03764620213972708, 0.049999736642403536, 0.4643075572461972, 0.1324839358485489, 0.41150650006785394, 0.43369251687380317, 0.031121751485782334, 0.13646548348172322, 0.47250448466712675, 0.11611716997181204, 0.08399609865524366, 0.36892499557897057, 0.28424125840587744, 0.2884646648477095, 0.0355282335516392, 0.4362876131009342, 0.3820690164188779, 0.2997649983980072, 0.21085391684839483, 0.1189257591290927, 0.23893046748759428, 0.46751964594043965, 0.23141540908754532, 0.36208783221006646, 0.420241180655937, 0.4237422248778976, 0.18200106291944873, 0.42157148480606665, 0.052311460511879626, 0.2930774907632757, 0.2303289398514461, 0.4238590381765124, 0.43087767515142633, 0.47870586495376816, 0.4701437347988417, 0.16575655219460944, 0.035468093011022495, 0.39986160906335505, 0.44850115685111863, 0.40251310303809135, 0.00809655189185271, 0.1645078277849718, 0.2989745839619988, 0.08718138049745794, 0.3849092386551711, 0.3146434975707069, 0.34079046515686534, 0.04378995520108181, 0.3277218075177952, 0.33426290794704655, 0.14638918582874078, 0.18238517660163994, 0.4516382968159331, 0.016505112424164026, 0.26529092804915444, 0.3193074704316567, 0.2824048038833107, 0.24094737907768315, 0.42637226473286993, 0.006502277031825376, 0.20970168276922807, 0.3212962740211856, 0.1725366480986152, 0.45282808798028723, 0.017878619410453822, 0.10922450920821314, 0.06201985091866591, 0.25636713260366417, 0.2378184290039469, 0.20653335887282415, 0.35088281090113715, 0.3758170833295139, 0.30106795228089456, 0.35090584197697805, 0.19901576956316674, 0.3968938906264042, 0.42008571967893227, 0.19619758796578696, 0.1534850520865555, 0.399896301306778, 0.1060305185301017, 0.36985788347355336, 0.21188883263255193, 0.4821314210982306, 0.039254205067711434, 0.4902229884740872, 0.427156240350646, 0.37530944527362836, 0.11953999923161052, 0.3087463139290878, 0.15363210415253287, 0.010666624060225172, 0.44284553904166524, 0.40940772290867605, 0.04788203148631226, 0.240877435260557, 0.001921711102337853, 0.2625853313906399, 0.1407355186348091, 0.20963650726937094, 0.2973530491831846, 0.16099911699246705, 0.3430765336819749, 0.11016782559770993, 0.3332635815029904, 0.4956670787889132, 0.42975017070592686, 0.22869533600637415, 0.3554475278360722, 0.2711409508172063, 0.05569114842532635, 0.1710381193078644, 0.40781998711940354, 0.2697020717220193, 0.019804000120141496, 0.17632986353043806, 0.21351910224208326, 0.32975029842230363, 0.35923043864915694, 0.14909732802111691, 0.4551950025339318, 0.06217321033158396, 0.08733186375817548, 0.09140968841889563, 0.0464799221160051, 0.30296140569457547, 0.4492136360073046, 0.046393470129505954, 0.16756549394017745, 0.33734555231199037, 0.20485955554322105, 0.1337501292896981, 0.4347739909229338, 0.23473516070988493, 0.4173644569311168, 0.3496384683246855, 0.37318434652234456, 0.2049995604447044, 0.4784757462459496, 0.14671404533080523, 0.3386988103398673, 0.4388541691136087, 0.08452518380020269, 0.3785007334183263, 0.291443065661747, 0.41583554493989955, 0.08159597150573772, 0.08837331674135951, 0.15759773173613795, 0.3583422813945085, 0.4570241832347339, 0.49068039836164096, 0.0021582164558551775, 0.15945919481218052, 0.24523205708771373, 0.32596096983478773, 0.1445496472997086, 0.32112615818743767, 0.3267107606280389, 0.2255452871595945, 0.2544402683629105, 0.2369210167627937, 0.29376031219720833, 0.2630368282995297, 0.15676185913372925, 0.14759862992273265, 0.3899551825222894, 0.4099339193601006, 0.16953971170111404, 0.17311182090768684, 0.058231809132514634, 0.31980360100891086, 0.4920640051290929, 0.14608871293703707, 0.11673407983327172, 0.2081255835561085, 0.4131741595944848, 0.3496488720517287, 0.4254462626468019, 0.47407427933089835, 0.12600661963840665, 0.07323511518663417, 0.44170644052860464, 0.15751658887557463, 0.3465297291518527, 0.05875394497882991, 0.057796608494633916, 0.41918973592705255, 0.3940181418351187, 0.4361949425012765, 0.1444594306003063, 0.4070910982139196, 0.28540840605214196, 0.042388576975360914, 0.10749822844107387, 0.2776311162501848, 0.41504768350933746, 0.2810870557267198, 0.46054616897710204, 0.26436350534887293, 0.4889546768378354, 0.19530190452202795, 0.2708926801164322, 0.4692512393309253, 0.0005254432559569922, 0.37448513928441474, 0.3221319037101078, 0.4569569029202951, 0.3156623608290198, 0.46907438475037416, 0.42978150957049605, 0.32034233163382225, 0.4821248705353047, 0.45405046688352063, 0.4407448507246695, 0.19016768690595431, 0.038523302004576265, 0.0400970056498674, 0.08232018351002213, 0.3518963021528374, 0.04378382986242085, 0.41363385853365087, 0.06427077725448543, 0.18423932633259837, 0.34645973467258606, 0.19103000494760147, 0.42563381510067966, 0.2686902729164408, 0.3053174055066934, 0.2388453809321397, 0.18504566950348011, 0.37883674135000633, 0.014272506936232554, 0.11110451285643408, 0.05111443557934786, 0.24354949188500724, 0.4041106543997935, 0.1123012805828219, 0.24037420833991968, 0.45428292152207883, 0.07741866273219461, 0.0824992318313526, 0.005518338615168594, 0.28497858185826624, 0.35058771210781936, 0.07857732385509919], "expected": [-0.0887086480022185, -0.8323188951777934, -0.4499928947010203, -0.3656310568118551, -0.1742040636513409, -1.2952721291472198, -0.6634167404842949, -0.042295956951725264, -1.3645866197659609, -0.06458170578914092, -0.10545286669544189, -0.6047153924379295, -0.027557034804346948, -0.17691675495619605, -0.019906983492187495, -0.5760589588624164, -0.03697592878039064, -0.038855341879543016, -0.9210955897464311, -0.20285705014883107, -0.010817951917028432, -0.8970046537499355, -0.041393379191836284, -0.7524255711714279, -0.060432189800604906, -1.674155571320889, -0.28194977140173405, -0.6230451862849408, -1.993143830659786, -0.6248096512787109, -0.07168459264226283, -1.3326206318463119, -0.2820485519145472, -0.033671320863479015, -1.3121741964179874, -1.5267780815695362, -0.030535342544814586, -0.4378199613510514, -3.1919233156496154, -0.20945448073583384, -0.055891144159866096, -0.10546700315404442, -0.5095012630983335, -0.3057020525338866, -0.5155474481288386, -0.030975460315178473, -1.022140207309845, -1.1089334767635313, -0.8655676777713468, -0.7183145352146942, -0.07682584766400254, -1.1355431480052904, -0.22913105409441376, -1.7404860930541797, -0.18245121862164518, -0.2596198964337831, -1.8780245786563532, -0.7727976446220859, -0.012765851128149475, -1.3827464174950947, -0.018403492298686586, -0.08883052521681348, -0.09769810774006549, -0.3889589703499929, -0.3127988969758106, -0.5388658950139604, -0.23258704060281987, -2.4480560255575137, -0.21187400074004903, -0.1693694905343546, -0.14878203083260788, -0.29943165203002614, -0.346326856249876, -1.1307856024095457, -0.6072512502208308, -0.06264505833471246, -0.07496555220007158, -0.4932269252489134, -0.8534248208084805, -0.17760368869717733, -0.08395178685965889, -0.20914139749322205, -0.12509838629002915, -0.6226998815032282, -0.7318138618941683, -0.22146974754914667, -0.03711810031652587, -0.010016644112128052, -0.20459302908746038, -0.9166489359827338, -1.4211051635027931, -0.1549949582641555, -0.7057884171322071, -0.1405681534083523, -0.06348317303887438, -0.022829720018339616, -0.377318015211887, -0.1349036718273291, -0.131662715507441, -1.391003782672478, -0.6651087495270146, -1.4077017665729528, -1.512629553119719, -0.9532478887872807, -0.030040768652484593, -0.34144558807994135, -1.5207463524279958, -0.8318320828311989, -0.007018712958401287, -0.7561826802973456, -0.1449070964239455, -1.2652730930507592, -0.7006382245370842, -0.06376996120824163, -0.2699709558396996, -0.09872108759121768, -0.5043301717093978, -0.15796501948630215, -0.3196521330529761, -0.04223889824971909, -0.20201044860097586, -0.03271038045013647, -2.303553375848926, -2.4018500256830326, -1.027273569026984, -1.1321526845567635, -1.1332375367112872, -0.2311015014399653, -0.30404295945038967, -0.023287969283191167, -0.19594461282041106, -1.0944392023168747, -0.07524167254980911, -0.06463418655365064, -1.1840871584364097, -0.02766611564860823, -0.26031275412566074, -0.11290722087593166, -1.4863789736803064, -0.469167552108975, -0.18255877137121196, -0.24167977752018466, -0.522803114430176, -2.1319224420966143, -0.007206411773005497, -0.9003054553177801, -1.9966660588813556, -1.4023648560448665, -0.2944256578106831, -0.21796989938766206, -0.41019530644206204, -0.5498974996247193, -0.056015052620807804, -1.1978620197621297, -0.8910820052788853, -0.006980679105294857, -1.736591277901189, -0.25641073845397544, -1.5462468334784556, -0.7532920252540886, -0.06405058777001887, -0.0257788493296511, -0.1070329983477531, -0.03306075246171495, -0.04421607521870483, -2.598957925857233, -0.19228474394324424, -1.0485007899580954, -0.160883512696558, -0.27610077515385284, -0.059483872663084546, -0.23436818124633985, -0.1134643469622396, -0.17823251160218, -0.8278263290211354, -0.9518751602657669, -0.024932967423912624, -0.6160165209828989, -1.5205398786273165, -1.9423961129344118, -0.30912094404977275, -0.10492986357947992, -0.09433984034234863, -0.9741986067017467, -4.322243041469066, -0.2821257310862802, -1.2897568001427788, -0.1824761216718972, -1.007595380892075, -0.48932607677756873, -2.952723898899158, -0.6568472948329978, -1.3271820197382447, -0.04648467336810084, -0.21987383274271366, -0.14113467793979714, -0.9282164234461348, -0.41194264927605706, -0.12899612172403932, -0.3098772744535709, -0.7072989806543075, -0.759084331446508, -0.0871728526105302, -1.4717958624128493, -0.03779907381665166, -0.17946200034119153, -0.5898361783574756, -1.2266507334829369, -1.432565696159533, -0.08908347811347267, -0.47012170987261837, -0.06975177553008031, -0.04391641198617466, -0.09880690190716031, -0.08965930750459637, -0.5868806279253297, -0.26852310673873964, -0.6712164052777879, -0.04466633588475186, -1.208530719951513, -0.012159138290655076, -0.9801403628210642, -0.32937156879308177, -0.12005801813487683, -0.005112021370977125, -0.9411961059934701, -0.04272430705386481, -0.0916418344109861, -0.8238213268006294, -0.29320797205074167, -0.7295184294358621, -0.46870727052076494, -0.02467963859167484, -1.3400197312729836, -0.6101190371280826, -1.1352300161025082, -0.22154086967059625, -2.5632945293355536, -0.11503048314501235, -0.5951481922228659, -0.20594609768711913, -0.3081065706981801, -0.4956742220017853, -1.5608265621836221, -0.3572048229824798, -0.13551658727202615, -0.460213199815124, -0.035649688505837385, -0.16471110506090292, -0.12316248243014459, -0.12452533958848436, -0.4778352503128104, -0.8478256939783921, -0.08306630515371383, -0.17803186408063854, -0.6776972576433022, -0.05216094667821075, -1.2172700582931133, -0.15600700803533793, -0.4970101389592566, -0.005942249557562188, -1.043033044688165, -1.357513480424568, -2.430381761773728, -0.6161512994700501, -0.3715895927537711, -0.27937311506394014, -0.5985411262272553, -0.03476655807936366, -1.0343864734465595, -1.2547446786777328, -1.7218362572595183, -0.24432326112137334, -0.020497840199332235, -0.44694509509139163, -0.6456945640389108, -0.15258050641143245, -0.04402247635314554, -0.9249716562808541, -0.03511552467590467, -0.062023430875010686, -0.02880186987216214, -0.32176906546255196, -1.0101925867567592, -0.4729448595865183, -0.24128198776324952, -2.147746411663486, -0.05019891088601744, -0.014229710885898202, -0.00572684384728246, -1.084043117033881, -1.1760448509598116, -0.030210280487186023, -0.07867250214688774, -0.6841648799025488, -0.01954205509353823, -0.016019718482200015, -0.008100556303974923, -1.3222442120488, -0.6159479946026534, -0.07518501454430852, -1.558731671216469, -0.6320105078073627, -0.6795431951332789, -0.4172504782424878, -0.15200901390456392, -0.061099645260429665, -0.25082220922758874, -0.18192303890516429, -0.08519938499856346, -3.5595863709610094, -1.0134726322880383, -0.338798978151767, -0.925216673598948, -0.1113457463017699, -2.188956002955908, -0.8199711058112414, -0.6323327171505493, -0.34787856165177095, -0.13083611364739464, -0.42258789602523444, -0.38123794818617657, -0.03766171473402973, -0.0525693287038657, -0.009514520369627431, -0.8395940846990765, -0.1309253352515456, -0.28291174551963943, -0.5946423724645418, -0.7749402926928993, -0.3449720840680494, -0.7767366597785309, -0.8412037946359704, -1.0580629030266684, -0.19424508894659986, -0.3157891197181715, -0.38697763614448355, -0.5847699352232789, -1.0957861385734455, -1.7471470048796585, -0.3641008943069021, -0.3005573164159328, -0.16291550746783445, -0.20705409388458973, -1.1708601877817935, -0.07791375788867534, -0.26882775173849777, -0.7273666129474654, -0.018563756984286334, -1.0666780962071984, -0.7934939556863142, -0.27816138290072984, -0.03714001487686771, -0.8539224913496319, -2.2946694206934337, -0.12933676554303, -0.08650335626492775, -0.7936363896278917, -1.5228263803427242, -3.881527829594668, -0.3513186871385341, -1.0314618354984622, -0.22753040980072306, -0.05709521662330228, -3.206829860881197, -0.10697540415998984, -0.10642207578523433, -0.7644864728460015, -0.2832598357509159, -0.647953511387309, -0.06964295615696489, -0.5596318830747896, -1.5428419423418043, -0.3985704578486846, -0.41543193268368694, -0.03265538654282468, -0.4003803835495548, -0.011780725143152428, -0.32214588690115115, -0.021720726190691455, -0.8584193784194483, -0.255869976598642, -0.3617884650558109, -0.023042454593087798, -0.6442515735393429, -0.7653181327244749, -0.11319663777026853, -0.7650115030888119, -0.11606043124559375, -0.1462940150703195, -0.011551724811203123, -0.29962037345416176, -0.1378740455727965, -0.2828667232326768, -0.02336673963133051, -0.22909842452245954, -0.05251134820236539, -0.01133836503475769, -0.05498198786349294, -3.4110406238752575, -0.48317076879284154, -0.20313833157520614, -0.05100540622202974, -0.48267063902396384, -1.7482479625214526, -0.09820051572922328, -0.09027953669421113, -0.5374987347786601, -1.1778335843872998, -0.3123904882181832, -0.012011046713523037, -1.0273596630699429, -4.0271575087308795, -2.166180851519869, -1.5289823000118625, -0.2397309632086709, -0.04323906844221155, -0.10836356999794872, -0.04515462393609845, -0.9015386755538098, -0.19145262474300642, -0.838936869508243, -0.19512922974285268, -0.02658682436969693, -0.4946088572352447, -0.7600602730861097, -0.10820462709322705, -0.04585049389863249, -0.26528810239929396, -0.5318253271343809, -1.0294288738206048, -1.1837596397665777, -1.4594506554471223, -0.5586904187487552, -0.0116912442499756, -0.4442038189457607, -1.2698435525479639, -3.4833392082900287, -0.4666968866550739, -0.11951585032111212, -0.022002844425040736, -1.8793454114546257, -0.17416424622097057, -2.314206134542308, -0.3583125554851446, -1.5423929235881904, -0.6014657604207168, -1.6357397468591486, -0.6297205001924688, -0.7173990801643633, -0.14352509540269462, -2.8675229373066156, -0.008709614288617414, -0.6844850934034546, -0.022357110784161867, -4.064524624970737, -0.271632527153147, -0.6935094125621507, -0.0167403316902923, -0.1417478048284729, -0.9789583008315551, -1.6331183872357855, -0.047575744497807215, -1.5663235416179637, -0.4394800589560134, -0.2412540302093491, -0.059923253003068055, -0.030543991409625597, -0.22140548135235888, -0.21050331678483278, -0.4515865341479556, -0.3994702284599164, -5.371922806808214, -0.0195321477315992, -0.5343514927661033, -2.1204266211322365, -0.031239380642903627, -0.7639084817627784, -0.1065253644529759, -1.019654279423077, -1.7573276275614707, -0.10741755020164291, -0.4855860160613755, -1.1116756337161073, -1.841399465252069, -0.03565902573091004, -0.021807142407274535, -0.06142941581289393, -0.4966603558382157, -3.0407941944853683, -0.1655732054711173, -0.894348223876765, -0.3015218863527871, -1.5723179760579964, -0.0909538589913363, -0.4609024147978424, -0.8769429221213489, -0.5372808224573523, -0.22185448581117148, -0.45468380183385826, -0.14026151900292574, -0.0329308313398385, -0.22428405089855638, -0.32244341348886685, -0.010554554848716565, -1.569702658622456, -0.09322525974497213, -0.11245660204760842, -1.3217603827728608, -0.4274422915176168, -0.01838935288785476, -0.051252326279923675, -0.1015934595071819, -0.8916733507093602, -0.08524559216166729, -3.5958571258181435, -0.5770708135092399, -0.6420288763765635, -0.04873579232686674, -0.7265601069305503, -0.3035222177065638, -0.15582210638158855, -1.1148786147330432, -3.6951845306948248, -1.8699448100835785, -1.4838030662590596, -2.138047477067661, -0.46794541014016233, -0.4777705950475298, -0.29177020346939314, -0.36626730832029347, -3.653697165421745, -0.9061760013882768, -0.015222294398213295, -0.45396330599804174, -2.1872227678614915, -0.5559510770013023, -1.145072893714937, -0.08624847643254036, -3.967189939177775, -1.1577705610686897, -0.4688076552383597, -1.7064209452994323, -0.016407984081086038, -0.24863156454211122, -1.2004855231152582, -0.13959634313871067, -2.58439658564621, -1.3753961757346156, -0.17942028885026046, -0.018311291550354186, -0.8737955037004685, -1.1565455651560816, -0.3759565501136743, -0.034523336065003324, -1.729977498526963, -0.2799688057343105, -0.1698274747604819, -0.2848367545835343, -0.09172675789358734, -0.06312479562677825, -0.2902738563080569, -1.2690506207021461, -0.4485663213763335, -0.03485834041805636, -0.3073204447136627, -0.1687830075941178, -0.10022683220537486, -0.5044143617590439, -0.08519434927135476, -0.26389208865265107, -0.07330879923629587, -1.0778807644470283, -0.702330751282122, -3.610613159663044, -0.5510104955862231, -0.2122995694787472, -0.9933473513387834, -0.03887662374469279, -0.5206898545297259, -0.2960457209915057, -0.8166664341802866, -0.3993905862976332, -0.11167992391156015, -0.13132736118349983, -1.7086691729184393, -0.2129456839745448, -0.025412984793749125, -2.4065427444839886, -0.011052705151395158, -2.9206413833395914, -2.6281909198510545, -0.10702401475995432, -0.07720606050634087, -0.1110505695292303, -0.32451814954856517, -0.9202318749249557, -0.05944184354784399, -1.1999344581134983, -1.0897591091757073, -0.6414920454503124, -2.657201518702947, -0.021100275650389886, -0.08178100829710473, -0.4161910497283586, -0.1246876903925685, -0.2782671339496684, -3.7182383769501133, -5.041832555937827, -0.3044005691185866, -0.8227246398747167, -0.14940522440414158, -1.5243279742104925, -0.09549310128239111, -0.5137846082185563, -1.3633753918110405, -1.7354916964907847, -0.29626333915704556, -0.7151036082415103, -0.23639902118530234, -0.6288684100689733, -1.0128376916364463, -2.0663525260778455, -3.0741061690955016, -0.5988128658377343, -0.0525532265530528, -0.58271240836033, -0.35810006666288574, -1.990924551901652, -3.3249330876516296, -0.026865871517953974, -0.22030188055757102, -2.4328915586547724, -2.4915449193426027, -0.3330748252072018, -0.06540221206735518, -0.25566131797561276, -0.09775494637020728, -0.6425357956273411, -0.04475306273306217, -1.0444301941940073, -0.19934751116291652, -1.8986909707574382, -1.2319985849371737, -0.14209573422279564, -3.2969275251665056, -0.3807212145211253, -1.39760874379206, -0.43008688486107904, -0.26747700591818035, -0.06706178599181782, -2.8378925592919506, -0.015820302773364187, -0.10957036786049042, -0.06471088504078003, -0.012420364602156887, -0.5792595120882484, -0.013832989754312495, -0.9752395952118762, -0.7755971066715039, -1.6663979755474445, -1.556181847662726, -0.20261070939546616, -0.48243406424899243, -0.09231468766428658, -0.7986089983982841, -0.3994117348779621, -0.5806369705399161, -0.922580710123443, -0.05643459376396293, -7.251937767077536, -0.21112974635299192, -0.04454568015777056, -0.3689268584749084, -0.2788381260497525, -0.5495845604852068, -1.1234749616295683, -0.08955139292286562, -0.4930291817238384, -1.7767667395129434, -2.0688553604670763, -0.6834075671185083, -0.18891788586847327, -1.0893060295005093, -0.6820942994830325, -0.8909371241399963, -0.010725500630342397, -1.152188030698363, -0.9411142405870158, -0.46219987380642297, -0.14397262939767838, -0.10125757509029434, -0.024578712239646045, -0.9149929810836991, -0.4780856481296508, -0.1978375353438845, -1.812313189635792, -0.9660627614465989, -1.0065458426518097, -1.71673000525025, -0.3393823834858072, -0.33428951971748955, -0.37920472785504905, -0.03233144228203312, -0.057972171441376, -0.13301577814715962, -0.8560237518814221, -0.19541167662005796, -0.5944718730266529, -0.12375357211054797, -0.14860393188405524, -0.3217920619356946, -0.6433961625511067, -0.07278234062422019, -1.5805648986412864, -0.08080563548771308, -0.6578488454487301, -0.2306246132565656, -0.4349971957750337, -0.6638945199721125, -0.30605508564035133, -0.06740778118152015, -0.031566431816210015, -1.5304758880031468, -0.35696358189012806, -0.06528350080113386, -0.8796586607055944, -0.14349600593395506, -1.0657865379305083, -0.3390534652647221, -0.36696888329975624, -0.019195169867318517, -0.876018995097968, -2.4018610955811504, -0.039267411282368096, -1.5155629504740518, -1.1255272931326243, -1.326968941752275, -0.36515167060756687, -1.9652471894069499, -0.179114210885765, -1.3484965275721366, -0.5071915868210825, -0.02728488330128182, -0.18409987636059316, -0.2558211832830159, -0.6041894165220311, -0.4423614543919758, -0.009368888337880788, -0.18350299284700541, -0.9680093184100399, -0.13813066289244094, -0.280663211781083, -0.6125749288388362, -1.1592709265973937, -1.9711875426059673, -0.5026929514785073, -0.5034955700496528, -0.214201938708542, -0.00851126181417737, -2.417555453239462, -2.0591404755505343, -0.06051138320109764, -0.5862772536678986, -1.070198715069721, -0.017431579174972314, -0.27631046166431755, -0.37894586747577036, -1.815495754963681, -0.19190983599988598, -0.032635727258494916, -0.13085843812831513, -1.0668975134892567, -0.9714018369718858, -0.2724034659586319, -0.98498298607531, -0.6920493404349455, -0.6630525598196547, -0.023036520435887976, -0.08194041981848263, -0.4087845003533446, -0.5627433243080567, -0.9794981462709605, -0.8129735715646722, -0.6953122188316333, -0.5593007418020743, -0.5489082075500621, -0.0083718899043925, -0.014640224562967402, -0.3085971021669549, -1.817044036738384, -0.018511285130034118, -0.11226437731753998, -0.5925350994208486, -3.2270521829528547, -0.9428185374504593, -0.09592209052670385, -0.5416153696851748, -0.6219380636194649, -0.08413124490327452, -0.047673864159939905, -1.828358323729193, -0.3141366221229143, -0.4570557459136876, -1.993788391718404, -0.6580317646182333, -0.11041702832164402, -1.980214286521592, -0.599998013928833, -0.32685066294930176, -1.4022953505125624, -0.961319628052634, -0.021786232554103564, -3.263286794099063, -0.334301666247159, -0.7463943058381555, -0.4387348789771626, -0.017130413773500955, -2.9522355028324174, -0.4086639741655319, -0.7718390671105799, -0.24177445184803786, -0.16156419507860473, -1.0835802569555626, -0.04344313812267628, -0.05072786294409927, -0.5196463340756166, -0.030381971330969967, -0.7994737230609241, -0.09697850443865254, -0.054280928525596975, -0.46990842924112697, -0.7791717698308895, -0.01850480448712085, -0.8879830997338408, -0.025070338777977836, -0.5594227288222242, -0.4800768308425592, -1.3111663082027714, -0.02000449391462616, -0.021631385929686855, -0.016239722604883235, -1.1994490043050858, -0.7749972605211782, -1.9490272631615833, -2.200833259492938, -0.04609929264137505, -0.03854019428818293, -1.0495336492828968, -0.20485280974874862, -4.18277474550973, -0.2318079721762126, -0.46742092988411243, -1.071555615023798, -0.36298069616583617, -1.289891942240278, -0.19832273652391472, -0.5348219050694247, -0.2094150775565439, -0.004295484633845502, -0.5505606601390074, -0.13659457668300887, -0.27612472851753544, -0.06875335225177229, -1.8716957002307475, -1.2388888387245567, -0.025796685375989437, -0.22096189930749216, -1.8124414391944739, -0.22884061709601827, -0.4213418846162664, -0.03767630191662586, -0.27136027285997255, -0.2550902195511693, -0.010602627879987102, -0.8473737253578317, -1.221329848582551, -0.5784796012337078, -1.0733892242606224, -0.24826984643535985, -0.0071705935764359435, -1.775654647610421, -0.9286097095572461, -0.02476198584707306, -0.1722427484964266, -0.35676994785836424, -0.031349462877514216, -0.16595275164730997, -0.015515795610457161, -0.09048531116069564, -1.1664788744878078, -0.34572560526486795, -0.1595862428303843, -1.3692517899995775, -0.4494253002490748, -0.030327267874473984, -0.8060893684007625, -0.10893184679930813, -0.5398112539049869, -0.023979545309584398, -0.5235135409954218, -0.6004199014760272, -0.49176137314912655, -0.12383897802425844, -0.010409445912425984, -0.054087035498910176, -5.043096402562666, -1.9146375750793299, -0.2608526523266056, -0.07656227236303109, -0.8230460531446607, -0.32405240868347734, -0.7345164879573726, -0.7099357067574689, -0.10677292152068883, -0.12620466276635436, -0.3693350915415361, -0.2311024649455192, -0.6100257627476472, -0.2594875583613456, -0.3716561375269379, -0.08934372891162913, -0.5593153696783087, -0.2881491061707554, -1.8307876693007283, -0.11272642574508865, -0.4680295855579532, -0.5382375210379319, -1.2192407293747385, -0.26521919148797424, -0.5756210845483333, -0.06291969312250942, -0.03381983408919496, -0.4901373022506322, -1.5016353967915166, -0.9135666550236174, -0.18738377858089614, -0.33353948033956143, -0.03176285026907975, -1.368250651685761, -1.3824015754709829, -1.071715522591521, -0.02925895883857979, -0.01992442705342739, -0.8235072234439748, -0.2184673768767577, -0.10753016113330563, -1.493588889828329, -1.6427067221974734, -0.3995618132680167, -0.5727146864141448, -0.15057947979694916, -0.10534432231447546, -0.07375670600371684, -0.054665649480067684, -1.7292708617444934, -0.16267275374519763, -0.023702324376544327, -5.251309327438428, -0.16694075923517493, -0.07904046917023004, -0.010416488392120338, -0.7590449871902917, -0.4965145955884861, -1.0516845441917064, -0.029931700984285377, -0.021357782638358077, -0.00679778695438966, -0.07369289235278369, -0.38492364626140635, -1.2276186121632147, -2.5631354973363076, -2.5380167070708746, -0.6826138892118441, -1.3319131021449426, -0.03723480893758981, -2.776613506774985, -0.6511760960103402, -0.1336290212519349, -1.147132897800339, -0.03376826234481867, -0.12390906933080406, -0.06620927923620117, -0.20811506739048682, -0.8533009417426173, -0.03361543175426075, -2.5001726977102416, -0.5295566119892822, -0.9158128242334586, -0.26388126660598804, -0.01773433870426461, -2.2421952271777816, -0.963173915768311, -0.5160089022823847, -2.5969870153296872, -0.9405161029960706, -3.142229048111762, -0.04448494866095619, -0.1301375854841609, -0.608378088357393]} diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/test.factory.js b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/test.factory.js new file mode 100644 index 000000000000..afdf6a076b2a --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/test.factory.js @@ -0,0 +1,164 @@ +/** +* @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 logcdf = factory( 0.5 ); + t.equal( typeof logcdf, 'function', 'returns a function' ); + t.end(); +}); + +tape( 'if provided `NaN` for any parameter, the created function returns `NaN`', function test( t ) { + var logcdf; + var y; + + logcdf = factory( 0.5 ); + y = logcdf( NaN ); + t.equal( isnan( y ), true, 'returns expected value' ); + + logcdf = factory( NaN ); + y = logcdf( 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 `0` when provided `+infinity` for `x`', function test( t ) { + var logcdf; + var y; + + logcdf = factory( 0.5 ); + y = logcdf( PINF ); + t.equal( y, 0.0, 'returns expected value' ); + + t.end(); +}); + +tape( 'if provided a valid `lambda`, the function returns a function which returns `-Infinity` when provided a negative number for `x`', function test( t ) { + var logcdf; + var y; + + logcdf = factory( 0.5 ); + y = logcdf( NINF ); + t.equal( y, NINF, 'returns expected value' ); + + y = logcdf( -20.0 ); + t.equal( y, NINF, 'returns expected value' ); + + y = logcdf( -2.0 ); + t.equal( y, NINF, 'returns expected value' ); + y = logcdf( -0.5 ); + t.equal( y, NINF, '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 logcdf; + var y; + + logcdf = factory( -1.5 ); + + y = logcdf( 2.0 ); + t.equal( isnan( y ), true, 'returns expected value' ); + + y = logcdf( 0.0 ); + t.equal( isnan( y ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the created function evaluates the logcdf for `x` given small parameter `lambda`', function test( t ) { + var expected; + var logcdf; + 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++ ) { + logcdf = factory( lambda[ i ] ); + y = logcdf( 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 = 20.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 logcdf for `x` given small parameter `lambda`', function test( t ) { + var expected; + var logcdf; + 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++ ) { + logcdf = factory( lambda[ i ] ); + y = logcdf( 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 = 20.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/logcdf/test/test.js b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/test.js new file mode 100644 index 000000000000..7813eff5c2a0 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/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 logcdf = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof logcdf, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'attached to the main export is a factory method for generating `logcdf` functions', function test( t ) { + t.equal( typeof logcdf.factory, 'function', 'exports a factory method' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/test.logcdf.js b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/test.logcdf.js new file mode 100644 index 000000000000..6f82910ac83c --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/test.logcdf.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 logcdf = 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 logcdf, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'if provided `NaN` for any parameter, the function returns `NaN`', function test( t ) { + var y = logcdf( NaN, 0.5 ); + t.equal( isnan( y ), true, 'returns expected value' ); + y = logcdf( 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 `0`', function test( t ) { + var y = logcdf( PINF, 0.5 ); + t.equal( y, 0.0, 'returns expected value' ); + t.end(); +}); + +tape( 'if provided a negative number for `x` and a valid `lambda`, the function returns `-Infinity`', function test( t ) { + var y = logcdf( NINF, 0.5 ); + t.equal( y, NINF, 'returns expected value' ); + + y = logcdf( -4.0, 0.5 ); + t.equal( y, NINF, 'returns expected value' ); + + y = logcdf( -0.5, 0.5 ); + t.equal( y, NINF, 'returns expected value' ); + + t.end(); +}); + +tape( 'if provided a value shape parameter `lambda` which nonpositive, the function returns `NaN`', function test( t ) { + var y; + + y = logcdf( 3.0, -1.0 ); + t.equal( isnan( y ), true, 'returns expected value' ); + + y = logcdf( 3.0, -1.5 ); + t.equal( isnan( y ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function evaluates the logcdf 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 = logcdf( 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 = 20.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 logcdf 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 = logcdf( 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 = 20.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(); +}); From 9c68bff87da94d37b4c82bc97384c80963b460ae Mon Sep 17 00:00:00 2001 From: Jaysukh-409 Date: Wed, 25 Dec 2024 19:09:23 +0530 Subject: [PATCH 2/6] chore: update copyright year --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: passed - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na --- --- .../@stdlib/stats/base/dists/planck/logcdf/examples/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/examples/index.js b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/examples/index.js index bae7c5cd7073..0113f18ad175 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/examples/index.js +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/examples/index.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2018 The Stdlib Authors. +* 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. From 09404b080f3523d525afe01030d44757983a0791 Mon Sep 17 00:00:00 2001 From: Jaysukh-409 Date: Sat, 28 Dec 2024 21:47:50 +0530 Subject: [PATCH 3/6] chore: clean-up --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: passed - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: passed - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: passed - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: passed - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: passed --- --- .../@stdlib/stats/base/dists/planck/logcdf/README.md | 12 ++++++------ .../stats/base/dists/planck/logcdf/examples/index.js | 2 +- .../stats/base/dists/planck/logcdf/lib/factory.js | 3 +-- .../stats/base/dists/planck/logcdf/lib/main.js | 3 +-- .../stats/base/dists/planck/logcdf/package.json | 2 +- .../planck/logcdf/test/fixtures/python/runner.py | 2 +- .../base/dists/planck/logcdf/test/test.factory.js | 12 ++++++++++-- .../base/dists/planck/logcdf/test/test.logcdf.js | 6 +++--- 8 files changed, 24 insertions(+), 18 deletions(-) diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/README.md index fc2993ed17a1..bb633d73c87e 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/README.md @@ -20,7 +20,7 @@ limitations under the License. # Logarithm of Cumulative Distribution Function -> Planck distribution logarithm of [cumulative distribution function][cdf]. +> Planck (discrete exponential) distribution logarithm of [cumulative distribution function][cdf].
@@ -34,7 +34,7 @@ F(x;\lambda) = 1 - e^{-\lambda (\lfloor x \rfloor + 1)} -where `λ` is the shape parameter. `x` denotes the count of events in a quantized system. +where `λ` is the shape parameter and `x` denotes the count of events in a quantized system.
@@ -50,7 +50,7 @@ var logcdf = require( '@stdlib/stats/base/dists/planck/logcdf' ); #### logcdf( x, lambda ) -Evaluates the logarithm of the [cumulative distribution function][cdf] for a Planck distribution with shape parameter `λ`. +Evaluates the logarithm of the [cumulative distribution function][cdf] for a Planck (discrete exponential) distribution with shape parameter `lambda`. ```javascript var y = logcdf( 2.0, 0.5 ); @@ -70,7 +70,7 @@ y = logcdf( 0.0, NaN ); // returns NaN ``` -If provided a shape parameter `λ` which is nonpositive, the function returns `NaN`. +If provided a shape parameter `lambda` which is nonpositive, the function returns `NaN`. ```javascript var y = logcdf( 2.0, -1.0 ); @@ -79,7 +79,7 @@ var y = logcdf( 2.0, -1.0 ); #### logcdf.factory( lambda ) -Returns a function for evaluating the logarithm of the [cumulative distribution function][cdf] of a Planck distribution with shape parameter `λ`. +Returns a function for evaluating the logarithm of the [cumulative distribution function][cdf] of a Planck (discrete exponential) distribution with shape parameter `lambda`. ```javascript var mylogcdf = logcdf.factory( 1.5 ); @@ -115,8 +115,8 @@ var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); var uniform = require( '@stdlib/random/array/uniform' ); var logcdf = require( '@stdlib/stats/base/dists/planck/logcdf' ); -var lambda = uniform( 10, 0.1, 5.0 ); var x = discreteUniform( 10, 0, 5 ); +var lambda = uniform( 10, 0.1, 5.0 ); var y; var i; diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/examples/index.js b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/examples/index.js index 0113f18ad175..e42a4ef7c5c2 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/examples/index.js +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/examples/index.js @@ -22,8 +22,8 @@ var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); var uniform = require( '@stdlib/random/array/uniform' ); var logcdf = require( './../lib' ); -var lambda = uniform( 10, 0.1, 5.0 ); var x = discreteUniform( 10, 0, 5 ); +var lambda = uniform( 10, 0.1, 5.0 ); var y; var i; diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/lib/factory.js b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/lib/factory.js index 76c5ebd6bb98..2eb9533b1b08 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/lib/factory.js +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/lib/factory.js @@ -72,8 +72,7 @@ function factory( lambda ) { if ( x === PINF ) { return 0.0; } - x = floor( x ); - return ln( -expm1( -lambda * (x + 1) ) ); + return ln( -expm1( -lambda * ( floor(x)+1.0 ) ) ); } } diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/lib/main.js b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/lib/main.js index 602049b75d88..32e0af9b938e 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/lib/main.js +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/lib/main.js @@ -72,8 +72,7 @@ function logcdf( x, lambda ) { if ( x === PINF ) { return 0.0; } - x = floor( x ); - return ln( -expm1( -lambda * (x + 1) ) ); + return ln( -expm1( -lambda * ( floor(x)+1.0 ) ) ); } diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/package.json b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/package.json index fa7fb92e5ac0..cc97452af9ba 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/package.json +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/package.json @@ -1,7 +1,7 @@ { "name": "@stdlib/stats/base/dists/planck/logcdf", "version": "0.0.0", - "description": "Planck distribution logarithm of cumulative distribution function (CDF).", + "description": "Planck (discrete exponential) distribution logarithm of cumulative distribution function (CDF).", "license": "Apache-2.0", "author": { "name": "The Stdlib Authors", diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/fixtures/python/runner.py b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/fixtures/python/runner.py index fb9acb413c82..40c9f85a451f 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/fixtures/python/runner.py +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/fixtures/python/runner.py @@ -74,7 +74,7 @@ def main(): """Generate fixture data.""" # Large shape paramter: x = np.round(np.random.rand(1000) * 10.0) - lam = (np.random.rand(1000) * 10) + 10 + lam = (np.random.rand(1000) * 10.0) + 10.0 gen(x, lam, "large_lambda.json") # Small shape parameter: diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/test.factory.js b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/test.factory.js index afdf6a076b2a..2e0d07e75c19 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/test.factory.js +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/test.factory.js @@ -98,6 +98,14 @@ tape( 'if provided a shape parameter `lambda` which is nonpositive, the created var logcdf; var y; + logcdf = factory( 0.0 ); + + y = logcdf( 2.0 ); + t.equal( isnan( y ), true, 'returns expected value' ); + + y = logcdf( 0.0 ); + t.equal( isnan( y ), true, 'returns expected value' ); + logcdf = factory( -1.5 ); y = logcdf( 2.0 ); @@ -129,7 +137,7 @@ tape( 'the created function evaluates the logcdf for `x` given small parameter ` t.equal( y, expected[ i ], 'x: '+x[ i ]+', lambda: '+lambda[ i ]+', y: '+y+', expected: '+expected[ i ] ); } else { delta = abs( y - expected[ i ] ); - tol = 20.0 * EPS * abs( 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+'.' ); } } @@ -156,7 +164,7 @@ tape( 'the created function evaluates the logcdf for `x` given small parameter ` t.equal( y, expected[ i ], 'x: '+x[ i ]+', lambda: '+lambda[ i ]+', y: '+y+', expected: '+expected[ i ] ); } else { delta = abs( y - expected[ i ] ); - tol = 20.0 * EPS * abs( 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+'.' ); } } diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/test.logcdf.js b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/test.logcdf.js index 6f82910ac83c..cadcd270e97c 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/test.logcdf.js +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/test.logcdf.js @@ -73,7 +73,7 @@ tape( 'if provided a negative number for `x` and a valid `lambda`, the function tape( 'if provided a value shape parameter `lambda` which nonpositive, the function returns `NaN`', function test( t ) { var y; - y = logcdf( 3.0, -1.0 ); + y = logcdf( 3.0, 0.0 ); t.equal( isnan( y ), true, 'returns expected value' ); y = logcdf( 3.0, -1.5 ); @@ -100,7 +100,7 @@ tape( 'the function evaluates the logcdf for `x` given small parameter `lambda`' t.equal( y, expected[ i ], 'x: '+x[ i ]+', lambda: '+lambda[ i ]+', y: '+y+', expected: '+expected[ i ] ); } else { delta = abs( y - expected[ i ] ); - tol = 20.0 * EPS * abs( 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+'.' ); } } @@ -125,7 +125,7 @@ tape( 'the function evaluates the logcdf for `x` given large parameter `lambda`' t.equal( y, expected[ i ], 'x: '+x[ i ]+', lambda: '+lambda[ i ]+', y: '+y+', expected: '+expected[ i ] ); } else { delta = abs( y - expected[ i ] ); - tol = 20.0 * EPS * abs( 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+'.' ); } } From b44b4206d6c596bdf1b19cdff023b22dc48328cd Mon Sep 17 00:00:00 2001 From: Athan Reines Date: Wed, 1 Jan 2025 22:52:29 -0800 Subject: [PATCH 4/6] chore: clean-up --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: passed - task: lint_repl_help status: passed - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: missing_dependencies - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na --- --- .../stats/base/dists/planck/logcdf/README.md | 2 +- .../base/dists/planck/logcdf/docs/repl.txt | 4 +-- .../dists/planck/logcdf/docs/types/index.d.ts | 2 +- .../dists/planck/logcdf/docs/types/test.ts | 30 +++++++++---------- .../base/dists/planck/logcdf/lib/index.js | 2 +- .../base/dists/planck/logcdf/package.json | 2 +- .../logcdf/test/fixtures/python/runner.py | 3 +- .../dists/planck/logcdf/test/test.factory.js | 8 ++--- 8 files changed, 27 insertions(+), 26 deletions(-) diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/README.md index bb633d73c87e..439ce7699b5e 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/README.md @@ -20,7 +20,7 @@ limitations under the License. # Logarithm of Cumulative Distribution Function -> Planck (discrete exponential) distribution logarithm of [cumulative distribution function][cdf]. +> Evaluate the logarithm of [cumulative distribution function][cdf] Planck (discrete exponential) distribution.
diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/docs/repl.txt b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/docs/repl.txt index 0a948f2663f8..fb61de6f219a 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/docs/repl.txt +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/docs/repl.txt @@ -39,8 +39,8 @@ {{alias}}.factory( λ ) Returns a function for evaluating the logarithm of the cumulative - distribution function (CDF) of a Planck distribution with shape - parameter `λ`. + distribution function (CDF) of a Planck distribution with shape parameter + `λ`. Parameters ---------- diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/docs/types/index.d.ts b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/docs/types/index.d.ts index 3bddfffabb08..00147881f509 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/docs/types/index.d.ts @@ -86,7 +86,7 @@ interface LogCDF { } /** -* Planck distribution logarithm of cumulative distribution function (CDF). +* Evaluates the logarithm of cumulative distribution function (CDF) for a Planck distribution with shape parameter `lambda`. * * @param x - input value * @param lambda - shape parameter diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/docs/types/test.ts b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/docs/types/test.ts index 8e9d97fe00c8..62dd937b9c38 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/docs/types/test.ts +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/docs/types/test.ts @@ -23,8 +23,8 @@ import logcdf = require( './index' ); // The function returns a number... { - logcdf( 2, 0.4 ); // $ExpectType number - logcdf( 1, 0.2 ); // $ExpectType number + logcdf( 2.0, 0.4 ); // $ExpectType number + logcdf( 1.0, 0.2 ); // $ExpectType number } // The compiler throws an error if the function is provided values other than two numbers... @@ -36,19 +36,19 @@ import logcdf = require( './index' ); logcdf( {}, 0.4 ); // $ExpectError logcdf( ( x: number ): number => x, 0.2 ); // $ExpectError - logcdf( 9, true ); // $ExpectError - logcdf( 9, false ); // $ExpectError - logcdf( 5, '5' ); // $ExpectError - logcdf( 8, [] ); // $ExpectError - logcdf( 9, {} ); // $ExpectError - logcdf( 8, ( x: number ): number => x ); // $ExpectError + logcdf( 9.0, true ); // $ExpectError + logcdf( 9.0, false ); // $ExpectError + logcdf( 5.0, '5' ); // $ExpectError + logcdf( 8.0, [] ); // $ExpectError + logcdf( 9.0, {} ); // $ExpectError + logcdf( 8.0, ( x: number ): number => x ); // $ExpectError } // The compiler throws an error if the function is provided an unsupported number of arguments... { logcdf(); // $ExpectError - logcdf( 2 ); // $ExpectError - logcdf( 2, 0.8, 4 ); // $ExpectError + logcdf( 2.0 ); // $ExpectError + logcdf( 2.0, 0.8, 4.0 ); // $ExpectError } // Attached to main export is a `factory` method which returns a function... @@ -59,7 +59,7 @@ import logcdf = require( './index' ); // The `factory` method returns a function which returns a number... { const fcn = logcdf.factory( 0.4 ); - fcn( 2 ); // $ExpectType number + fcn( 2.0 ); // $ExpectType number } // The compiler throws an error if the function returned by the `factory` method is provided an invalid argument... @@ -77,8 +77,8 @@ import logcdf = require( './index' ); { const fcn = logcdf.factory( 0.4 ); fcn(); // $ExpectError - fcn( 2, 0 ); // $ExpectError - fcn( 2, 0, 1 ); // $ExpectError + fcn( 2.0, 0.0 ); // $ExpectError + fcn( 2.0, 0.0, 1.0 ); // $ExpectError } // The compiler throws an error if the `factory` method is provided a value other than a number... @@ -93,6 +93,6 @@ import logcdf = require( './index' ); // The compiler throws an error if the `factory` method is provided an unsupported number of arguments... { - logcdf.factory( 0, 0.2 ); // $ExpectError - logcdf.factory( 0, 0.4, 8 ); // $ExpectError + logcdf.factory( 0.0, 0.2 ); // $ExpectError + logcdf.factory( 0.0, 0.4, 8 ); // $ExpectError } diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/lib/index.js b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/lib/index.js index 5065cc5b230b..118e59845900 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/lib/index.js +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/lib/index.js @@ -19,7 +19,7 @@ 'use strict'; /** -* Planck distribution logarithm of cumulative distribution function (CDF). +* Evaluate the logarithm of cumulative distribution function (CDF) for a Planck distribution with shape parameter `lambda`. * * @module @stdlib/stats/base/dists/planck/logcdf * diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/package.json b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/package.json index cc97452af9ba..5e7503a4b327 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/package.json +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/package.json @@ -1,7 +1,7 @@ { "name": "@stdlib/stats/base/dists/planck/logcdf", "version": "0.0.0", - "description": "Planck (discrete exponential) distribution logarithm of cumulative distribution function (CDF).", + "description": "Evaluate the logarithm of cumulative distribution function (CDF) for a Planck (discrete exponential) distribution.", "license": "Apache-2.0", "author": { "name": "The Stdlib Authors", diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/fixtures/python/runner.py b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/fixtures/python/runner.py index 40c9f85a451f..0b6c43c7fac1 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/fixtures/python/runner.py +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/fixtures/python/runner.py @@ -72,7 +72,8 @@ def gen(x, lam, name): def main(): """Generate fixture data.""" - # Large shape paramter: + + # Large shape parameter: x = np.round(np.random.rand(1000) * 10.0) lam = (np.random.rand(1000) * 10.0) + 10.0 gen(x, lam, "large_lambda.json") diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/test.factory.js b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/test.factory.js index 2e0d07e75c19..dc126657b671 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/test.factory.js +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/test.factory.js @@ -49,7 +49,7 @@ tape( 'the function returns a function', function test( t ) { t.end(); }); -tape( 'if provided `NaN` for any parameter, the created function returns `NaN`', function test( t ) { +tape( 'if provided `NaN` for any parameter, the returned function returns `NaN`', function test( t ) { var logcdf; var y; @@ -94,7 +94,7 @@ tape( 'if provided a valid `lambda`, the function returns a function which retur t.end(); }); -tape( 'if provided a shape parameter `lambda` which is nonpositive, the created function always returns `NaN`', function test( t ) { +tape( 'if provided a shape parameter `lambda` which is nonpositive, the returned function always returns `NaN`', function test( t ) { var logcdf; var y; @@ -117,7 +117,7 @@ tape( 'if provided a shape parameter `lambda` which is nonpositive, the created t.end(); }); -tape( 'the created function evaluates the logcdf for `x` given small parameter `lambda`', function test( t ) { +tape( 'the returned function evaluates the logcdf for `x` given small parameter `lambda`', function test( t ) { var expected; var logcdf; var lambda; @@ -144,7 +144,7 @@ tape( 'the created function evaluates the logcdf for `x` given small parameter ` t.end(); }); -tape( 'the created function evaluates the logcdf for `x` given small parameter `lambda`', function test( t ) { +tape( 'the returned function evaluates the logcdf for `x` given small parameter `lambda`', function test( t ) { var expected; var logcdf; var lambda; From 23de2624c82c3aae7dfc0ed66ab7870167a58c5e Mon Sep 17 00:00:00 2001 From: stdlib-bot <82920195+stdlib-bot@users.noreply.github.com> Date: Thu, 2 Jan 2025 06:54:46 +0000 Subject: [PATCH 5/6] chore: update copyright years --- .../@stdlib/stats/base/dists/planck/logcdf/README.md | 2 +- .../stats/base/dists/planck/logcdf/benchmark/benchmark.js | 2 +- .../stats/base/dists/planck/logcdf/docs/types/index.d.ts | 2 +- .../@stdlib/stats/base/dists/planck/logcdf/docs/types/test.ts | 2 +- .../@stdlib/stats/base/dists/planck/logcdf/examples/index.js | 2 +- .../@stdlib/stats/base/dists/planck/logcdf/lib/factory.js | 2 +- .../@stdlib/stats/base/dists/planck/logcdf/lib/index.js | 2 +- .../@stdlib/stats/base/dists/planck/logcdf/lib/main.js | 2 +- .../base/dists/planck/logcdf/test/fixtures/python/runner.py | 2 +- .../@stdlib/stats/base/dists/planck/logcdf/test/test.factory.js | 2 +- .../@stdlib/stats/base/dists/planck/logcdf/test/test.js | 2 +- .../@stdlib/stats/base/dists/planck/logcdf/test/test.logcdf.js | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/README.md index 439ce7699b5e..ebd328bf836d 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/README.md @@ -2,7 +2,7 @@ @license Apache-2.0 -Copyright (c) 2024 The Stdlib Authors. +Copyright (c) 2025 The Stdlib Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/benchmark/benchmark.js b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/benchmark/benchmark.js index daee4efec857..fe7102fcfe17 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/benchmark/benchmark.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2025 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/docs/types/index.d.ts b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/docs/types/index.d.ts index 00147881f509..b290a86a7b67 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/docs/types/index.d.ts @@ -1,7 +1,7 @@ /* * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2025 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/docs/types/test.ts b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/docs/types/test.ts index 62dd937b9c38..6400f0332567 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/docs/types/test.ts +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/docs/types/test.ts @@ -1,7 +1,7 @@ /* * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2025 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/examples/index.js b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/examples/index.js index e42a4ef7c5c2..713087928bc0 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/examples/index.js +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/examples/index.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2025 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/lib/factory.js b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/lib/factory.js index 2eb9533b1b08..75ebf64cebd9 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/lib/factory.js +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/lib/factory.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2025 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/lib/index.js b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/lib/index.js index 118e59845900..9e9109875fe8 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/lib/index.js +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/lib/index.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2025 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/lib/main.js b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/lib/main.js index 32e0af9b938e..4b3c976d2272 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/lib/main.js +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/lib/main.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2025 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/fixtures/python/runner.py b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/fixtures/python/runner.py index 0b6c43c7fac1..6e8070298ca9 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/fixtures/python/runner.py +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/fixtures/python/runner.py @@ -2,7 +2,7 @@ # # @license Apache-2.0 # -# Copyright (c) 2024 The Stdlib Authors. +# Copyright (c) 2025 The Stdlib Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/test.factory.js b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/test.factory.js index dc126657b671..441fef2169b3 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/test.factory.js +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/test.factory.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2025 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/test.js b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/test.js index 7813eff5c2a0..fe65bdf1a764 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/test.js +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/test.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2025 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/test.logcdf.js b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/test.logcdf.js index cadcd270e97c..4a3770dde3a6 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/test.logcdf.js +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/test.logcdf.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2025 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From 12961bf0b33fea6c39904d6e2094a4786e55e4cc Mon Sep 17 00:00:00 2001 From: Athan Reines Date: Wed, 1 Jan 2025 22:58:34 -0800 Subject: [PATCH 6/6] style: fix lint error --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: missing_dependencies - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../base/dists/planck/logcdf/test/fixtures/python/runner.py | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/fixtures/python/runner.py b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/fixtures/python/runner.py index 0b6c43c7fac1..63c1163cb98e 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/fixtures/python/runner.py +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/test/fixtures/python/runner.py @@ -72,7 +72,6 @@ def gen(x, lam, name): def main(): """Generate fixture data.""" - # Large shape parameter: x = np.round(np.random.rand(1000) * 10.0) lam = (np.random.rand(1000) * 10.0) + 10.0