diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/entropy/README.md b/lib/node_modules/@stdlib/stats/base/dists/planck/entropy/README.md new file mode 100644 index 000000000000..f00b69fe23d3 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/entropy/README.md @@ -0,0 +1,141 @@ + + +# Entropy + +> Planck (discrete exponential) distribution [differential entropy][entropy]. + + + +
+ +The [differential entropy][entropy] (in [nats][nats]) for a Planck random variable is + + + +```math +H\left( X \right) = \frac{\lambda e^{-\lambda}}{1 - e^{-\lambda}} - \log\left( 1 - e^{-\lambda} \right) +``` + + + +where `λ` is the shape parameter. + +
+ + + + + +
+ +## Usage + +```javascript +var entropy = require( '@stdlib/stats/base/dists/planck/entropy' ); +``` + +#### entropy( lambda ) + +Returns the [differential entropy][entropy] of a Planck distribution with shape parameter `lambda` (in [nats][nats]). + +```javascript +var v = entropy( 0.1 ); +// returns ~3.3030 + +v = entropy( 1.5 ); +// returns ~0.6833 +``` + +If provided a shape parameter `lambda` which is `NaN` or nonpositive, the function returns `NaN`. + +```javascript +var v = entropy( NaN ); +// returns NaN + +v = entropy( -1.5 ); +// returns NaN +``` + +
+ + + + + +
+ +
+ + + + + +
+ +## Examples + + + +```javascript +var uniform = require( '@stdlib/random/array/uniform' ); +var entropy = require( '@stdlib/stats/base/dists/planck/entropy' ); + +var lambda = uniform( 10, 0.1, 5.0 ); + +var v; +var i; +for ( i = 0; i < lambda.length; i++ ) { + v = entropy( lambda[ i ] ); + console.log( 'λ: %d, H(X;λ): %d', lambda[ i ].toFixed( 4 ), v.toFixed( 4 ) ); +} +``` + +
+ + + + + +
+ +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/entropy/benchmark/benchmark.js b/lib/node_modules/@stdlib/stats/base/dists/planck/entropy/benchmark/benchmark.js new file mode 100644 index 000000000000..ce171ab4f102 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/entropy/benchmark/benchmark.js @@ -0,0 +1,52 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pkg = require( './../package.json' ).name; +var entropy = require( './../lib' ); + + +// MAIN // + +bench( pkg, function benchmark( b ) { + var lambda; + var y; + var i; + + lambda = uniform( 100, 0.1, 10.0 ); + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + y = entropy( 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(); +}); diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/entropy/docs/repl.txt b/lib/node_modules/@stdlib/stats/base/dists/planck/entropy/docs/repl.txt new file mode 100644 index 000000000000..4e26e6fc5a4d --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/entropy/docs/repl.txt @@ -0,0 +1,27 @@ + +{{alias}}( λ ) + Returns the differential entropy of a Planck distribution with shape + parameter `λ` (in nats). + + If `λ <= 0`, the function returns `NaN`. + + Parameters + ---------- + λ: number + Shape parameter. + + Returns + ------- + out: number + Entropy. + + Examples + -------- + > var v = {{alias}}( 0.1 ) + ~3.3030 + > v = {{alias}}( 1.5 ) + ~0.6833 + + See Also + -------- + diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/entropy/docs/types/index.d.ts b/lib/node_modules/@stdlib/stats/base/dists/planck/entropy/docs/types/index.d.ts new file mode 100644 index 000000000000..0dafc84dc065 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/entropy/docs/types/index.d.ts @@ -0,0 +1,56 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// TypeScript Version: 4.1 + +/** +* Returns the differential entropy of a Planck distribution. +* +* ## Notes +* +* - If `lambda <= 0`, the function returns `NaN`. +* +* @param lambda - shape parameter +* @returns differential entropy +* +* @example +* var v = entropy( 0.1 ); +* // returns ~3.3030 +* +* @example +* var v = entropy( 1.5 ); +* // returns ~0.6833 +* +* @example +* var v = entropy( 2.9 ); +* // returns ~0.2255 +* +* @example +* var v = entropy( -1.1 ); +* // returns NaN +* +* @example +* var v = entropy( NaN ); +* // returns NaN +*/ +declare function entropy( lambda: number ): number; + + +// EXPORTS // + +export = entropy; diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/entropy/docs/types/test.ts b/lib/node_modules/@stdlib/stats/base/dists/planck/entropy/docs/types/test.ts new file mode 100644 index 000000000000..73b13b540212 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/entropy/docs/types/test.ts @@ -0,0 +1,44 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +import entropy = require( './index' ); + + +// TESTS // + +// The function returns a number... +{ + entropy( 0.3 ); // $ExpectType number +} + +// The compiler throws an error if the function is provided a value other than a number... +{ + entropy( true ); // $ExpectError + entropy( false ); // $ExpectError + entropy( null ); // $ExpectError + entropy( undefined ); // $ExpectError + entropy( '5' ); // $ExpectError + entropy( [] ); // $ExpectError + entropy( {} ); // $ExpectError + entropy( ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided insufficient arguments... +{ + entropy(); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/entropy/examples/index.js b/lib/node_modules/@stdlib/stats/base/dists/planck/entropy/examples/index.js new file mode 100644 index 000000000000..acdbbbc7cf6b --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/entropy/examples/index.js @@ -0,0 +1,31 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +var uniform = require( '@stdlib/random/array/uniform' ); +var entropy = require( './../lib' ); + +var lambda = uniform( 10, 0.1, 5.0 ); + +var v; +var i; +for ( i = 0; i < lambda.length; i++ ) { + v = entropy( lambda[ i ] ); + console.log( 'λ: %d, H(X;λ): %d', lambda[ i ].toFixed( 4 ), v.toFixed( 4 ) ); +} diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/entropy/lib/index.js b/lib/node_modules/@stdlib/stats/base/dists/planck/entropy/lib/index.js new file mode 100644 index 000000000000..44dd7cf7b679 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/entropy/lib/index.js @@ -0,0 +1,43 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +/** +* Planck distribution differential entropy. +* +* @module @stdlib/stats/base/dists/planck/entropy +* +* @example +* var entropy = require( '@stdlib/stats/base/dists/planck/entropy' ); +* +* var v = entropy( 0.1 ); +* // returns ~3.3030 +* +* v = entropy( 1.5 ); +* // returns ~0.6833 +*/ + +// MODULES // + +var main = require( './main.js' ); + + +// EXPORTS // + +module.exports = main; diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/entropy/lib/main.js b/lib/node_modules/@stdlib/stats/base/dists/planck/entropy/lib/main.js new file mode 100644 index 000000000000..ac3db097a539 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/entropy/lib/main.js @@ -0,0 +1,69 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var exp = require( '@stdlib/math/base/special/exp' ); +var expm1 = require( '@stdlib/math/base/special/expm1' ); +var ln = require( '@stdlib/math/base/special/ln' ); + + +// MAIN // + +/** +* Returns the differential entropy of a Planck distribution. +* +* @param {PositiveNumber} lambda - shape parameter +* @returns {PositiveNumber} differential entropy +* +* @example +* var v = entropy( 0.1 ); +* // returns ~3.3030 +* +* @example +* var v = entropy( 1.5 ); +* // returns ~0.6833 +* +* @example +* var v = entropy( 2.9 ); +* // returns ~0.2255 +* +* @example +* var v = entropy( -1.1 ); +* // returns NaN +* +* @example +* var v = entropy( NaN ); +* // returns NaN +*/ +function entropy( lambda ) { + var c; + if ( isnan( lambda ) || lambda <= 0.0 ) { + return NaN; + } + c = -expm1( -lambda ); + return ( lambda * exp( -lambda ) / c ) - ln( c ); +} + + +// EXPORTS // + +module.exports = entropy; diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/entropy/package.json b/lib/node_modules/@stdlib/stats/base/dists/planck/entropy/package.json new file mode 100644 index 000000000000..1c6b072fbcf1 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/entropy/package.json @@ -0,0 +1,69 @@ +{ + "name": "@stdlib/stats/base/dists/planck/entropy", + "version": "0.0.0", + "description": "Planck (discrete exponential) distribution differential entropy.", + "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", + "parameter", + "memoryless", + "life-time", + "discrete", + "entropy", + "shannon", + "information", + "nats", + "planck", + "univariate" + ] +} diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/entropy/test/fixtures/python/data.json b/lib/node_modules/@stdlib/stats/base/dists/planck/entropy/test/fixtures/python/data.json new file mode 100644 index 000000000000..14e43954d8c1 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/entropy/test/fixtures/python/data.json @@ -0,0 +1 @@ +{"lambda": [11.455931688414339, 12.049886662295279, 19.686522775043272, 11.015032049363455, 17.296911359484074, 15.689532162118596, 3.3145508589156147, 5.504482683615719, 6.576128114123461, 13.375086796004984, 10.34069873156734, 9.72980253893475, 11.348605319802008, 6.667030734470609, 11.327226583010956, 18.735451535117857, 1.3853781760477135, 12.9034695366267, 12.229488830745638, 11.965908082806129, 5.264935976789071, 2.6688592326814997, 13.420190489773617, 15.02336736559425, 18.62421960884803, 3.3246336724638903, 16.642827792190545, 7.838647648093957, 19.32238077907249, 8.713855968469682, 13.151286309768249, 12.72787815708906, 1.8364861594947568, 19.45541941060595, 10.207110298518419, 13.101057171120772, 16.198836821780027, 16.02139631723581, 11.327805373182079, 11.719271917838153, 19.27900725230956, 15.14949615392188, 10.788035015716083, 4.629952031050896, 7.967138676369714, 16.388013653758854, 9.781777196936668, 1.489720133199488, 4.762911375368262, 17.085111042135125, 17.27114689397242, 0.6314525438939245, 9.875681214636515, 12.37356050802588, 3.510221231685864, 16.550508607036182, 18.805468045902124, 9.819647302372035, 4.569946306546604, 17.69172599008247, 13.380049133023636, 11.639485949263964, 18.205360286164257, 13.130843377388345, 1.893200595979514, 13.421518255666513, 13.012525005074911, 7.312872821147252, 14.610486338573255, 2.9774252200110274, 8.95320575984725, 12.295380151089423, 0.1391334568336866, 13.289627530342878, 1.612684552703607, 10.52969854365029, 12.275974549213416, 14.228438571930862, 13.10035197031035, 1.7997273825540794, 12.430538769974483, 3.5930056489156303, 5.035635562967046, 9.995223734563057, 4.432582588528875, 10.061750809513889, 4.996590317815972, 1.2120893147912426, 3.162566786062646, 16.446175446235493, 15.65783084247482, 0.6988226706463041, 2.6030168891489702, 9.226719131087691, 2.7889511580524373, 9.407559537483557, 6.27352597907942, 0.8918466974310735, 19.201356769756256, 18.42343513520994, 9.380904484871309, 6.583239633263558, 14.056560183438249, 8.817287253726596, 0.79884222071682, 12.016961828259387, 1.7357210680075852, 3.828483766453954, 18.527888125584102, 13.624422190339287, 1.819162683565283, 16.076281152305953, 13.12256847471418, 15.951335344820938, 14.562306342585325, 15.719197884723286, 1.7469254682523028, 19.925119560622772, 5.350052622355637, 5.9867941498079436, 5.037527512399764, 16.60240804502942, 18.201553121853976, 5.807977966080891, 17.36019344242406, 7.641430760176597, 14.506064896927294, 15.224048463322756, 2.9319622298974735, 0.7331215259553048, 16.728451507423557, 4.475442220772776, 6.179654920215285, 8.329891699598901, 16.822409127051614, 0.9469551708871582, 7.565529619753, 10.91421973203948, 4.96882748842594, 6.904245767540087, 18.156758068598872, 8.321118274971655, 9.36482705932496, 8.782236602144359, 0.10999705924719994, 5.848795530167463, 6.995200993628736, 12.256135889989206, 16.06896859656502, 17.75197134729146, 4.393286048853049, 0.5038119797329244, 3.9755767784535156, 12.361487089377636, 7.658593620236635, 1.9048189599001208, 18.62258185298303, 15.466670198518727, 0.8743134411846332, 19.49789568535689, 6.523562582011852, 18.912500157086427, 13.381315930910082, 8.448693421059254, 6.691053840619863, 13.213082035431064, 2.3250724555671165, 14.283622426025408, 17.20025200822605, 7.533640561966337, 6.23477988552696, 9.727584674219884, 3.773486602398719, 12.953951966753028, 4.935862060103197, 9.753536592752729, 15.875894977643432, 11.966700675484818, 8.281121050287288, 5.085647939470559, 12.931004793673749, 11.935577716612649, 18.456420267496306, 17.083823672733974, 4.3584501243141505, 17.79527235691106, 17.491920060675223, 14.197059847404281, 7.635187392657565, 5.5990143118982205, 6.648272582315567, 19.994988076134895, 0.4541347603044188, 7.691816949973028, 17.293889312851054, 13.715979967583369, 12.453306024856456, 16.903869525410585, 3.2487761099310286, 19.716244322342106, 6.340790601733433, 7.811252058134555, 9.019934644634054, 16.59014568210154, 17.535832036461166, 12.23552882406624, 0.12014274827903959, 4.16161769611003, 18.287326732981533, 14.717328459384404, 5.813201565430067, 9.175315474249452, 14.867864211276249, 17.730375597875224, 3.0839340367858314, 14.292906473520324, 17.898236809670678, 3.6759643169405964, 10.690689839550052, 10.068320036523374, 13.17363211652124, 3.339642209237663, 3.901677732623554, 7.512458010027199, 14.110780920682489, 0.08368225389137729, 17.16511412161733, 6.817821690879848, 6.1018845145962075, 6.9108482382767855, 16.194128523322867, 16.4603607836169, 2.292343026457677, 9.265612956309058, 15.5700463934088, 14.918629303679136, 12.10952803867448, 2.6589704528410607, 6.160755189115661, 14.295452074669763, 15.08178766047216, 7.122831125621428, 3.9046160178542633, 12.637214274710214, 16.287350254889937, 2.746221231114234, 19.90307016856469, 19.107777195277706, 18.874348033178553, 4.650522369116185, 11.071527289551106, 8.416906430953006, 8.087947026087718, 3.579583836554543, 17.507202662086595, 5.632429340640641, 4.6159699291271945, 15.743702000242257, 18.846602974450345, 0.5978344129983681, 2.4274004536582083, 1.9851987742144472, 4.250783974463017, 5.932975648262257, 8.733662033411623, 6.273437630268988, 1.6290165914026722, 10.52434701728702, 0.6673613350099838, 6.59489891788867, 0.1299236362812506, 0.5543008018430418, 9.665955702520767, 13.77368385564601, 7.427373297155205, 17.382015266924682, 14.025642587319938, 5.339391172093785, 12.972921557313429, 17.39362979421525, 11.448832816588883, 12.833506230746249, 9.97529909122241, 1.4837169032781672, 13.252563356719717, 11.59575114026769, 11.602143200133847, 0.46616927775126715, 13.879638732261832, 2.735230438938343, 5.406308268215698, 11.412573630545168, 7.402144953394901, 1.7575992854254152, 14.092935173106317, 18.517626377663806, 5.8897046123091945, 3.8190350438115805, 2.816183010399824, 17.020974910962916, 13.597270182732453, 15.506831456402894, 0.27439509743246715, 2.1596851502136394, 17.129776773911594, 14.553078898818303, 7.867428086176076, 6.830997295623433, 7.428932732803637, 18.100060448315407, 0.05941687193334433, 0.6009977779672337, 13.139022611901865, 14.864608978138765, 5.3687191310026305, 14.047751099345575, 10.556681455123968, 8.2423366490271, 1.6576578188567814, 16.133247986949087, 8.038391794617477, 6.604034626842563, 17.267904486308936, 13.772904564279811, 4.708277615144536, 15.134056302907634, 9.238187057087936, 13.94683935568519, 0.14834651846158398, 10.352945641119035, 13.969576076271583, 2.319505905801371, 13.469260371587419, 11.296584882037736, 7.862888361138733, 9.098392277192334, 19.389413441338053, 5.872818598562526, 2.057450344028957, 15.879227291419173, 19.751238582743813, 0.5259230954477134, 9.910172378183981, 1.0210408891869571, 3.203800397566945, 0.5920063127789632, 8.002985049851308, 4.204680129089091, 7.365822973289957, 11.04961770353546, 18.635093737202165, 18.430572535901085, 13.366835063612408, 17.27342268123429, 13.848280312174952, 9.560984965473086, 5.798518034947781, 14.223439772811023, 10.397294045125452, 3.957662597972589, 10.847128197212356, 6.372152049477762, 13.77592335100523, 19.57286281477427, 13.550366257643045, 3.531801806291288, 4.710958958917364, 11.977438517373649, 19.57740280346792, 19.01964766092762, 9.91145460460858, 4.452644662602763, 7.981839652403981, 18.873667066548027, 10.586130066703973, 15.425286434735302, 10.87053378836629, 3.838933666954314, 3.6301448869795605, 14.509520439325971, 16.685455491972846, 8.675882055605904, 14.631515723110022, 4.7469565200121195, 13.12401170179033, 11.506019301955941, 3.1222858684157084, 12.378602388933457, 7.415803246834553, 16.74233565663747, 1.868842583690229, 18.265645772538576, 15.185875598130519, 1.9235342200372907, 11.035376234571967, 1.024248424619545, 19.530923690492845, 7.760671420770251, 18.535411282913376, 0.18844846746755017, 1.6564604842490804, 1.6734009789186999, 0.7173079675473604, 19.486815583846663, 15.81033427359406, 12.05345344221891, 1.7758972830898179, 3.07302520643709, 8.120634799034065, 7.2410846580922765, 12.799976789637245, 10.16498963281454, 10.900420608512924, 2.509931007902344, 13.929474785388303, 9.213657411091036, 4.880781428368133, 4.599270235195596, 3.676083277752775, 6.874933038291449, 10.584191739754791, 9.258092149313704, 2.176126783543455, 3.0140791097076547, 9.075415187017061, 2.013289341922384, 12.770680666444413, 3.871622485162123, 13.637378363771955, 10.898119991103624, 16.78225944842965, 16.097499312431232, 12.301124488555615, 13.333535907286006, 6.881031194337672, 6.944222663370663, 14.58136315144058, 1.829422138410144, 14.283680437652293, 18.95475511858982, 1.9374026962262025, 10.049346234230288, 2.7748561376314584, 0.7612479439657771, 14.266781001034532, 6.976650857359246, 3.996465859598206, 6.163197675909058, 15.078736660152865, 7.014897333489644, 3.2275174915512794, 16.188507995129275, 8.870248512082675, 9.90205465402806, 13.025881179581233, 4.204649069541451, 12.523259381031014, 1.0204767588753283, 15.091488051358478, 15.205048465804031, 7.477839812875224, 1.9244993899569174, 6.3229813738768765, 2.5676212401147724, 16.226001642885766, 11.031763441981731, 9.277119865118465, 13.977914966614724, 14.21677798649161, 17.692010381984964, 0.8014524783294297, 6.747644997149305, 18.849668825610287, 9.87355341286438, 13.596451134803711, 8.285102712233844, 19.865438261219957, 18.4099248352327, 13.152759339537166, 13.006504074562745, 16.731700037648938, 15.880547954183397, 5.1964553554313, 10.280461150210119, 8.005805566247535, 3.781901680306412, 9.1776456189423, 8.427152854474528, 12.2127697886831, 5.007524879956944, 11.065581221862468, 2.515540693704079, 18.543235905480408, 14.09992345112181, 0.8520486859365928, 11.819523200021907, 14.550051316152306, 19.556978819496788, 13.589615137789146, 2.3954235896893517, 6.0667424816519855, 16.94298274303656, 6.724858735584112, 13.191275735530578, 1.8233345939646073, 17.03623717200249, 5.071599893345371, 0.6965586257307232, 3.594695136704451, 12.204998839540814, 15.890221536657803, 16.05765858846984, 15.267718137538491, 14.041325177186092, 12.88743422867648, 11.230960783627333, 9.752381121941555, 7.963699710924468, 2.743021575225466, 12.140345636580655, 6.759315684449532, 18.660364253135175, 14.467097876272074, 4.701423510182576, 19.850318210661765, 6.036548617630142, 0.4623775435706978, 17.98213286640166, 13.51193615077756, 15.467687488089872, 11.846388438869706, 19.14103192375938, 4.594933556180212, 1.547731880502372, 4.738970659294424, 11.138618849611259, 17.4818403046761, 0.9629741551026805, 10.186444856639625, 12.819798954491016, 1.5752216642827954, 14.47192285012163, 19.85157448656286, 11.596635574661743, 13.088751722983973, 2.971248449121695, 0.26174356706883506, 12.406686441726414, 7.3072082956480795, 17.801043610290158, 1.8970982364465128, 14.57855364707273, 11.319772679579154, 17.33243104048436, 17.1494703309536, 6.714016351368423, 8.537528928238158, 9.750513670331578, 7.436695130952852, 14.44109615303708, 16.81086368570537, 10.182221430323237, 10.821211985105478, 9.994054240515407, 16.479894957058377, 17.388456939157134, 8.838770396953567, 4.730685744718528, 16.24831482531006, 16.265472200579342, 6.130047565383229, 6.1321701370485115, 6.8666660002260365, 1.976496985176377, 9.783049621686551, 17.318755802453744, 11.284509872013688, 7.849905614419184, 1.8804968869258198, 6.217973986259193, 7.524663079586011, 19.027720284761983, 15.089868092945762, 6.349212881466542, 6.526487286034461, 17.659287030189454, 4.55575357988195, 18.17125500529803, 13.40597424234464, 10.365510514107331, 16.32442267599472, 12.683738489448846, 13.496251298140782, 19.811743344830397, 11.279477788251025, 10.647222554255144, 3.454763060605106, 14.844113553850386, 13.75545217375797, 16.783770528684716, 9.20636903548033, 13.791362689421675, 8.169130490230167, 14.400516539948862, 1.7504237928079824, 5.224472040415398, 7.142322915746497, 11.725865221065918, 9.164035624455849, 0.877082866092016, 3.644088096256244, 12.47036109071143, 11.220909560804094, 11.721552468390515, 18.287959061014504, 7.638249532408901, 14.886148657061952, 8.437682277133895, 1.9536591395976144, 18.12205911935135, 2.8589182389752166, 8.470111004349562, 13.485012409075985, 4.096675914664784, 8.450445630681697, 18.31809971969532, 18.008550080658587, 17.238065960425587, 17.058661053795824, 16.220413527185155, 8.566082982881209, 17.534101012500585, 7.478226896681541, 5.0156737158341125, 5.878789067070684, 6.323545481795996, 13.692492380391702, 8.123856504498946, 18.011850873645418, 3.082549663709362, 16.581768538956158, 8.181614507601369, 11.51576268674831, 3.3762589942275034, 1.317875605973795, 18.590662287829968, 7.9850686060152825, 2.8649303159021944, 16.501804868156505, 5.532061449035761, 6.606363918728187, 18.24616747751538, 12.410810543303331, 1.3513427033025538, 11.887063604406888, 0.6565804386141649, 6.736492838306846, 1.7360038966792324, 14.366743868059011, 11.748693195309112, 5.863574157668847, 13.752471204713427, 18.254705238750514, 18.4645036614006, 1.1615011001026776, 4.788866725428312, 8.49215349721125, 0.019839070222509303, 4.359449767106511, 11.36244853430836, 6.274048337307869, 8.72987029193906, 6.085234749711015, 18.91669864937815, 17.014897928548503, 4.739337504745665, 14.021426886110122, 10.56092948250024, 16.57569520041489, 18.913272083519214, 5.774786903106291, 3.250018331275397, 2.8338639297200707, 16.05728948077235, 19.376855630239284, 5.860415155352568, 8.55461311454749, 16.76122955774723, 16.380058569781134, 19.677978300016758, 15.132298497040352, 11.886806694403425, 18.786910642763047, 8.297651841868479, 2.7475121277976156, 15.14631092803155, 7.145718159202481, 14.273913122034967, 15.967525543987225, 18.346621706520956, 5.699036250314638, 8.525000702677607, 0.1166902397538494, 2.9070212686880903, 19.526395385792508, 18.212161701630183, 4.199780676678877, 7.693989416126865, 4.011946783490692, 15.280209932552411, 9.385924825262695, 8.909211538181843, 19.162553854644244, 19.306571507117432, 11.575642148115556, 4.396914598847694, 10.914567655194045, 8.561307999005338, 3.8400530483018014, 7.401155447775027, 18.02572851804351, 10.235151665888747, 13.275177149759717, 14.316343342437943, 10.014188312510331, 16.305015435790878, 6.289779392469077, 17.158309783129006, 2.4569623410112595, 17.788242060268313, 6.548792569584634, 8.257431484930965, 9.060167017906942, 1.596386615676606, 5.211514593564068, 2.533047068580301, 16.912860923178087, 11.456118256611871, 12.829011524663532, 17.078356770102076, 16.90123771039104, 12.954207002151595, 17.575648077004217, 1.817924811228866, 6.260559844488778, 19.80349507824085, 8.875249425723586, 18.475305515869735, 0.48376190068155633, 3.920409125167299, 6.676278970829732, 14.038783124530333, 13.617316195538622, 7.391643026734651, 10.922017636448446, 17.06809174401846, 9.520174077556895, 2.312842569332161, 0.6984100027725293, 1.8237316423348204, 11.24827485145749, 12.931893687981933, 4.033206411960453, 2.4895672307706884, 14.51566230023776, 19.31215843228262, 2.8551455150935734, 8.027386262867973, 4.0254209605011475, 8.60251468907684, 11.770153840002946, 10.547485565582935, 18.27407143134778, 6.59211805404486, 19.759931701923648, 9.520142857479556, 10.715702946543226, 12.62815677933516, 14.42976536667464, 12.133558205896051, 11.004618897668223, 6.825300287076283, 15.749350273948707, 5.725489436494291, 2.884799483129854, 3.7148123549347956, 2.122889584731804, 5.799373299414141, 16.352136230377507, 16.18426999173432, 15.718999058661465, 10.822274975699104, 16.03950080830639, 12.757721709101036, 11.005221715935578, 6.88756877257469, 8.260325771702048, 6.88952616835496, 17.25687027594799, 10.72114712648192, 12.355567806501586, 3.340139566497713, 4.370210579522114, 19.330862287004962, 1.097833204092058, 18.417971642259502, 10.16074103786627, 11.33141296557238, 1.4045925096402656, 9.478435399268648, 4.787336406289178, 10.526042349882099, 13.985916457660288, 15.644363330715926, 7.910104332797456, 16.961196314450596, 8.923555507595076, 3.344046845978963, 6.171113860661704, 4.091372275318339, 1.4064030413146256, 3.7426093843298536, 6.467717033330544, 7.5498959089997975, 15.837104183366908, 10.197580651472203, 4.601376767153072, 10.559548162245687, 17.843961655322136, 5.608278397762032, 2.4359245961297815, 9.071933267145486, 2.981765283751301, 3.8963674722500263, 15.148451254982225, 3.341345090777408, 17.90963606101775, 7.0382314479996255, 16.5211598545809, 12.8334966183804, 4.964994957282951, 17.570778721821366, 12.902946066004073, 12.885704049423925, 6.178379491608932, 16.903805743152883, 10.472008029703881, 5.305438190570624, 8.499608205939019, 2.3488383879974273, 1.1776962778589284, 3.9698393925158992, 3.881461751178641, 18.589485529907968, 12.712374274249342, 17.93103514208771, 17.324502505075547, 17.8467125979873, 15.30034047526048, 2.1853765380686996, 19.190382892155625, 16.289386684378567, 5.031484465624249, 5.077503216355225, 7.375184807925321, 1.175991037436408, 12.116361849766406, 13.979710466703583, 1.7545794293950467, 7.721298162824661, 0.12306559108930637, 13.190921295952725, 14.409043256090243, 10.230132995368304, 6.9073259820065065, 19.115975426009452, 17.178561621321126, 15.045313527346648, 15.200353275964956, 14.217385529502316, 1.9203681360276104, 14.22003973732792, 11.803197514904424, 10.08487421663084, 18.471585223587617, 10.04878008306907, 12.922375432644808, 12.273387060945717, 0.9262362156174309, 13.450514877430791, 5.566812070733755, 10.15999394295897, 14.213874809375074, 16.680550636744616, 3.3353499523199925, 8.112746639434132, 6.23685654962149, 10.168812455600246, 14.64475897816504, 4.675928820783666, 12.176638967664923, 16.839608548053324, 9.445975678936222, 1.6598978038972478, 16.0588632959969, 18.56571527511543, 3.1647790455608438, 7.922325940008584, 6.170283059170507, 12.437842622257493, 19.41497467234069, 19.413505310516467, 14.39398088504822, 18.41522030898577, 0.034095243897784844, 7.192387624951085, 0.5914196687178896, 5.955433306718756, 0.8277068095591145, 10.494139569206329, 18.499608893744607, 7.771558906994683, 4.552314656046638, 18.875064160110313, 18.777606917229527, 9.991542098702332, 3.3288287890083335, 3.8216904457932532, 7.014937204431842, 2.1284905630539885, 16.42173521734296, 6.3777010197809965, 5.627502968308362, 12.245201554301042, 13.052751903668849, 2.017561481435417, 5.011317310671459, 11.20429498095843, 5.545302076715113, 11.408709035324602, 6.437140820698406, 1.5536568750179525, 11.054956635959597, 16.234515260845207, 17.089322842979037, 3.5151913257396794, 10.251206437725974, 10.654128777306157, 18.27837515907818, 11.73125882937006, 1.1128775000970426, 15.198208566758321, 0.046391352956898224, 12.909027839071713, 19.50543140109183, 4.600966968349458, 7.644656862992436, 5.18961125037354, 16.81510840243994, 7.88117168889507, 7.5801178870659065, 11.50362005563807, 4.411722902873814, 19.551687215278623, 2.3406289770593647, 19.792168477698088, 8.749731172420208, 14.90461155227652, 14.039046940704864, 8.69981311997927, 3.685000316862306, 5.7389833029806585, 1.0040840029883324, 15.119248728011085, 10.890549277477056, 0.42355575924657884, 0.7396798547020333, 6.515676215229256, 19.771231134634903, 0.9603846984836539, 5.87935226458886, 16.45377231522719, 10.859817612522768, 4.143477674526366, 18.918862435405327, 10.084104164687693, 12.118892615896295, 0.33754403918483833, 18.102769625798302, 14.406905886890627, 4.383232584224979, 15.108627662877478, 16.24564767055867, 17.82928337706081, 1.9766091696596688, 14.5239895516002, 11.667438252665294, 15.944309572983887, 0.17596753878222016, 14.990465881220466], "expected": [0.0001318659638645087, 7.627986155683395e-05, 5.83363547486927e-08, 0.00019768064276475772, 5.628914341024223e-07, 2.561928386728185e-06, 0.16205754930133826, 0.026563225265650137, 0.010569068191286425, 2.232979501364909e-05, 0.000366222329961622, 0.0006382881879680582, 0.00014554126782433666, 0.009765384470500767, 0.00014842887491139836, 1.4406014663597934e-07, 0.7503449272399066, 3.4611356029349094e-05, 6.461682121120123e-05, 8.242856545224636e-05, 0.032542841275045524, 0.27067172260750405, 2.141198567352036e-05, 4.788377363541839e-06, 1.6010193943160223e-07, 0.16075443086185542, 1.0439505962007737e-06, 0.0034855069198811263, 8.248428925553997e-08, 0.0015961723421102415, 2.7495755512780037e-05, 4.073403269730168e-05, 0.5217965640354982, 7.268203812612632e-08, 0.0004136350012395889, 2.8809498123343126e-05, 1.5864765970414577e-06, 1.8749565901242016e-06, 0.0001483499546330689, 0.00010347859430123842, 8.59567974522538e-08, 4.254186302963617e-06, 0.00024336937407680795, 0.05541430166457413, 0.00310965142166344, 1.327474250172184e-06, 0.0006088942623197987, 0.6890354080974394, 0.049606441056287684, 6.876251416634531e-07, 5.76769159823981e-07, 1.476182451628888, 0.0005591443150814995, 5.655614051165173e-05, 0.13850045705315575, 1.1389251240099767e-06, 1.3479510180148024e-07, 0.0005883245745613605, 0.05824588257312914, 3.8746318299822473e-07, 2.2226931536883682e-05, 0.00011137008901845646, 2.381962668604375e-07, 2.8023094546483116e-05, 0.4988510237363767, 2.1385543327044742e-05, 3.12787601679734e-05, 0.005547318801792355, 7.04957651441293e-06, 0.2120233661491927, 0.001287325794063261, 6.079766754927898e-05, 2.973127883500023, 2.417740663410471e-05, 0.6238724600094155, 0.00030820457735708566, 6.18985325357698e-05, 1.0076815241779648e-05, 2.8828380016391363e-05, 0.5372585309866218, 5.365135690868492e-05, 0.12956175041980283, 0.039479605263711554, 0.0005015941566553012, 0.06526419374008152, 0.0004721486091682868, 0.04079562068998829, 0.8667052172131073, 0.18298225721354588, 1.2566577712841306e-06, 2.639422902958625e-06, 1.3784610489469034, 0.2851026462307854, 0.0010061523849277008, 0.2461720263788798, 0.0008545385376662542, 0.013738857303058207, 1.1469568740396316, 9.254165246320302e-08, 1.937000919106019e-07, 0.0008753767327319269, 0.010503927202621562, 1.1831493573283485e-05, 0.0014546327704408183, 1.2507642022729972, 7.863428510441183e-05, 0.5653509637108929, 0.10707353682456981, 1.7542670572672556e-07, 1.770385514714434e-05, 0.5290241088674736, 1.7805457891566017e-06, 2.8239399009918624e-05, 2.0027514095665667e-06, 7.374708708827484e-06, 2.491463903822778e-06, 0.5603226926785537, 4.6483462654338036e-08, 0.030281908474345514, 0.017589777263704382, 0.0394168938555898, 1.0845208604413889e-06, 2.390574488415907e-07, 0.020504813269459382, 5.302016170620199e-07, 0.004150982923700663, 7.773164688168376e-06, 3.966788979548071e-06, 0.21981189828001385, 1.332541575487288, 9.629342769089618e-07, 0.06299103552445884, 0.014898799252694462, 0.0022508665748695025, 8.812253333269571e-07, 1.0910488236989044, 0.004439134914008189, 0.0002168142252919898, 0.0417571227059358, 0.007939498263093935, 2.494262639835061e-07, 0.002268570532778967, 0.0008881877180796844, 0.0015011514238269014, 3.2078056349282615, 0.019800542944141113, 0.007332049928078273, 6.304443377034382e-05, 1.7928457758218904e-06, 3.6598538246449104e-07, 0.06741785318427188, 1.6960615765031588, 0.09498954766842459, 5.719142987054342e-05, 0.004088420835144301, 0.494282062113662, 1.6035097883796536e-07, 3.1587579465591403e-06, 1.1655707145682064, 6.980407481214748e-08, 0.011062979308621839, 1.2176748538391207e-07, 2.2200747875550254e-05, 0.0020241324638372517, 0.009563188723020012, 2.5960939862293134e-05, 0.35486709520302895, 9.570357518764613e-06, 6.167410861289424e-07, 0.004565985503391422, 0.01420653052198689, 0.0006395732480254143, 0.1119617929231092, 3.302694146797791e-05, 0.04292733860799225, 0.0006246953185968322, 2.150073386890964e-06, 8.236829344284439e-05, 0.002351036304366071, 0.037853948430075855, 3.3738007336188326e-05, 8.476821240735695e-05, 1.8773336505315974e-07, 6.884619283886529e-07, 0.06938430487123333, 3.5128535348261555e-07, 4.68098940183065e-07, 1.0376600807842257e-05, 0.004173974016678471, 0.024510186111898626, 0.00992617126101753, 4.349132565504868e-08, 1.7979104958819816, 0.003969938948210005, 5.64501838686242e-07, 1.6256057905300738e-05, 5.253256009964317e-05, 8.159990737861592e-07, 0.17081239769951323, 5.670938178185338e-08, 0.012962434689924588, 0.0035712476166884785, 0.0012122912352752712, 1.0971366903614768e-06, 4.4905238425950234e-07, 6.425703402295194e-05, 3.119675885569734, 0.08157918422915453, 2.203874975092629e-07, 6.378585209281426e-06, 0.020413341045416467, 0.001053905746065837, 5.539712643607002e-06, 3.735443832459291e-07, 0.19481165507426335, 9.487676787376112e-06, 3.1865138591034115e-07, 0.12116371628323928, 0.00026603697052504345, 0.0004693355568414821, 2.693061166482636e-05, 0.15883344013507536, 0.10088613699298322, 0.004652209661681438, 1.1247420509361221e-05, 3.4810200732920054, 6.375640212805715e-07, 0.008562260611920973, 0.015931756044330656, 0.007893790438053438, 1.593527456822895e-06, 1.2399648804038103e-06, 0.3641265962354128, 0.0009714476502613802, 2.8664116851447687e-06, 5.282353058133377e-06, 7.219184671187573e-05, 0.27279238321286214, 0.015143644461139475, 9.465130915232305e-06, 4.533120711528032e-06, 0.006555864914582274, 0.10064509112390121, 4.430518940317174e-05, 1.4595605831855754e-06, 0.2546297586035312, 4.7469704891954306e-08, 1.0114906420073618e-07, 1.262605546902862e-07, 0.05447461237897722, 0.00018770052421199224, 0.002082491180542042, 0.002792808299114372, 0.130972179199642, 4.613805490938342e-07, 0.023822086336897894, 0.056061956112245015, 2.434717872544452e-06, 1.2963148914025664e-07, 1.5292015657009101, 0.3274063264679159, 0.46383963731463185, 0.0758182969325788, 0.01842174011575443, 0.0015680553894993124, 0.013739906386956734, 0.6157400151612293, 0.00030971458459117256, 1.4227765654659943, 0.010397978244148405, 3.0415114572989665, 1.6027522907255798, 0.0006763239991023181, 1.5404739008777123e-05, 0.005014966521551509, 5.193735392062326e-07, 1.217795075648311e-05, 0.0305565179084908, 3.2450391965229936e-05, 5.137005292720405e-07, 0.00013272971520407445, 3.6932818190028754e-05, 0.0005107616758995346, 0.6924050689689969, 2.502525889761562e-05, 0.00011594637543015565, 0.00011526606170294557, 1.7722122835237895, 1.3955399334249116e-05, 0.2568507560192788, 0.028872153475042663, 0.00013722988318684763, 0.005127771578623688, 0.5555768606131882, 1.1436418657159193e-05, 1.7714302234358958e-07, 0.019118365931196507, 0.10789845734460238, 0.24092575336722344, 7.30571655773659e-07, 1.8157362284236565e-05, 3.041812646902252e-06, 2.296317550897401, 0.40421021665208634, 6.592117548851593e-07, 7.438660118251184e-06, 0.00339761420965074, 0.008464316329564932, 0.005008074306681066, 2.6319544728062167e-07, 3.8233241392095234, 1.5240793582152385, 2.781090971007847e-05, 5.556634931807569e-06, 0.029806873240303438, 1.1929195233357323e-05, 0.0003007014004197818, 0.002433820942852366, 0.6017553245446289, 1.6875597813448115e-06, 0.0029187334236928223, 0.01031569276562893, 5.78539629571883e-07, 1.54159352676526e-05, 0.051917889402607185, 4.316249485437223e-06, 0.0009957941588039012, 1.3107333896984348e-05, 2.9091208421469927, 0.00036215512758405575, 1.2832168600321418e-05, 0.35642513802311004, 2.0456035552952094e-05, 0.0001526670121426491, 0.003411331741634524, 0.0011295796204614302, 7.739082370979609e-08, 0.019397125321206923, 0.43812701650366487, 2.1433437322442836e-06, 5.4851700712681694e-08, 1.654045965617304, 0.000541899831381989, 1.021514183673634, 0.17706029420194425, 1.5387141860800533, 0.0030121146241143242, 0.07874614908060695, 0.00529457076428986, 0.00019151019060843722, 1.5845815773718282e-07, 1.9239317027388623e-07, 2.2501892928308527e-05, 5.755297252710694e-07, 1.4369605340878031e-05, 0.0007437903677331867, 0.02067148684230153, 1.0123989025786117e-05, 0.0003477979307294038, 0.09638767402917675, 0.00023055431901833107, 0.012615256154689416, 1.537260866511568e-05, 6.499926057315911e-08, 1.8968158877227196e-05, 0.1361145657917437, 0.051802055164614724, 8.155604347858779e-05, 6.471911247146111e-08, 1.0998372010939169e-07, 0.0005412690112384078, 0.06419046170085782, 0.003069279976250048, 1.2634223414433088e-07, 0.0002927190760007743, 3.2839478788652546e-06, 0.00022566557718729492, 0.10616829007601308, 0.12573491588563834, 7.748076812661718e-06, 1.002801616451282e-06, 0.0016514793708595405, 6.912175196384245e-06, 0.05027096222009603, 2.8201554168030278e-05, 0.0001259280856672136, 0.18895234824851453, 5.629292231395319e-05, 0.005066394421819271, 9.504008671564098e-07, 0.5085735800596977, 2.249647163440767e-07, 4.1114435323975245e-06, 0.4870136354115504, 0.00019402753993393986, 1.018637297064478, 6.764506295285061e-08, 0.003735039301173837, 1.7417897190345703e-07, 2.6704090801658866, 0.6023329971112551, 0.5942152860199459, 1.3534167192255944, 7.054365895258248e-08, 2.2868383924608874e-06, 7.602904569088181e-05, 0.5475403415935549, 0.19651020710438402, 0.0027126905593448307, 0.005908995765624174, 3.8099583083702255e-05, 0.00042980888372172736, 0.00021957225748778111, 0.3068047803971209, 1.3321430675798564e-05, 0.0010180799474515919, 0.04495384404004085, 0.056845083586661835, 0.12115205934852928, 0.00814557787115484, 0.00029323795912760943, 0.0009780648486515417, 0.3990100086745757, 0.20593986422421937, 0.0011532074886793013, 0.45366347441868005, 3.9148980211079444e-05, 0.1033839402525084, 1.7491442605167258e-05, 0.00022003545370043743, 9.152595979174874e-07, 1.7453298409455934e-06, 6.0475542360695817e-05, 2.3209882863352315e-05, 0.008102278092468707, 0.00766666354011321, 7.2443610992966784e-06, 0.524731119136929, 9.569838666284722e-06, 1.16977100250666e-07, 0.4816992662375962, 0.0004775060571732266, 0.24893111280756783, 1.296597400426148, 9.72217602663912e-06, 0.007452118715341495, 0.0933839342215229, 0.015111782466585684, 4.5461097466396445e-06, 0.007206638824499555, 0.17373853114467402, 1.6019853023031795e-06, 0.001387030592933517, 0.0005459104505171633, 3.089319030337322e-05, 0.07874815783090408, 4.923800591973415e-05, 1.0220212549893124, 4.492068188782437e-06, 4.038143921529081e-06, 0.004796581251150222, 0.48664182066461903, 0.013163726139657122, 0.2931704334390612, 1.5463989470236136e-06, 0.00019467134561232074, 0.0009614088284514464, 1.2732696258793975e-05, 1.018719819339093e-05, 3.8735890075320994e-07, 1.247670594254159, 0.009102942955750823, 1.292546307443359e-07, 0.000560225759983707, 1.8171220505741073e-05, 0.0023426962686571642, 4.920138116680471e-08, 1.9619823211879104e-07, 2.745814105041886e-05, 3.145413482256303e-05, 9.599871051605717e-07, 2.1406824438854074e-06, 0.03448006130212526, 0.00038689537676202387, 0.0030045692165670632, 0.11120014536268755, 0.0010516933946874245, 0.0020635004967808758, 6.562320171903765e-05, 0.04042284666034792, 0.0001887269387180213, 0.3054519882546642, 1.7289062637477076e-07, 1.1362034706382161e-05, 1.189822396896067, 9.434551069729093e-05, 7.459763003952068e-06, 6.598896338228059e-08, 1.8287296059093083e-05, 0.335752290463152, 0.01642114160268275, 7.864131114717804e-07, 0.009285590043366411, 2.649256200276711e-05, 0.527273958527356, 7.201154988310656e-07, 0.03830390730255767, 1.3815776167111742, 0.12938525251129576, 6.609624862031432e-05, 2.1212891433398385e-06, 1.812036515732266e-06, 3.8075095309072477e-06, 1.2000971165171652e-05, 3.513027122296164e-05, 0.00016215181012634163, 0.0006253503915408241, 0.003119170626912579, 0.2552743926469021, 7.016554473199038e-05, 0.009010762118352032, 1.5470285830220973e-07, 8.061730503724166e-06, 0.05221512724657685, 4.991476436229512e-08, 0.01685331120708219, 1.7802342249768666, 2.9430926812855836e-07, 1.9659235124801576e-05, 3.155741153986258e-06, 9.203709673472566e-05, 9.800250522874413e-08, 0.05705017445365199, 0.6573998455628721, 0.050606800594495085, 0.00017649590235240304, 4.7258338241134895e-07, 1.0754927078983367, 0.00042149354383155856, 3.740545251634196e-05, 0.6429742071880595, 8.02542929323897e-06, 4.985510069944819e-08, 0.00011585200709594092, 2.914075059909665e-05, 0.21306557790274672, 2.3432396964790216, 5.484887222872425e-05, 0.005575049101758453, 3.4937108010335656e-07, 0.4973133752256268, 7.263432871230872e-06, 0.00014944897398206774, 5.443032327731671e-07, 6.470586361121124e-07, 0.00937375455067119, 0.0018694541671479654, 0.0006264105462753161, 0.0049739051829745095, 8.260188920474265e-06, 8.908809373085624e-07, 0.0004231177116029412, 0.00023609003658115667, 0.0005021277227604088, 1.2173386352524682e-06, 5.162194948339721e-07, 0.0014268272426227174, 0.050957509367568106, 1.5142348551971e-06, 1.4899567933520989e-06, 0.015549861299175134, 0.015521443841762156, 0.008204640059867796, 0.4670394662918599, 0.0006081917094682939, 5.513862192972671e-07, 0.00015436992762630572, 0.003450862838638091, 0.5038972662947929, 0.014414183467113855, 0.004602335077597687, 1.0914342965407567e-07, 4.498898094158645e-06, 0.012868291436623195, 0.011034914866407184, 3.9954356735108315e-07, 0.058935792961402, 2.460224682984035e-07, 2.169714679825351e-05, 0.00035802883759188895, 1.4094579281134267e-06, 4.24354124354893e-05, 1.9948434584332543e-05, 5.178186062158267e-08, 0.00015508514387678173, 0.0002768230503593522, 0.14481835005735783, 5.6643684023852415e-06, 1.5668809237153937e-05, 9.139552700628272e-07, 0.0010247961026518264, 1.5152905059822827e-05, 0.002597982300616797, 8.579671340324253e-06, 0.558762514823836, 0.03367434640776495, 0.006444651208062425, 0.00010285185535435074, 0.001064680567062341, 1.1626027572877917, 0.12432654456388233, 5.1709678065765045e-05, 0.00016365527334268358, 0.00010326138451679503, 2.2025540516290307e-07, 0.004162682134418554, 5.445610159668478e-06, 0.002044163239042726, 0.47554632694927845, 2.577652603441359e-07, 0.23291192580674608, 0.001985723830161442, 2.0158256985570023e-05, 0.08603841232144517, 0.0020209628587213894, 2.14049777593931e-07, 2.8703514172951926e-07, 5.950889287093898e-07, 7.050228598207478e-07, 1.5545601306985012e-06, 0.001822258445546548, 4.4978836914466086e-07, 0.004794942869810844, 0.04014719087051698, 0.019298113258435237, 0.013157303629822183, 1.661583092174296e-05, 0.002704917830499732, 2.861389388324359e-07, 0.19502641664577022, 1.1058392697547037e-06, 0.002569235505841222, 0.00012480422498446797, 0.15423933908153525, 0.7933413816850803, 1.6528257691373815e-07, 0.0030604820767250623, 0.23180558759625586, 1.1924497051618265e-06, 0.02594758877353876, 0.010294814972953193, 2.2915767874457676e-07, 5.46399377363064e-05, 0.7716763830840424, 8.864836174824049e-05, 1.438481071828364, 0.009191890942046314, 0.5652234460255625, 8.854917307404246e-06, 0.00010071086859839315, 0.01955140930659537, 1.571241226729833e-05, 2.273103054949633e-07, 1.8629932730405e-07, 0.9046681306245516, 0.04854352188486239, 0.0019469452010907771, 4.920118441376471, 0.06932711207547554, 0.0001437012815631383, 0.013732656242356967, 0.0015734000895389203, 0.016161818743966043, 1.2128288398999145e-07, 7.347769812544507e-07, 0.05059132577354395, 1.2225966598044853e-05, 0.0002995367543594867, 1.1121915210174592e-06, 1.216782429471787e-07, 0.02109543288450421, 0.17064289492115714, 0.23757808336865255, 1.8126662510042355e-06, 7.832054362429768e-08, 0.019604404770614783, 0.0018410735293854913, 9.33605803553734e-07, 1.3374643600180446e-06, 5.881264148152128e-08, 4.323372205513497e-06, 8.866937177196917e-05, 1.3719123676626135e-07, 0.00231660105808263, 0.25437013296211475, 4.266916708487954e-06, 0.006425469328846552, 9.65759252368924e-06, 1.9724696397238577e-06, 2.0833804075931682e-07, 0.022506118999452554, 0.0018905402174689424, 3.1487995443116565, 0.22420215621738876, 6.793708743749524e-08, 2.366654753834854e-07, 0.07906362907847568, 0.003962310184572846, 0.09221093039119468, 3.763130177437067e-06, 0.0008714139315523368, 0.0013392862891802957, 9.601832908309709e-08, 8.373347907414775e-08, 0.00011811269471960126, 0.06721614792259414, 0.0002167451316955668, 0.0018300681317869416, 0.10607175979948916, 0.00513224645672598, 2.8240141856557623e-07, 0.0004032031733004303, 2.4504511168198892e-05, 9.282104066240246e-06, 0.0004930197642847112, 1.4354689234798718e-06, 0.013547184383191427, 6.416765646576885e-07, 0.31987406733149687, 3.5363137141140747e-07, 0.01082316035950091, 0.0024012652286767794, 0.0011691563992181507, 0.6321049979561963, 0.034044684331835134, 0.301268047087627, 8.091011174545541e-07, 0.00013184333866941172, 3.708714034212177e-05, 6.920267204954351e-07, 8.180291954381058e-07, 3.301912296076562e-05, 4.324511025392661e-07, 0.5295445834880639, 0.01389366164736546, 5.21900449324977e-08, 0.0013808098288572105, 1.844000550187953e-07, 1.7358568008174013, 0.09935896795892195, 0.009687053899856905, 1.2029483716273455e-05, 1.7821443203926417e-05, 0.00517546103125884, 0.00021527087799923532, 6.987699856418228e-07, 0.0007717812136743138, 0.35829916209046997, 1.379028292505619, 0.5271077117493447, 0.00015959403395214054, 3.3710181873734525e-05, 0.09062320053447648, 0.31176552511845823, 7.7036845158038e-06, 8.328988001785576e-08, 0.23360880603869982, 0.002947449630151218, 0.09120155629509258, 0.0017637455448698857, 9.873849238002631e-05, 0.00030323795533599085, 2.2317476417620538e-07, 0.010423152819447145, 5.439971453241092e-08, 0.0007718030203558581, 0.0002600200991099797, 4.467861344413151e-05, 8.348185206910535e-06, 7.060692116700678e-05, 0.0001995767904096144, 0.00850653105751885, 2.421821376927708e-06, 0.022003352891331082, 0.22818558028141453, 0.11741394520291158, 0.4160983274260657, 0.020656363915670536, 1.3731261874772078e-06, 1.6083922652954408e-06, 2.4919296865143e-06, 0.0002358604108601199, 1.8432753678324156e-06, 3.9622291221689295e-05, 0.00019946653203544587, 0.008056108780523846, 0.0023950722113788066, 0.008042335604951146, 5.846053795444995e-07, 0.0002587284924995929, 5.750548060017288e-05, 0.15877016300008684, 0.0687143264821289, 8.182179040527237e-08, 0.9554134589859014, 1.947064841805432e-07, 0.0004314746686720049, 0.00014785898314340166, 0.7386028598053189, 0.0008014858914786339, 0.04860557497610328, 0.00030923543133605383, 1.2637969976830259e-05, 2.673046955126868e-06, 0.003271286663647321, 7.730032360530744e-07, 0.0013221213856068367, 0.15827389919700846, 0.015008965825896474, 0.08641279505043542, 0.7375073295434998, 0.1147998084578605, 0.0116124468702432, 0.0045008848272011, 2.2299775910079456e-06, 0.0004172406883002023, 0.05674571854907638, 0.0002999149680276492, 3.3545798744845446e-07, 0.024317501171598838, 0.3252165319112589, 0.001156830377976753, 0.21129402854229623, 0.10132318354995448, 4.258358281411379e-06, 0.1586168891440759, 3.152296524767368e-07, 0.007060785967906872, 1.1708852109892316e-06, 3.693314754099172e-05, 0.04189156647678005, 4.3444808121899746e-07, 3.462817503148069e-05, 3.518672133202185e-05, 0.014915200032169293, 8.160482145844032e-07, 0.0003248747087153713, 0.031447265759989844, 0.0019340001679191009, 0.3482913394740837, 0.8922972381888234, 0.09543518402620191, 0.10255973435819324, 1.6546724912650023e-07, 4.13237685577601e-05, 3.089048674397896e-07, 5.483986356963909e-07, 3.3458526732400256e-07, 3.6926940921861723e-06, 0.39611427002421856, 9.351196028489994e-08, 1.456762899798635e-06, 0.03961753849224065, 0.03811419565416548, 0.005251075985033976, 0.8935899735254726, 7.173755685931222e-05, 1.2711378807574722e-05, 0.5569152021801592, 0.0038676348871002123, 3.0956686135051688, 2.650129178682937e-05, 8.511535812534458e-06, 0.0004050508585669442, 0.007918142247649687, 1.0036411392123398e-07, 6.295134479636767e-07, 4.690851529325308e-06, 4.055972855320535e-06, 1.0181417393745034e-05, 0.4882353876199854, 1.0156200739909832e-05, 9.57762916824226e-05, 0.00046232017126339415, 1.8505199833753853e-07, 0.0004777520049218531, 3.400932560860797e-05, 6.204680708495633e-05, 1.1116227158395091, 2.081610813962345e-05, 0.025191589732710108, 0.0004317682492065154, 1.021486718095922e-05, 1.0074528129258022e-06, 0.15938054340260432, 0.0027318146534450923, 0.014181075076631411, 0.00042831547966656777, 6.82701798994557e-06, 0.053335256375916254, 6.78515364469219e-05, 8.670342852761449e-07, 0.0008253659873332837, 0.6006762192916704, 1.8099826779521497e-06, 1.6924195612773445e-07, 0.18265972283957432, 0.0032359686486709265, 0.015019724242690682, 5.328988598761642e-05, 7.553226018966937e-08, 7.563788159900957e-08, 8.63226387472249e-06, 1.9521526020446545e-07, 4.3786458150532175, 0.006167414374722319, 1.5396771920039474, 0.01807001065857692, 1.217161843471294, 0.00031837654477220975, 1.801971197016556e-07, 0.0036991702146784234, 0.05910414451628586, 1.2617471480570888e-07, 1.3840847276498854e-07, 0.000503275754711813, 0.16021523565082868, 0.10766601052899374, 0.007206387103258042, 0.4142660861087457, 1.2859451707458358e-06, 0.012554781461740737, 0.023922338276284746, 6.36849945395174e-05, 3.0131735859717036e-05, 0.45213608315201337, 0.04029433027988845, 0.00016617086600708843, 0.02565697250610948, 0.00013771836156543227, 0.011924504664007768, 0.6542606719114836, 0.00019057484212852877, 1.5340471786968278e-06, 6.848945582260808e-07, 0.13794742584582145, 0.000397348300837391, 0.00027508080480902495, 2.2226596349148098e-07, 0.00010234195907582691, 0.9431079274357826, 4.064142965569588e-06, 4.070731864214453, 3.44332690182629e-05, 6.930549781961707e-08, 0.05676503557901315, 0.004139151706880752, 0.03467971216462974, 8.873188313980135e-07, 0.0033564157878039663, 0.004382265910949748, 0.0001262063668202009, 0.06639900392663109, 6.632199984772983e-08, 0.35054891505647856, 5.2755802235571386e-08, 0.0015456031252919684, 5.352203972450867e-06, 1.2026521530237079e-05, 0.0016164086732519606, 0.12028135335246533, 0.02175111941785647, 1.0369007324886768, 4.3766177552030294e-06, 0.00022156655908841808, 1.8665117222040846, 1.3240273732907604, 0.011139002609053074, 5.3817764966132864e-08, 1.077987085601636, 0.019288798863479485, 1.2476903422225294e-06, 0.00022789098203708, 0.0828018110952809, 1.2103388541413275e-07, 0.00046264419152328986, 7.157004104901858e-05, 2.0907931414794163, 2.6252060014454115e-07, 8.528564421848815e-06, 0.06797976714954818, 4.4204352722693346e-06, 1.5180441692997111e-06, 3.401530834751432e-07, 0.4669980690919109, 7.643900605534708e-06, 0.00010853962561459329, 2.0160359038968086e-06, 2.738744932367392, 4.938381461424489e-06]} diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/entropy/test/fixtures/python/runner.py b/lib/node_modules/@stdlib/stats/base/dists/planck/entropy/test/fixtures/python/runner.py new file mode 100644 index 000000000000..8b3d34e9c760 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/entropy/test/fixtures/python/runner.py @@ -0,0 +1,77 @@ +#!/usr/bin/env python +# +# @license Apache-2.0 +# +# Copyright (c) 2025 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""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(lam, name): + """ + Generate fixture data and write to file. + + # Arguments + + * `lam`: shape parameter. + * `name::str`: output filename. + + # Examples + + ```python + python> lam = np.random.rand(1000) * 20.0 + python> gen(lam, "data.json") + ``` + """ + # Compute entropy values: + z = np.array(planck.entropy(lam)) + + # Store data to be written to file as a dictionary: + data = { + "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.""" + lam = np.random.rand(1000) * 20.0 + gen(lam, "data.json") + + +if __name__ == "__main__": + main() diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/entropy/test/test.js b/lib/node_modules/@stdlib/stats/base/dists/planck/entropy/test/test.js new file mode 100644 index 000000000000..4901f2c3368f --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/entropy/test/test.js @@ -0,0 +1,82 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var abs = require( '@stdlib/math/base/special/abs' ); +var EPS = require( '@stdlib/constants/float64/eps' ); +var entropy = require( './../lib' ); + + +// FIXTURES // + +var data = require( './fixtures/python/data.json' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof entropy, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'if provided `NaN` for `lambda`, the function returns `NaN`', function test( t ) { + var v = entropy( NaN ); + t.equal( isnan( v ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'if provided a shape parameter `lambda` which is nonpositive, the function returns `NaN`', function test( t ) { + var v; + + v = entropy( 0.0 ); + t.equal( isnan( v ), true, 'returns expected value' ); + + v = entropy( -1.0 ); + t.equal( isnan( v ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns the entropy of a Planck distribution', function test( t ) { + var expected; + var lambda; + var delta; + var tol; + var i; + var y; + + expected = data.expected; + lambda = data.lambda; + for ( i = 0; i < expected.length; i++ ) { + y = entropy( lambda[ i ] ); + if ( y === expected[ i ] ) { + t.equal( y, expected[ i ], 'lambda: '+lambda[ i ]+', y: '+y+', expected: '+expected[ i ] ); + } else { + delta = abs( y - expected[ i ] ); + tol = 2.0 * EPS * abs( expected[ i ] ); + t.ok( delta <= tol, 'within tolerance. lambda: '+lambda[ i ]+'. y: '+y+'. E: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' ); + } + } + t.end(); +});