From b679e632361d26b0310b96d15788365f8e7710c3 Mon Sep 17 00:00:00 2001 From: manit2004 Date: Tue, 23 Dec 2025 16:20:30 +0530 Subject: [PATCH 1/9] feat: implement Wald distribution PDF #209 --- .../stdlib/stats/base/dists/wald/pdf.h | 38 ++++++ .../stats/base/dists/wald/pdf/lib/factory.js | 96 ++++++++++++++ .../stats/base/dists/wald/pdf/lib/index.js | 51 +++++++ .../stats/base/dists/wald/pdf/lib/main.js | 124 ++++++++++++++++++ .../stats/base/dists/wald/pdf/lib/native.js | 0 .../stats/base/dists/wald/pdf/src/Makefile | 70 ++++++++++ .../stats/base/dists/wald/pdf/src/addon.c | 22 ++++ .../stats/base/dists/wald/pdf/src/main.c | 64 +++++++++ 8 files changed, 465 insertions(+) create mode 100644 lib/node_modules/@stdlib/stats/base/dists/wald/pdf/include/stdlib/stats/base/dists/wald/pdf.h create mode 100644 lib/node_modules/@stdlib/stats/base/dists/wald/pdf/lib/factory.js create mode 100644 lib/node_modules/@stdlib/stats/base/dists/wald/pdf/lib/index.js create mode 100644 lib/node_modules/@stdlib/stats/base/dists/wald/pdf/lib/main.js create mode 100644 lib/node_modules/@stdlib/stats/base/dists/wald/pdf/lib/native.js create mode 100644 lib/node_modules/@stdlib/stats/base/dists/wald/pdf/src/Makefile create mode 100644 lib/node_modules/@stdlib/stats/base/dists/wald/pdf/src/addon.c create mode 100644 lib/node_modules/@stdlib/stats/base/dists/wald/pdf/src/main.c diff --git a/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/include/stdlib/stats/base/dists/wald/pdf.h b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/include/stdlib/stats/base/dists/wald/pdf.h new file mode 100644 index 000000000000..223a83a187dd --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/include/stdlib/stats/base/dists/wald/pdf.h @@ -0,0 +1,38 @@ +/** +* @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. +*/ + +#ifndef STDLIB_STATS_BASE_DISTS_WALD_PDF_H +#define STDLIB_STATS_BASE_DISTS_WALD_PDF_H + +/* +* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. +*/ +#ifdef __cplusplus +extern "C" { +#endif + +/** +* Evaluates the probability density function (PDF) for a Wald distribution with mean `mu` and shape parameter `lambda` at a value `x`. +*/ +double stdlib_base_dists_wald_pdf( const double x, const double mu, const double lambda ); + +#ifdef __cplusplus +} +#endif + +#endif // !STDLIB_STATS_BASE_DISTS_WALD_PDF_H diff --git a/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/lib/factory.js b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/lib/factory.js new file mode 100644 index 000000000000..52c488e85c8b --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/lib/factory.js @@ -0,0 +1,96 @@ +/** +* @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'; + +// MODULES // + +var constantFunction = require( '@stdlib/utils/constant-function' ); +var degenerate = require( '@stdlib/stats/base/dists/degenerate/pdf' ).factory; +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var sqrt = require( '@stdlib/math/base/special/sqrt' ); +var exp = require( '@stdlib/math/base/special/exp' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var TWO_PI = require( '@stdlib/constants/float64/two-pi' ); + + +// MAIN // + +/** +* Returns a function for evaluating the probability density function (PDF) for a Wald distribution. +* +* @param {PositiveNumber} mu - mean +* @param {PositiveNumber} lambda - shape parameter +* @returns {Function} function to evaluate the probability density function +* +* @example +* var pdf = factory( 1.0, 1.0 ); +* var y = pdf( 2.0 ); +* // returns ~0.110 +* +* y = pdf( 0.5 ); +* // returns ~0.879 +*/ +function factory( mu, lambda ) { + var A; + var B; + if ( + isnan( mu ) || + isnan( lambda ) + ) { + return constantFunction( NaN ); + } + if ( mu <= 0.0 ) { + return constantFunction( NaN ); + } + if ( lambda < 0.0 ) { + return constantFunction( NaN ); + } + if ( lambda === 0.0 ) { + return degenerate( mu ); + } + A = sqrt( lambda / TWO_PI ); + B = -lambda / ( 2.0 * pow( mu, 2.0 ) ); + return pdf; + + /** + * Evaluates the probability density function (PDF) for a Wald distribution. + * + * @private + * @param {number} x - input value + * @returns {number} evaluated probability density function + * + * @example + * var y = pdf( 2.0 ); + * // returns + */ + function pdf( x ) { + if ( isnan( x ) ) { + return NaN; + } + if ( x <= 0.0 ) { + return 0.0; + } + return A / sqrt( pow( x, 3.0 ) ) * exp( B * pow( x - mu, 2.0 ) / x ); + } +} + + +// EXPORTS // + +module.exports = factory; diff --git a/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/lib/index.js b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/lib/index.js new file mode 100644 index 000000000000..7ff97a61f90d --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/lib/index.js @@ -0,0 +1,51 @@ +/** +* @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'; + +/** +* Wald distribution probability density function (PDF). +* +* @module @stdlib/stats/base/dists/wald/pdf +* +* @example +* var pdf = require( '@stdlib/stats/base/dists/wald/pdf' ); +* +* var y = pdf( 2.0, 1.0, 1.0 ); +* // returns ~0.110 +* +* var myPDF = pdf.factory( 1.0, 1.0 ); +* y = myPDF( 0.5 ); +* // returns ~0.879 +*/ + +// 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/wald/pdf/lib/main.js b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/lib/main.js new file mode 100644 index 000000000000..26472a363b8d --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/lib/main.js @@ -0,0 +1,124 @@ +/** +* @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'; + +// MODULES // + +var exp = require( '@stdlib/math/base/special/exp' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var sqrt = require( '@stdlib/math/base/special/sqrt' ); +var TWO_PI = require( '@stdlib/constants/float64/two-pi' ); +var PINF = require( '@stdlib/constants/float64/pinf' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); + + +// MAIN // + +/** +* Evaluates the probability density function (PDF) for a Wald distribution with mean `mu` and shape parameter `lambda` at a value `x`. +* +* @param {number} x - input value +* @param {PositiveNumber} mu - mean +* @param {PositiveNumber} lambda - shape parameter +* @returns {number} evaluated probability density function +* +* @example +* var y = pdf( 2.0, 1.0, 1.0 ); +* // returns ~ 0.110 +* +* @example +* var y = pdf( 0.5, 2.0, 3.0 ); +* // returns ~ 0.362 +* +* @example +* var y = pdf( NaN, 1.0, 1.0 ); +* // returns NaN +* +* @example +* var y = pdf( 1.0, NaN, 1.0 ); +* // returns NaN +* +* @example +* var y = pdf( 1.0, 1.0, NaN ); +* // returns NaN +* +* @example +* // Non-positive mean: +* var y = pdf( 2.0, 0.0, 1.0 ); +* // returns NaN +* +* @example +* var y = pdf( 2.0, -1.0, 1.0 ); +* // returns NaN +* +* @example +* // Negative shape parameter: +* var y = pdf( 2.0, 1.0, -1.0 ); +* // returns NaN +* +* @example +* // Zero shape parameter (degenerate distribution): +* var y = pdf( 2.0, 1.0, 0.0 ); +* // returns 0.0 +* +* @example +* var y = pdf( 1.0, 1.0, 0.0 ); +* // returns Infinity +* +* @example +* // Non-positive x: +* var y = pdf( 0.0, 1.0, 1.0 ); +* // returns 0.0 +* +* @example +* var y = pdf( -1.0, 1.0, 1.0 ); +* // returns 0.0 +*/ +function pdf( x, mu, lambda ) { + var A; + var B; + + if ( + isnan( x ) || + isnan( mu ) || + isnan( lambda ) + ) { + return NaN; + } + if ( mu <= 0.0 ) { + return NaN; + } + if ( lambda < 0.0 ) { + return NaN; + } + if ( lambda === 0.0 ) { + return ( x === mu ) ? PINF : 0.0; + } + if ( x <= 0.0 ) { + return 0.0; + } + A = sqrt( lambda / TWO_PI ); + B = -lambda / ( 2.0 * pow( mu, 2.0 ) ); + return A / sqrt( pow( x, 3.0 ) ) * exp( B * pow( x - mu, 2.0 ) / x ); +} + + +// EXPORTS // + +module.exports = pdf; diff --git a/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/lib/native.js b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/lib/native.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/src/Makefile b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/src/Makefile new file mode 100644 index 000000000000..7733b6180cb4 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/src/Makefile @@ -0,0 +1,70 @@ +#/ +# @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. +#/ + +# VARIABLES # + +ifndef VERBOSE + QUIET := @ +else + QUIET := +endif + +# Determine the OS ([1][1], [2][2]). +# +# [1]: https://en.wikipedia.org/wiki/Uname#Examples +# [2]: http://stackoverflow.com/a/27776822/2225624 +OS ?= $(shell uname) +ifneq (, $(findstring MINGW,$(OS))) + OS := WINNT +else +ifneq (, $(findstring MSYS,$(OS))) + OS := WINNT +else +ifneq (, $(findstring CYGWIN,$(OS))) + OS := WINNT +else +ifneq (, $(findstring Windows_NT,$(OS))) + OS := WINNT +endif +endif +endif +endif + + +# RULES # + +#/ +# Removes generated files for building an add-on. +# +# @example +# make clean-addon +#/ +clean-addon: + $(QUIET) -rm -f *.o *.node + +.PHONY: clean-addon + +#/ +# Removes generated files. +# +# @example +# make clean +#/ +clean: clean-addon + +.PHONY: clean diff --git a/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/src/addon.c b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/src/addon.c new file mode 100644 index 000000000000..2cdf2b4df981 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/src/addon.c @@ -0,0 +1,22 @@ +/** +* @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. +*/ + +#include "stdlib/stats/base/dists/wald/pdf.h" +#include "stdlib/math/base/napi/ternary.h" + +STDLIB_MATH_BASE_NAPI_MODULE_DDD_D( stdlib_base_dists_wald_pdf ) diff --git a/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/src/main.c b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/src/main.c new file mode 100644 index 000000000000..e26ae8894f55 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/src/main.c @@ -0,0 +1,64 @@ +/** +* @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. +*/ + +#include "stdlib/stats/base/dists/wald/pdf.h" +#include "stdlib/math/base/assert/is_nan.h" +#include "stdlib/math/base/special/sqrt.h" +#include "stdlib/math/base/special/pow.h" +#include "stdlib/math/base/special/exp.h" +#include "stdlib/constants/float64/two_pi.h" +#include "stdlib/constants/float64/pinf.h" + +/** +* Evaluates the probability density function (PDF) for a Wald distribution with mean `mu` and shape parameter `lambda` at a value `x`. +* +* @param x input value +* @param mu mean of the distribution +* @param lambda shape parameter of the distribution +* @return evaluated probability density function +* +* @example +* double y = stdlib_base_dists_wald_pdf( 2.0, 1.0, 1.0 ); +* // returns ~0.110 +*/ +double stdlib_base_dists_wald_pdf( const double x, const double mu, const double lambda ) { + double A; + double B; + if ( + stdlib_base_is_nan( x ) || + stdlib_base_is_nan( mu ) || + stdlib_base_is_nan( lambda ) + ) { + return 0.0/0.0; // NaN + } + if ( mu <= 0.0 ) { + return 0.0/0.0; // NaN + } + if ( lambda < 0.0 ) { + return 0.0/0.0; // NaN + } + if ( lambda == 0.0 ) { + return ( x == mu ) ? STDLIB_CONSTANT_FLOAT64_PINF : 0.0; + } + if ( x <= 0.0 ) { + return 0.0; + } + A = stdlib_base_sqrt( lambda / STDLIB_CONSTANT_FLOAT64_TWO_PI ); + B = -lambda / ( 2.0 * stdlib_base_pow( mu, 2.0 ) ); + return A / stdlib_base_sqrt( stdlib_base_pow( x, 3.0 ) ) * stdlib_base_exp( B * stdlib_base_pow( x - mu, 2.0 ) / x ); +} From 3f7b53fc4b4eba559053aea5819b5dc58a8757fa Mon Sep 17 00:00:00 2001 From: manit2004 Date: Tue, 23 Dec 2025 16:23:45 +0530 Subject: [PATCH 2/9] chore: add native.js content for Wald PDF #209 --- .../stats/base/dists/wald/pdf/lib/native.js | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) diff --git a/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/lib/native.js b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/lib/native.js index e69de29bb2d1..f45a68eaf6a3 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/lib/native.js +++ b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/lib/native.js @@ -0,0 +1,96 @@ +/** +* @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 addon = require( './../src/addon.node' ); + + +// MAIN // + +/** +* Evaluates the probability density function (PDF) for a Wald distribution with mean `mu` and shape parameter `lambda` at a value `x`. +* +* @private +* @param {number} x - input value +* @param {PositiveNumber} mu - mean +* @param {PositiveNumber} lambda - shape parameter +* @returns {number} evaluated probability density function +* +* @example +* var y = pdf( 2.0, 1.0, 1.0 ); +* // returns ~0.110 +* +* @example +* var y = pdf( 0.5, 2.0, 3.0 ); +* // returns ~0.362 +* +* @example +* var y = pdf( NaN, 1.0, 1.0 ); +* // returns NaN +* +* @example +* var y = pdf( 1.0, NaN, 1.0 ); +* // returns NaN +* +* @example +* var y = pdf( 1.0, 1.0, NaN ); +* // returns NaN +* +* @example +* // Non-positive mean: +* var y = pdf( 2.0, 0.0, 1.0 ); +* // returns NaN +* +* @example +* var y = pdf( 2.0, -1.0, 1.0 ); +* // returns NaN +* +* @example +* // Negative shape parameter: +* var y = pdf( 2.0, 1.0, -1.0 ); +* // returns NaN +* +* @example +* // Zero shape parameter (degenerate distribution): +* var y = pdf( 2.0, 1.0, 0.0 ); +* // returns 0.0 +* +* @example +* var y = pdf( 1.0, 1.0, 0.0 ); +* // returns Infinity +* +* @example +* // Non-positive x: +* var y = pdf( 0.0, 1.0, 1.0 ); +* // returns 0.0 +* +* @example +* var y = pdf( -1.0, 1.0, 1.0 ); +* // returns 0.0 +*/ +function pdf( x, mu, lambda ) { + return addon( x, mu, lambda ); +} + + +// EXPORTS // + +module.exports = pdf; From c082919c45f61465fecf0d5f51ff16a4ed215a77 Mon Sep 17 00:00:00 2001 From: manit2004 Date: Tue, 23 Dec 2025 16:41:27 +0530 Subject: [PATCH 3/9] fix: update copyright year to 2025 and add include.gypi #209 --- .../stats/base/dists/wald/pdf/include.gypi | 53 +++++++++++++++++++ .../stats/base/dists/wald/pdf/lib/factory.js | 2 +- .../stats/base/dists/wald/pdf/lib/index.js | 2 +- .../stats/base/dists/wald/pdf/lib/main.js | 2 +- 4 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 lib/node_modules/@stdlib/stats/base/dists/wald/pdf/include.gypi diff --git a/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/include.gypi b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/include.gypi new file mode 100644 index 000000000000..ecfaf82a3279 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/include.gypi @@ -0,0 +1,53 @@ +# @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. + +# A GYP include file for building a Node.js native add-on. +# +# Main documentation: +# +# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md +# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md +{ + # Define variables to be used throughout the configuration for all targets: + 'variables': { + # Source directory: + 'src_dir': './src', + + # Include directories: + 'include_dirs': [ + ' Date: Tue, 23 Dec 2025 16:48:33 +0530 Subject: [PATCH 4/9] chore: add manifest.json for C build configuration #209 --- .../stats/base/dists/wald/pdf/manifest.json | 93 +++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 lib/node_modules/@stdlib/stats/base/dists/wald/pdf/manifest.json diff --git a/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/manifest.json b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/manifest.json new file mode 100644 index 000000000000..2dac8970622a --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/manifest.json @@ -0,0 +1,93 @@ +{ + "options": { + "task": "build", + "wasm": false + }, + "fields": [ + { + "field": "src", + "resolve": true, + "relative": true + }, + { + "field": "include", + "resolve": true, + "relative": true + }, + { + "field": "libraries", + "resolve": false, + "relative": false + }, + { + "field": "libpath", + "resolve": true, + "relative": false + } + ], + "confs": [ + { + "task": "build", + "wasm": false, + "src": [ + "./src/main.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/math/base/napi/ternary", + "@stdlib/constants/float64/two-pi", + "@stdlib/math/base/assert/is-nan", + "@stdlib/math/base/special/sqrt", + "@stdlib/math/base/special/pow", + "@stdlib/math/base/special/exp", + "@stdlib/constants/float64/pinf" + ] + }, + { + "task": "benchmark", + "wasm": false, + "src": [ + "./src/main.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/constants/float64/two-pi", + "@stdlib/math/base/assert/is-nan", + "@stdlib/math/base/special/sqrt", + "@stdlib/math/base/special/pow", + "@stdlib/math/base/special/exp", + "@stdlib/constants/float64/pinf", + "@stdlib/constants/float64/eps" + ] + }, + { + "task": "examples", + "wasm": false, + "src": [ + "./src/main.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/constants/float64/two-pi", + "@stdlib/math/base/assert/is-nan", + "@stdlib/math/base/special/sqrt", + "@stdlib/math/base/special/pow", + "@stdlib/math/base/special/exp", + "@stdlib/constants/float64/pinf", + "@stdlib/constants/float64/eps" + ] + } + ] +} From cc278e6588a3969d153bc40e0ff9cd0e37c8aba9 Mon Sep 17 00:00:00 2001 From: manit2004 Date: Tue, 23 Dec 2025 16:56:47 +0530 Subject: [PATCH 5/9] chore: add binding.gyp for native addon build #209 --- .../stats/base/dists/wald/pdf/binding.gyp | 170 ++++++++++++++++++ 1 file changed, 170 insertions(+) create mode 100644 lib/node_modules/@stdlib/stats/base/dists/wald/pdf/binding.gyp diff --git a/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/binding.gyp b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/binding.gyp new file mode 100644 index 000000000000..68a1ca11d160 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/binding.gyp @@ -0,0 +1,170 @@ +# @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. + +# A `.gyp` file for building a Node.js native add-on. +# +# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md +# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md +{ + # List of files to include in this file: + 'includes': [ + './include.gypi', + ], + + # Define variables to be used throughout the configuration for all targets: + 'variables': { + # Target name should match the add-on export name: + 'addon_target_name%': 'addon', + + # Set variables based on the host OS: + 'conditions': [ + [ + 'OS=="win"', + { + # Define the object file suffix: + 'obj': 'obj', + }, + { + # Define the object file suffix: + 'obj': 'o', + } + ], # end condition (OS=="win") + ], # end conditions + }, # end variables + + # Define compile targets: + 'targets': [ + + # Target to generate an add-on: + { + # The target name should match the add-on export name: + 'target_name': '<(addon_target_name)', + + # Define dependencies: + 'dependencies': [], + + # Define directories which contain relevant include headers: + 'include_dirs': [ + # Local include directory: + '<@(include_dirs)', + ], + + # List of source files: + 'sources': [ + '<@(src_files)', + ], + + # Settings which should be applied when a target's object files are used as linker input: + 'link_settings': { + # Define libraries: + 'libraries': [ + '<@(libraries)', + ], + + # Define library directories: + 'library_dirs': [ + '<@(library_dirs)', + ], + }, + + # C/C++ compiler flags: + 'cflags': [ + # Enable commonly used warning options: + '-Wall', + + # Aggressive optimization: + '-O3', + ], + + # C specific compiler flags: + 'cflags_c': [ + # Specify the C standard to which a program is expected to conform: + '-std=c99', + ], + + # C++ specific compiler flags: + 'cflags_cpp': [ + # Specify the C++ standard to which a program is expected to conform: + '-std=c++11', + ], + + # Linker flags: + 'ldflags': [], + + # Apply conditions based on the host OS: + 'conditions': [ + [ + 'OS=="mac"', + { + # Linker flags: + 'ldflags': [ + '-undefined dynamic_lookup', + '-Wl,-no-pie', + '-Wl,-search_paths_first', + ], + }, + ], # end condition (OS=="mac") + [ + 'OS!="win"', + { + # C/C++ flags: + 'cflags': [ + # Generate platform-independent code: + '-fPIC', + ], + }, + ], # end condition (OS!="win") + ], # end conditions + }, # end target <(addon_target_name) + + # Target to copy a generated add-on to a standard location: + { + 'target_name': 'copy_addon', + + # Declare that the output of this target is not linked: + 'type': 'none', + + # Define dependencies: + 'dependencies': [ + # Require that the add-on be generated before building this target: + '<(addon_target_name)', + ], + + # Define a list of actions: + 'actions': [ + { + 'action_name': 'copy_addon', + 'message': 'Copying addon...', + + # Explicitly list the inputs in the command-line invocation below: + 'inputs': [], + + # Declare the expected outputs: + 'outputs': [ + '<(addon_output_dir)/<(addon_target_name).node', + ], + + # Define the command-line invocation: + 'action': [ + 'cp', + '<(PRODUCT_DIR)/<(addon_target_name).node', + '<(addon_output_dir)/<(addon_target_name).node', + ], + }, + ], # end actions + }, # end target copy_addon + ], # end targets +} From e211cdb97bd49f7377e675285fe9e2012bde0dc3 Mon Sep 17 00:00:00 2001 From: manit2004 Date: Wed, 24 Dec 2025 20:02:08 +0530 Subject: [PATCH 6/9] added examples, package.json and fixed if statement flow #209 --- .../base/dists/wald/pdf/examples/c/Makefile | 146 ++++++++++++++++++ .../base/dists/wald/pdf/examples/c/example.c | 43 ++++++ .../base/dists/wald/pdf/examples/index.js | 36 +++++ .../stats/base/dists/wald/pdf/lib/factory.js | 10 +- .../stats/base/dists/wald/pdf/lib/main.js | 10 +- .../stats/base/dists/wald/pdf/package.json | 69 +++++++++ .../stats/base/dists/wald/pdf/src/main.c | 10 +- 7 files changed, 303 insertions(+), 21 deletions(-) create mode 100644 lib/node_modules/@stdlib/stats/base/dists/wald/pdf/examples/c/Makefile create mode 100644 lib/node_modules/@stdlib/stats/base/dists/wald/pdf/examples/c/example.c create mode 100644 lib/node_modules/@stdlib/stats/base/dists/wald/pdf/examples/index.js create mode 100644 lib/node_modules/@stdlib/stats/base/dists/wald/pdf/package.json diff --git a/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/examples/c/Makefile b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/examples/c/Makefile new file mode 100644 index 000000000000..25ced822f96a --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/examples/c/Makefile @@ -0,0 +1,146 @@ +#/ +# @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. +#/ + +# VARIABLES # + +ifndef VERBOSE + QUIET := @ +else + QUIET := +endif + +# Determine the OS ([1][1], [2][2]). +# +# [1]: https://en.wikipedia.org/wiki/Uname#Examples +# [2]: http://stackoverflow.com/a/27776822/2225624 +OS ?= $(shell uname) +ifneq (, $(findstring MINGW,$(OS))) + OS := WINNT +else +ifneq (, $(findstring MSYS,$(OS))) + OS := WINNT +else +ifneq (, $(findstring CYGWIN,$(OS))) + OS := WINNT +else +ifneq (, $(findstring Windows_NT,$(OS))) + OS := WINNT +endif +endif +endif +endif + +# Define the program used for compiling C source files: +ifdef C_COMPILER + CC := $(C_COMPILER) +else + CC := gcc +endif + +# Define the command-line options when compiling C files: +CFLAGS ?= \ + -std=c99 \ + -O3 \ + -Wall \ + -pedantic + +# Determine whether to generate position independent code ([1][1], [2][2]). +# +# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options +# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option +ifeq ($(OS), WINNT) + fPIC ?= +else + fPIC ?= -fPIC +endif + +# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): +INCLUDE ?= + +# List of source files: +SOURCE_FILES ?= + +# List of libraries (e.g., `-lopenblas -lpthread`): +LIBRARIES ?= + +# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): +LIBPATH ?= + +# List of C targets: +c_targets := example.out + + +# RULES # + +#/ +# Compiles source files. +# +# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) +# @param {string} [CFLAGS] - C compiler options +# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) +# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) +# @param {string} [SOURCE_FILES] - list of source files +# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) +# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) +# +# @example +# make +# +# @example +# make all +#/ +all: $(c_targets) + +.PHONY: all + +#/ +# Compiles C source files. +# +# @private +# @param {string} CC - C compiler (e.g., `gcc`) +# @param {string} CFLAGS - C compiler options +# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) +# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) +# @param {string} SOURCE_FILES - list of source files +# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) +# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) +#/ +$(c_targets): %.out: %.c + $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) + +#/ +# Runs compiled examples. +# +# @example +# make run +#/ +run: $(c_targets) + $(QUIET) ./$< + +.PHONY: run + +#/ +# Removes generated files. +# +# @example +# make clean +#/ +clean: + $(QUIET) -rm -f *.o *.out + +.PHONY: clean diff --git a/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/examples/c/example.c b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/examples/c/example.c new file mode 100644 index 000000000000..07d543839629 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/examples/c/example.c @@ -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. +*/ + +#include "stdlib/stats/base/dists/wald/pdf.h" +#include "stdlib/constants/float64/eps.h" +#include +#include + +static double random_uniform( const double min, const double max ) { + double v = (double)rand() / ( (double)RAND_MAX + 1.0 ); + return min + ( v*(max-min) ); +} + +int main( void ) { + double lambda; + double mu; + double x; + double y; + int i; + + for ( i = 0; i < 10; i++ ) { + x = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 10.0 ); + mu = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 10.0 ); + lambda = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 10.0 ); + y = stdlib_base_dists_wald_pdf( x, mu, lambda ); + printf( "x: %lf, µ: %lf, λ: %lf, f(x;µ,λ): %lf\n", x, mu, lambda, y ); + } +} diff --git a/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/examples/index.js b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/examples/index.js new file mode 100644 index 000000000000..362f2059c195 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/examples/index.js @@ -0,0 +1,36 @@ +/** +* @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 randu = require( '@stdlib/random/base/randu' ); +var pdf = require( './../lib' ); + +var lambda; +var mu; +var x; +var y; +var i; + +for ( i = 0; i < 10; i++ ) { + x = randu() * 10.0; + mu = randu() * 10.0; + lambda = randu() * 10.0; + y = pdf( x, mu, lambda ); + console.log( 'x: %d, µ: %d, λ: %d, f(x;µ,λ): %d', x.toFixed( 4 ), mu.toFixed( 4 ), lambda.toFixed( 4 ), y.toFixed( 4 ) ); +} diff --git a/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/lib/factory.js b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/lib/factory.js index eb67e29c5c98..aab9b94a4818 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/lib/factory.js +++ b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/lib/factory.js @@ -51,16 +51,12 @@ function factory( mu, lambda ) { var B; if ( isnan( mu ) || - isnan( lambda ) + isnan( lambda ) || + mu <= 0.0 || + lambda < 0.0 ) { return constantFunction( NaN ); } - if ( mu <= 0.0 ) { - return constantFunction( NaN ); - } - if ( lambda < 0.0 ) { - return constantFunction( NaN ); - } if ( lambda === 0.0 ) { return degenerate( mu ); } diff --git a/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/lib/main.js b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/lib/main.js index bbdedec4c7bc..a82966145c6f 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/lib/main.js +++ b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/lib/main.js @@ -97,16 +97,12 @@ function pdf( x, mu, lambda ) { if ( isnan( x ) || isnan( mu ) || - isnan( lambda ) + isnan( lambda ) || + mu <= 0.0 || + lambda < 0.0 ) { return NaN; } - if ( mu <= 0.0 ) { - return NaN; - } - if ( lambda < 0.0 ) { - return NaN; - } if ( lambda === 0.0 ) { return ( x === mu ) ? PINF : 0.0; } diff --git a/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/package.json b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/package.json new file mode 100644 index 000000000000..4d5b87e5fe0d --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/package.json @@ -0,0 +1,69 @@ +{ + "name": "@stdlib/stats/base/dists/wald/pdf", + "version": "0.0.0", + "description": "Wald distribution probability density function (PDF).", + "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", + "gypfile": true, + "directories": { + "benchmark": "./benchmark", + "doc": "./docs", + "example": "./examples", + "include": "./include", + "lib": "./lib", + "src": "./src", + "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", + "continuous", + "probability", + "pdf", + "wald", + "inverse-gaussian", + "inverse gaussian", + "univariate" + ] +} diff --git a/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/src/main.c b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/src/main.c index e26ae8894f55..13c8186b634e 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/src/main.c +++ b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/src/main.c @@ -42,16 +42,12 @@ double stdlib_base_dists_wald_pdf( const double x, const double mu, const double if ( stdlib_base_is_nan( x ) || stdlib_base_is_nan( mu ) || - stdlib_base_is_nan( lambda ) + stdlib_base_is_nan( lambda ) || + mu <= 0.0 || + lambda < 0.0 ) { return 0.0/0.0; // NaN } - if ( mu <= 0.0 ) { - return 0.0/0.0; // NaN - } - if ( lambda < 0.0 ) { - return 0.0/0.0; // NaN - } if ( lambda == 0.0 ) { return ( x == mu ) ? STDLIB_CONSTANT_FLOAT64_PINF : 0.0; } From 0eeb7b7baf1dbeec75d01d9746b053633bc0948c Mon Sep 17 00:00:00 2001 From: manit2004 Date: Thu, 25 Dec 2025 00:05:45 +0530 Subject: [PATCH 7/9] added docs #209 --- .../pdf/docs/img/equation_wald_wald_pdf.svg | 2 + .../stats/base/dists/wald/pdf/docs/repl.txt | 87 ++++++++++++ .../base/dists/wald/pdf/docs/types/index.d.ts | 124 ++++++++++++++++++ .../base/dists/wald/pdf/docs/types/test.ts | 119 +++++++++++++++++ 4 files changed, 332 insertions(+) create mode 100644 lib/node_modules/@stdlib/stats/base/dists/wald/pdf/docs/img/equation_wald_wald_pdf.svg create mode 100644 lib/node_modules/@stdlib/stats/base/dists/wald/pdf/docs/repl.txt create mode 100644 lib/node_modules/@stdlib/stats/base/dists/wald/pdf/docs/types/index.d.ts create mode 100644 lib/node_modules/@stdlib/stats/base/dists/wald/pdf/docs/types/test.ts diff --git a/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/docs/img/equation_wald_wald_pdf.svg b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/docs/img/equation_wald_wald_pdf.svg new file mode 100644 index 000000000000..2cab9c2080f7 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/docs/img/equation_wald_wald_pdf.svg @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/docs/repl.txt b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/docs/repl.txt new file mode 100644 index 000000000000..4f07c262ae7f --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/docs/repl.txt @@ -0,0 +1,87 @@ +{{alias}}( x, μ, λ ) + Evaluates the probability density function (PDF) for a Wald distribution + with mean `μ` and shape parameter `λ` at a value `x`. + + If provided `NaN` as any argument, the function returns `NaN`. + + If provided `μ <= 0` or `λ < 0`, the function returns `NaN`. + + Parameters + ---------- + x: number + Input value. + + μ: number + Mean parameter. + + λ: number + Shape parameter. + + Returns + ------- + out: number + Evaluated PDF. + + Examples + -------- + > var y = {{alias}}( 2.0, 1.0, 1.0 ) + ~0.110 + > y = {{alias}}( 5.0, 3.0, 2.0 ) + ~0.046 + > y = {{alias}}( NaN, 1.0, 1.0 ) + NaN + > y = {{alias}}( 2.0, NaN, 1.0 ) + NaN + > y = {{alias}}( 2.0, 1.0, NaN ) + NaN + + // Non-positive mean: + > y = {{alias}}( 2.0, 0.0, 1.0 ) + NaN + > y = {{alias}}( 2.0, -1.0, 1.0 ) + NaN + + // Negative shape parameter: + > y = {{alias}}( 2.0, 1.0, -1.0 ) + NaN + + // Degenerate distribution when `λ = 0.0`: + > y = {{alias}}( 2.0, 1.0, 0.0 ) + 0.0 + > y = {{alias}}( 1.0, 1.0, 0.0 ) + infinity + + // Outside support (x <= 0): + > y = {{alias}}( 0.0, 1.0, 1.0 ) + 0.0 + > y = {{alias}}( -1.0, 1.0, 1.0 ) + 0.0 + + +{{alias}}.factory( μ, λ ) + Returns a function for evaluating the probability density function (PDF) of + a Wald distribution with mean `μ` and shape parameter `λ`. + + Parameters + ---------- + μ: number + Mean parameter. + + λ: number + Shape parameter. + + Returns + ------- + pdf: Function + Probability density function (PDF). + + Examples + -------- + > var myPDF = {{alias}}.factory( 3.0, 2.0 ); + > var y = myPDF( 2.0 ) + ~0.189 + > y = myPDF( 5.0 ) + ~0.046 + + See Also + -------- diff --git a/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/docs/types/index.d.ts b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/docs/types/index.d.ts new file mode 100644 index 000000000000..ccb598f1c230 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/docs/types/index.d.ts @@ -0,0 +1,124 @@ +/* +* @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 + +/** +* Evaluates the probability density function (PDF) for a Wald distribution. +* +* @param x - input value +* @returns evaluated PDF +*/ +type Unary = ( x: number ) => number; + +/** +* Interface for the probability density function (PDF) of a Wald distribution. +*/ +interface PDF { + /** + * Evaluates the probability density function (PDF) for a Wald distribution with mean `mu` and shape parameter `lambda` at a value `x`. + * + * ## Notes + * + * - If provided `mu <= 0` or `lambda < 0`, the function returns `NaN`. + * + * @param x - input value + * @param mu - mean parameter + * @param lambda - shape parameter + * @returns evaluated probability density function + * + * @example + * var y = pdf( 2.0, 1.0, 1.0 ); + * // returns ~0.110 + * + * @example + * var y = pdf( 5.0, 3.0, 2.0 ); + * // returns ~0.046 + * + * @example + * var y = pdf( NaN, 1.0, 1.0 ); + * // returns NaN + * + * @example + * var y = pdf( 2.0, NaN, 1.0 ); + * // returns NaN + * + * @example + * var y = pdf( 2.0, 1.0, NaN ); + * // returns NaN + * + * @example + * // Non-positive mean: + * var y = pdf( 2.0, 0.0, 1.0 ); + * // returns NaN + * + * @example + * // Negative shape parameter: + * var y = pdf( 2.0, 1.0, -1.0 ); + * // returns NaN + * + * @example + * var y = pdf( 2.0, 1.0, 0.0 ); + * // returns 0.0 + * + * @example + * var y = pdf( 1.0, 1.0, 0.0 ); + * // returns Infinity + */ + ( x: number, mu: number, lambda: number ): number; + + /** + * Returns a function for evaluating the probability density function (PDF) for a Wald distribution. + * + * @param mu - mean parameter + * @param lambda - shape parameter + * @returns function to evaluate the probability density function + * + * @example + * var myPDF = pdf.factory( 3.0, 2.0 ); + * var y = myPDF( 2.0 ); + * // returns ~0.189 + * + * y = myPDF( 5.0 ); + * // returns ~0.046 + */ + factory( mu: number, lambda: number ): Unary; +} + +/** +* Wald distribution probability density function (PDF). +* +* @param x - input value +* @param mu - mean parameter +* @param lambda - shape parameter +* @returns evaluated PDF +* +* @example +* var y = pdf( 2.0, 1.0, 1.0 ); +* // returns ~0.110 +* +* var myPDF = pdf.factory( 3.0, 2.0 ); +* y = myPDF( 2.0 ); +* // returns ~0.189 +*/ +declare var pdf: PDF; + + +// EXPORTS // + +export = pdf; diff --git a/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/docs/types/test.ts b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/docs/types/test.ts new file mode 100644 index 000000000000..5dfca2743c4c --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/docs/types/test.ts @@ -0,0 +1,119 @@ +/* +* @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 pdf = require( './index' ); + + +// TESTS // + +// The function returns a number... +{ + pdf( 2, 2, 4 ); // $ExpectType number + pdf( 1, 2, 8 ); // $ExpectType number +} + +// The compiler throws an error if the function is provided values other than three numbers... +{ + pdf( true, 3, 6 ); // $ExpectError + pdf( false, 2, 4 ); // $ExpectError + pdf( '5', 1, 2 ); // $ExpectError + pdf( [], 1, 2 ); // $ExpectError + pdf( {}, 2, 4 ); // $ExpectError + pdf( ( x: number ): number => x, 2, 4 ); // $ExpectError + + pdf( 9, true, 12 ); // $ExpectError + pdf( 9, false, 12 ); // $ExpectError + pdf( 5, '5', 10 ); // $ExpectError + pdf( 8, [], 16 ); // $ExpectError + pdf( 9, {}, 18 ); // $ExpectError + pdf( 8, ( x: number ): number => x, 16 ); // $ExpectError + + pdf( 9, 5, true ); // $ExpectError + pdf( 9, 5, false ); // $ExpectError + pdf( 5, 2, '5' ); // $ExpectError + pdf( 8, 4, [] ); // $ExpectError + pdf( 9, 4, {} ); // $ExpectError + pdf( 8, 5, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + pdf(); // $ExpectError + pdf( 2 ); // $ExpectError + pdf( 2, 0 ); // $ExpectError + pdf( 2, 0, 4, 1 ); // $ExpectError +} + +// Attached to main export is a `factory` method which returns a function... +{ + pdf.factory( 3, 4 ); // $ExpectType Unary +} + +// The `factory` method returns a function which returns a number... +{ + const fcn = pdf.factory( 3, 4 ); + fcn( 2 ); // $ExpectType number +} + +// The compiler throws an error if the function returned by the `factory` method is provided invalid arguments... +{ + const fcn = pdf.factory( 3, 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 = pdf.factory( 3, 4 ); + fcn(); // $ExpectError + fcn( 2, 0 ); // $ExpectError + fcn( 2, 0, 1 ); // $ExpectError +} + +// The compiler throws an error if the `factory` method is provided values other than two numbers... +{ + pdf.factory( true, 3 ); // $ExpectError + pdf.factory( false, 2 ); // $ExpectError + pdf.factory( '5', 1 ); // $ExpectError + pdf.factory( [], 1 ); // $ExpectError + pdf.factory( {}, 2 ); // $ExpectError + pdf.factory( ( x: number ): number => x, 2 ); // $ExpectError + + pdf.factory( 9, true ); // $ExpectError + pdf.factory( 9, false ); // $ExpectError + pdf.factory( 5, '5' ); // $ExpectError + pdf.factory( 8, [] ); // $ExpectError + pdf.factory( 9, {} ); // $ExpectError + pdf.factory( 8, ( x: number ): number => x ); // $ExpectError + + pdf.factory( [], true ); // $ExpectError + pdf.factory( {}, false ); // $ExpectError + pdf.factory( false, '5' ); // $ExpectError + pdf.factory( {}, [] ); // $ExpectError + pdf.factory( '5', ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the `factory` method is provided an unsupported number of arguments... +{ + pdf.factory( 0 ); // $ExpectError + pdf.factory( 0, 4, 8 ); // $ExpectError +} From f5e202110172fc4e6d4f3b4ddac6046d1e50fbdd Mon Sep 17 00:00:00 2001 From: manit2004 Date: Thu, 25 Dec 2025 20:29:02 +0530 Subject: [PATCH 8/9] feat: add tests for Wald distribution PDF and fix infinity handling #209 --- .../stats/base/dists/wald/pdf/lib/factory.js | 3 + .../stats/base/dists/wald/pdf/lib/main.js | 3 + .../stats/base/dists/wald/pdf/src/main.c | 4 + .../wald/pdf/test/fixtures/r/DESCRIPTION | 10 + .../dists/wald/pdf/test/fixtures/r/data.json | 1 + .../dists/wald/pdf/test/fixtures/r/runner.R | 102 +++++++ .../base/dists/wald/pdf/test/test.factory.js | 271 ++++++++++++++++++ .../stats/base/dists/wald/pdf/test/test.js | 38 +++ .../base/dists/wald/pdf/test/test.native.js | 232 +++++++++++++++ .../base/dists/wald/pdf/test/test.pdf.js | 223 ++++++++++++++ 10 files changed, 887 insertions(+) create mode 100644 lib/node_modules/@stdlib/stats/base/dists/wald/pdf/test/fixtures/r/DESCRIPTION create mode 100644 lib/node_modules/@stdlib/stats/base/dists/wald/pdf/test/fixtures/r/data.json create mode 100644 lib/node_modules/@stdlib/stats/base/dists/wald/pdf/test/fixtures/r/runner.R create mode 100644 lib/node_modules/@stdlib/stats/base/dists/wald/pdf/test/test.factory.js create mode 100644 lib/node_modules/@stdlib/stats/base/dists/wald/pdf/test/test.js create mode 100644 lib/node_modules/@stdlib/stats/base/dists/wald/pdf/test/test.native.js create mode 100644 lib/node_modules/@stdlib/stats/base/dists/wald/pdf/test/test.pdf.js diff --git a/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/lib/factory.js b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/lib/factory.js index aab9b94a4818..cdb6c6bdb7bd 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/lib/factory.js +++ b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/lib/factory.js @@ -82,6 +82,9 @@ function factory( mu, lambda ) { if ( x <= 0.0 ) { return 0.0; } + if ( !isFinite( x ) ) { + return 0.0; + } return A / sqrt( pow( x, 3.0 ) ) * exp( B * pow( x - mu, 2.0 ) / x ); } } diff --git a/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/lib/main.js b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/lib/main.js index a82966145c6f..79d5046bfa7a 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/lib/main.js +++ b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/lib/main.js @@ -109,6 +109,9 @@ function pdf( x, mu, lambda ) { if ( x <= 0.0 ) { return 0.0; } + if ( !isFinite( x ) ) { + return 0.0; + } A = sqrt( lambda / TWO_PI ); B = -lambda / ( 2.0 * pow( mu, 2.0 ) ); return A / sqrt( pow( x, 3.0 ) ) * exp( B * pow( x - mu, 2.0 ) / x ); diff --git a/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/src/main.c b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/src/main.c index 13c8186b634e..b88ff2e9f749 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/src/main.c +++ b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/src/main.c @@ -23,6 +23,7 @@ #include "stdlib/math/base/special/exp.h" #include "stdlib/constants/float64/two_pi.h" #include "stdlib/constants/float64/pinf.h" +#include /** * Evaluates the probability density function (PDF) for a Wald distribution with mean `mu` and shape parameter `lambda` at a value `x`. @@ -54,6 +55,9 @@ double stdlib_base_dists_wald_pdf( const double x, const double mu, const double if ( x <= 0.0 ) { return 0.0; } + if ( isinf( x ) ) { + return 0.0; + } A = stdlib_base_sqrt( lambda / STDLIB_CONSTANT_FLOAT64_TWO_PI ); B = -lambda / ( 2.0 * stdlib_base_pow( mu, 2.0 ) ); return A / stdlib_base_sqrt( stdlib_base_pow( x, 3.0 ) ) * stdlib_base_exp( B * stdlib_base_pow( x - mu, 2.0 ) / x ); diff --git a/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/test/fixtures/r/DESCRIPTION b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/test/fixtures/r/DESCRIPTION new file mode 100644 index 000000000000..cdbe1510e561 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/test/fixtures/r/DESCRIPTION @@ -0,0 +1,10 @@ +Package: wald-pdf-test-fixtures +Title: Test Fixtures +Version: 0.0.0 +Authors@R: person("stdlib", "js", role = c("aut","cre")) +Description: Generates test fixtures. +Depends: R (>=3.4.0) +Imports: + jsonlite, + statmod +LazyData: true diff --git a/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/test/fixtures/r/data.json b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/test/fixtures/r/data.json new file mode 100644 index 000000000000..08b54d4dce74 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/test/fixtures/r/data.json @@ -0,0 +1 @@ +{"mu":[1.7351351351351354,3.7567567567567575,7.532432432432433,2.3891891891891897,7.2945945945945949,7.3441441441441446,5.6000000000000005,1.8837837837837841,5.4216216216216218,0.72432432432432436,0.90270270270270281,5.6990990990990991,8.6027027027027039,5.7189189189189191,5.4315315315315313,6.8684684684684685,2.8648648648648654,4.5,0.28828828828828834,3.7963963963963967,4.7972972972972974,3.3405405405405411,2.34954954954955,0.39729729729729735,4.5891891891891889,9.345945945945946,3.5585585585585591,3.8558558558558564,9.0288288288288303,6.4621621621621621,9.3954954954954957,8.6819819819819823,2.35945945945946,8.9792792792792806,4.4306306306306311,2.4189189189189193,6.1945945945945953,1.110810810810811,5.7684684684684688,1.2792792792792795,2.8054054054054056,2.8747747747747754,1.0810810810810811,1.1009009009009012,9.0090090090090094,8.3153153153153152,3.1324324324324331,3.1423423423423427,6.1054054054054054,1.22972972972973,7.2747747747747749,6.0063063063063069,9.890990990990991,3.4000000000000004,9.3063063063063076,9.8315315315315317,5.3819819819819825,5.4711711711711715,2.2306306306306309,6.6504504504504505,3.6675675675675681,0.21891891891891893,0.61531531531531536,7.5423423423423426,8.3648648648648649,8.622522522522523,6.2639639639639642,4.8468468468468471,5.3621621621621625,9.4153153153153166,2.458558558558559,4.2621621621621619,2.9243243243243247,5.1144144144144148,8.9396396396396405,2.1909909909909913,3.2315315315315321,3.4792792792792797,4.1333333333333337,7.9288288288288298,8.8108108108108123,9.9900900900900904,0.99189189189189197,7.1261261261261266,7.4828828828828833,6.7792792792792795,1.0414414414414417,7.0468468468468473,7.3540540540540542,2.5477477477477479,2.4882882882882886,6.4423423423423429,9.5441441441441448,1.1900900900900904,7.4927927927927929,1.9135135135135137,1.3684684684684687,7.0567567567567568,2.9837837837837844,9.1576576576576585,6.4819819819819822,9.7126126126126131,5.3225225225225223,6.5216216216216223,5.1045045045045043,5.2135135135135133,0.60540540540540544,6.6702702702702705,1.0612612612612613,8.4540540540540547,0.86306306306306313,6.6900900900900906,9.3756756756756765,8.186486486486487,9.9207207207207215,0.53603603603603611,2.448648648648649,7.1657657657657658,8.1171171171171181,0.1891891891891892,4.4801801801801799,2.0522522522522526,6.6207207207207208,3.657657657657658,1.5270270270270272,7.7801801801801806,8.3252252252252266,5.3126126126126128,0.10990990990990991,5.5504504504504508,7.3045045045045054,9.3558558558558573,1.8045045045045047,3.7864864864864871,5.3918918918918921,5.2432432432432439,4.4603603603603608,1.8144144144144148,7.6018018018018019,7.2153153153153156,4.718018018018018,5.9963963963963964,3.330630630630631,8.4441441441441452,5.154054054054054,5.9864864864864868,3.9351351351351358,2.4783783783783786,3.3504504504504511,4.9657657657657657,6.3531531531531531,8.2459459459459463,3.2018018018018024,2.884684684684685,9.3162162162162172,1.2099099099099102,2.1612612612612616,2.6963963963963966,8.4738738738738739,2.2603603603603606,4.2324324324324323,3.2909909909909913,9.127927927927928,5.2828828828828831,3.3900900900900908,2.3198198198198203,9.8612612612612622,7.4333333333333336,8.9000000000000004,9.5045045045045047,4.7576576576576581,0.51621621621621627,6.4522522522522525,4.7774774774774773,4.2522522522522523,8.3450450450450457,4.5792792792792794,0.6351351351351352,9.1477477477477489,9.672972972972973,9.563963963963964,9.6531531531531538,5.1243243243243244,0.11981981981981983,8.1270270270270277,7.6810810810810812,4.827027027027027,4.4504504504504503,6.1252252252252255,5.0549549549549555,0.37747747747747751,8.5234234234234236,6.5810810810810816,3.8063063063063067,2.0126126126126129,5.8378378378378377,1.9333333333333336,1.9234234234234238,3.43963963963964,7.225225225225226,0.77387387387387396,7.7207207207207214,8.077477477477478,7.2450450450450452,3.7369369369369374,6.5513513513513519,7.8495495495495504,5.1738738738738741,1.6459459459459462,5.9567567567567572,4.2918918918918916,9.9009009009009024,0.36756756756756759,6.5711711711711711,7.8000000000000007,8.0081081081081091,5.7288288288288287,3.6873873873873877,3.4594594594594601,7.3936936936936943,7.8792792792792801,8.5630630630630638,0.23873873873873877,1.9927927927927931,9.1180180180180184,3.4990990990990998,8.7216216216216225,9.4450450450450454,7.6216216216216219,6.6108108108108112,2.7261261261261267,0.19909909909909912,4.8171171171171174,8.7414414414414416,1.8243243243243246,9.9603603603603617,9.3360360360360364,9.1873873873873872,4.0342342342342343,4.7873873873873878,3.3801801801801807,8.8405405405405411,9.5342342342342352,9.7027027027027035,7.6117117117117123,7.2648648648648653,5.2927927927927927,3.538738738738739,7.5225225225225234,6.1351351351351351,1.2990990990990994,4.8567567567567567,4.7378378378378381,4.8369369369369375,0.65495495495495504,1.0315315315315317,3.8954954954954961,3.5882882882882887,0.15945945945945947,5.4414414414414418,0.22882882882882885,3.122522522522523,4.6189189189189195,4.5594594594594593,2.250450450450451,5.9072072072072075,1.2495495495495497,6.1747747747747752,3.8360360360360364,2.7459459459459463,2.6468468468468473,8.1765765765765774,1.7450450450450454,9.0486486486486495,3.8459459459459464,0.64504504504504512,8.3351351351351362,1.3783783783783785,6.0360360360360366,8.2063063063063062,4.0144144144144152,6.7198198198198202,3.1720720720720723,9.7621621621621628,7.1855855855855859,6.1450450450450456,2.2900900900900902,8.6621621621621632,4.3117117117117116,7.4036036036036039,3.7666666666666671,7.6612612612612621,1.3882882882882885,7.5720720720720722,8.2855855855855864,5.5207207207207212,7.5621621621621626,3.8162162162162168,8.6126126126126135,7.7108108108108109,1.3486486486486489,5.6099099099099101,7.6513513513513516,8.1567567567567565,5.4909909909909915,8.2360360360360367,1.6063063063063066,9.1378378378378393,3.7171171171171178,4.609009009009009,4.6684684684684683,8.7513513513513512,9.3657657657657669,1.4576576576576579,3.7072072072072078,1.4477477477477481,2.6567567567567569,1.0216216216216218,3.0729729729729733,3.9450450450450454,1.0513513513513515,3.3108108108108114,6.7594594594594595,4.6387387387387387,7.9981981981981987,3.3702702702702707,4.0045045045045047,2.7360360360360363,1.6756756756756759,1.7945945945945949,0.25855855855855858,1.8639639639639642,3.548648648648649,6.6405405405405409,0.66486486486486496,9.9405405405405407,7.7603603603603606,6.9180180180180182,4.301801801801802,5.0747747747747747,5.0153153153153154,8.6324324324324326,8.2261261261261271,8.8801801801801812,2.1414414414414416,4.3414414414414413,2.5081081081081087,5.2729729729729735,5.5702702702702709,4.8765765765765767,9.2567567567567579,2.5972972972972976,2.7558558558558564,8.8207207207207219,2.240540540540541,1.4279279279279282,6.2342342342342345,6.9774774774774775,4.2225225225225227,7.9189189189189193,5.5900900900900901,7.0369369369369377,1.6657657657657661,1.3090090090090092,0.80360360360360361,2.3693693693693696,1.5864864864864867,1.3585585585585589,3.1918918918918924,7.9882882882882891,9.4747747747747759,4.1036036036036041,6.2837837837837842,7.1360360360360362,1.7549549549549552,1.6954954954954957,0.32792792792792796,0.62522522522522528,6.9675675675675679,0.7936936936936938,0.13963963963963966,8.5333333333333332,7.423423423423424,5.8279279279279281,6.7693693693693699,9.0684684684684687,0.56576576576576587,0.75405405405405412,8.4342342342342356,4.3612612612612613,9.4252252252252262,4.7675675675675677,5.1441441441441444,3.102702702702703,4.5693693693693698,6.5315315315315319,2.0324324324324325,8.6423423423423422,6.4225225225225229,1.5963963963963967,6.8189189189189197,4.1828828828828826,6.3135135135135139,1.5072072072072074,0.42702702702702711,5.8576576576576578,1.6261261261261264,7.4531531531531536,4.6288288288288291,3.9549549549549554,3.2414414414414421,7.8099099099099103,2.904504504504505,2.8153153153153156,1.2891891891891893,4.172972972972973,9.8513513513513526,3.320720720720721,8.5531531531531542,7.4135135135135144,2.9639639639639643,5.8675675675675683,0.7441441441441442,0.46666666666666667,6.6603603603603609,0.31801801801801804,2.7657657657657659,4.8963963963963968,9.2765765765765771,2.0720720720720722,6.5117117117117118,4.4108108108108111,2.8351351351351357,0.69459459459459461,6.0261261261261261,4.281981981981982,8.3054054054054056,0.12972972972972974,2.8549549549549553,8.0675675675675684,8.4144144144144146,9.0783783783783782,0.47657657657657659,7.1756756756756763,5.2531531531531535,9.8810810810810814,5.7090090090090095,2.6171171171171177,5.1936936936936942,5.4117117117117122,1.3387387387387391,2.3990990990990992,3.5684684684684691,6.4027027027027028,5.3324324324324328,5.7486486486486488,4.3810810810810814,3.003603603603604,5.8972972972972979,0.59549549549549552,1.5171171171171174,8.6918918918918919,6.4720720720720726,2.1810810810810812,6.78918918918919,3.013513513513514,8.5036036036036045,6.7990990990990996,2.4090090090090093,8.4243243243243242,7.6909909909909917,9.5837837837837849,0.97207207207207214,0.44684684684684695,6.2045045045045049,0.29819819819819826,4.2720720720720724,7.8297297297297304,9.1774774774774777,7.85945945945946,1.1801801801801803,8.097297297297299,2.557657657657658,6.0954954954954959,3.221621621621622,1.4972972972972975,8.6720720720720728,4.9756756756756761,8.404504504504505,2.1117117117117119,1.0711711711711713,6.898198198198199,8.5432432432432446,1.7252252252252256,6.4324324324324325,7.5819819819819827,9.5738738738738753,2.9540540540540543,0.45675675675675675,2.4981981981981987,4.1234234234234233,2.0027027027027029,9.4054054054054053,2.686486486486487,6.6306306306306313,8.7315315315315321,7.1063063063063066,6.9477477477477478,4.1432432432432433,9.2171171171171178,7.8198198198198208,2.9441441441441447,4.0738738738738745,5.2333333333333334,5.9171171171171171,5.6891891891891895,6.8387387387387388,2.2009009009009013,3.0531531531531537,8.7711711711711722,9.0387387387387399,9.0981981981981992,4.5495495495495497,3.9747747747747755,7.443243243243244,9.0882882882882896,6.5414414414414415,3.0630630630630633,1.2594594594594597,9.7225225225225227,2.8450450450450453,2.1513513513513516,8.5729729729729733,1.4081081081081084,2.7162162162162167,7.7405405405405414,6.878378378378379,7.0270270270270272,6.5612612612612615,8.7612612612612626,5.5405405405405412,6.1153153153153159,0.27837837837837842,3.5981981981981987,3.1819819819819823,7.0171171171171176,0.55585585585585595,1.655855855855856,6.4918918918918926,7.4630630630630632,5.9666666666666668,4.192792792792793,2.2702702702702706,1.9828828828828833,3.112612612612613,3.211711711711712,2.3297297297297299,9.6135135135135137,6.5018018018018022,8.6522522522522536,3.4495495495495501,6.7297297297297298,7.5918918918918923,0.71441441441441444,7.1558558558558563,1.4180180180180182,6.0855855855855863,0.93243243243243246,5.8081081081081081,4.9261261261261264,2.3099099099099103,9.3855855855855861,3.0828828828828834,4.5990990990990994,5.4513513513513514,3.6774774774774781,8.0477477477477493,4.1135135135135137,4.0243243243243247,9.5936936936936945,1.4774774774774777,0.94234234234234238,1.6360360360360362,5.045045045045045,4.4702702702702704,7.9783783783783786,9.781981981981982,9.5243243243243256,3.3009009009009014,6.3036036036036043,6.3432432432432435,3.0432432432432437,1.2396396396396399,3.7468468468468474,0.68468468468468469,1.1405405405405407,7.7702702702702711,6.0657657657657662,0.67477477477477477,3.1522522522522527,4.7477477477477477,7.0765765765765769,5.2036036036036037,5.9270270270270276,6.987387387387388,9.9504504504504521,4.4207207207207206,7.1459459459459467,3.9252252252252258,8.4936936936936949,4.7279279279279285,2.2108108108108113,8.3747747747747745,1.1306306306306309,5.7882882882882889,0.43693693693693703,3.8261261261261268,7.7900900900900902,7.096396396396397,3.9846846846846851,1.4873873873873877,0.88288288288288297,9.6432432432432442,6.0162162162162165,2.5378378378378383,5.0252252252252259,5.7585585585585592,6.680180180180181,5.0846846846846852,4.4900900900900904,4.9954954954954953,3.2612612612612617,4.5099099099099105,6.3630630630630636,3.7765765765765771,7.948648648648649,7.2351351351351356,3.8855855855855861,4.5198198198198201,2.785585585585586,4.083783783783784,1.9432432432432436,8.7909909909909913,7.3738738738738743,9.8117117117117125,5.6495495495495502,4.6486486486486491,8.0180180180180187,6.9081081081081086,7.205405405405406,0.76396396396396404,1.7846846846846849,4.3711711711711709,4.390990990990991,2.0918918918918923,2.5873873873873876,0.33783783783783783,0.73423423423423428,0.30810810810810813,1.0909909909909912,3.4099099099099104,8.8306306306306315,4.8666666666666671,3.9648648648648654,5.6693693693693694,1.9630630630630634,0.40720720720720727,0.38738738738738743,5.0351351351351354,8.9495495495495501,8.9198198198198213,3.5288288288288294,3.0927927927927934,1.5666666666666669,3.0333333333333337,9.9702702702702712,5.0945945945945947,5.4612612612612619,2.2801801801801806,1.9531531531531534,1.001801801801802,1.1603603603603605,9.7324324324324341,0.10000000000000001,8.2558558558558559,7.8990990990990992,7.4729729729729737,8.8504504504504506,3.6378378378378384,9.9801801801801808,0.16936936936936939,3.6972972972972977,6.2144144144144144,7.6711711711711716,1.7747747747747751,2.0225225225225225,6.2936936936936938,1.5567567567567571,6.0558558558558566,8.1468468468468469,6.8486486486486493,2.0621621621621622,2.894594594594595,9.0189189189189189,8.7117117117117129,3.4198198198198204,0.70450450450450453,8.0279279279279283,8.1963963963963966,3.0234234234234236,0.35765765765765767,6.7000000000000002,6.4126126126126133,8.7018018018018033,5.4018018018018017,9.6234234234234233,2.3792792792792796,4.936036036036036,5.8873873873873874,9.6333333333333346,2.5279279279279283,0.54594594594594603,5.1837837837837837,0.89279279279279289,8.9594594594594597,6.0756756756756758,7.9585585585585594,0.85315315315315321,7.8891891891891897,0.2684684684684685,9.6630630630630634,6.1549549549549551,5.1639639639639645,0.91261261261261273,3.5189189189189194,7.0666666666666673,8.4639639639639643,5.4810810810810811,9.7918918918918934,5.8477477477477482,8.8702702702702716,4.5396396396396401,8.9297297297297309,4.9558558558558561,3.3603603603603607,6.3828828828828836,7.5027027027027033,2.1018018018018023,4.3216216216216221,4.5297297297297296,7.8693693693693696,7.968468468468469,4.3315315315315317,5.3423423423423424,3.6279279279279284,1.3189189189189192,2.795495495495496,9.8018018018018029,3.9945945945945951,5.3027027027027032,0.87297297297297305,9.4648648648648663,7.1954954954954964,6.8585585585585589,0.57567567567567568,1.8540540540540544,5.5108108108108107,4.6783783783783788,0.81351351351351353,0.34774774774774775,0.20900900900900904,9.8711711711711718,0.50630630630630635,5.9369369369369371,3.42972972972973,4.063963963963964,1.1702702702702705,9.6927927927927939,1.9729729729729732,6.3927927927927932,8.3945945945945954,9.1081081081081088,0.5855855855855856,4.0936936936936936,8.0378378378378397,0.24864864864864866,0.83333333333333337,7.0864864864864865,7.334234234234235,5.7387387387387392,4.0441441441441448,7.641441441441442,1.7153153153153156,2.1711711711711716,5.7783783783783784,1.4675675675675679,5.2234234234234238,9.4945945945945951,4.9162162162162168,4.698198198198198,7.9387387387387394,6.9378378378378383,2.5180180180180183,6.7099099099099107,3.8756756756756761,2.7063063063063066,5.0054054054054058,3.4693693693693697,7.5126126126126129,9.2963963963963963,5.7981981981981985,5.5801801801801805,9.3261261261261268,8.2756756756756769,8.5828828828828829,0.41711711711711719,1.7054054054054057,9.1972972972972986,1.8738738738738743,2.3000000000000003,0.96216216216216222,9.5144144144144143,1.9036036036036039,3.9054054054054057,4.807207207207207,8.9990990990990998,4.6882882882882884,4.4405405405405407,5.5306306306306308,9.8414414414414431,2.2207207207207209,3.2513513513513517,2.3396396396396399,1.0117117117117118,4.8864864864864863,9.5540540540540544,2.6369369369369373,6.2738738738738746,5.372072072072072,7.2549549549549557,9.4846846846846855,0.82342342342342345,6.7396396396396403,1.764864864864865,1.328828828828829,2.666666666666667,1.6162162162162166,2.0819819819819823,2.4387387387387389,7.5522522522522531,1.8441441441441444,2.993693693693694,7.6315315315315324,5.9765765765765773,5.6594594594594598,0.84324324324324329,4.2126126126126131,0.17927927927927928,5.1342342342342349,7.007207207207208,4.2027027027027026,6.8882882882882885,5.263063063063063,8.0576576576576588,9.9108108108108119,8.1072072072072086,9.6828828828828843,6.9279279279279287,0.78378378378378388,9.9306306306306311,6.2441441441441441,8.1666666666666679,1.1504504504504507,0.49639639639639643,1.21981981981982,3.2711711711711717,3.4891891891891897,2.9144144144144146,4.3513513513513518,5.6297297297297302,5.0648648648648651,6.2243243243243249,1.5369369369369372,2.131531531531532,8.1369369369369373,4.4009009009009015,1.8936936936936939,2.6072072072072077,5.9468468468468467,3.7270270270270274,10,7.2846846846846853,4.1630630630630634,9.7720720720720724,0.98198198198198205,2.0423423423423426,8.7810810810810818,3.6180180180180184,9.1675675675675681,7.3639639639639647,6.3729729729729732,2.676576576576577,0.9522522522522523,8.5927927927927943,9.236936936936937,1.2693693693693695,6.0459459459459461,6.3234234234234235,8.8603603603603602,1.5765765765765769,2.8252252252252257,1.8342342342342346,1.3981981981981983,0.48648648648648651,9.454954954954955,7.8396396396396399,9.2666666666666675,7.3837837837837839,3.9153153153153157,6.1846846846846848,4.9855855855855857,4.9459459459459465,9.7423423423423436,8.9693693693693692,5.6396396396396398,6.1648648648648656,8.3846846846846859,6.5909909909909912,7.7009009009009013,9.2864864864864867,9.2072072072072082,5.8774774774774778,3.1621621621621627,8.8900900900900908,5.3522522522522529,1.437837837837838,7.116216216216217,6.9576576576576583,2.567567567567568,8.8009009009009009,6.8288288288288292,4.1531531531531529,4.6585585585585587,7.7306306306306309,3.8657657657657665,1.546846846846847,2.577477477477478,9.7522522522522532,2.9342342342342347,9.4351351351351358,1.2000000000000002,0.14954954954954958,4.7081081081081084,3.5783783783783787,1.1207207207207208,8.295495495495496,9.2270270270270274,4.0540540540540544,8.3549549549549553,3.5090090090090094,5.5009009009009011,8.0873873873873876,7.9090090090090097,7.750450450450451,8.9099099099099099,5.6792792792792799,8.513513513513514,1.6855855855855859,2.6270270270270273,5.5603603603603604,4.2423423423423428,6.3333333333333339,2.1216216216216219,3.6477477477477485,6.6009009009009016,0.52612612612612619,5.8180180180180185,8.4837837837837835,2.775675675675676,2.468468468468469,2.9738738738738744,6.7495495495495499,3.2810810810810813,0.92252252252252265,8.2657657657657655,5.6198198198198197,9.0585585585585591,6.9972972972972975,2.4288288288288293,4.9063063063063064,7.314414414414415,7.3243243243243246,8.9891891891891902,8.2162162162162176,9.6036036036036041,9.2468468468468483,6.8090090090090092,9.8216216216216221,6.2540540540540546,3.6081081081081088],"lambda":[35.700000000000003,68.099999999999994,81.400000000000006,75.599999999999994,80.200000000000003,33.100000000000001,29.000000000000004,47.900000000000006,61.100000000000001,66.599999999999994,40.800000000000004,40.100000000000001,72.700000000000003,99.400000000000006,25.500000000000004,26.200000000000003,68.5,81.200000000000003,73,39.600000000000001,40.200000000000003,18.000000000000004,53.500000000000007,56.400000000000006,81.900000000000006,41.400000000000006,49.700000000000003,20.300000000000004,24.400000000000002,79.099999999999994,44.100000000000001,84.099999999999994,6,56.300000000000004,27.200000000000003,14.800000000000001,74.599999999999994,97,96.200000000000003,24.800000000000004,64.799999999999997,61.400000000000006,97.599999999999994,49.800000000000004,99.099999999999994,66.299999999999997,87.700000000000003,84.599999999999994,42.800000000000004,47.400000000000006,52.900000000000006,48.100000000000001,29.200000000000003,57.900000000000006,43.900000000000006,68.899999999999991,45.300000000000004,90.099999999999994,48.600000000000001,47.300000000000004,70.799999999999997,80.400000000000006,41.500000000000007,36.5,49.300000000000004,26.700000000000003,97.299999999999997,60.100000000000001,83.200000000000003,49.200000000000003,5.5,79.599999999999994,83.599999999999994,46.000000000000007,51.800000000000004,88.900000000000006,96.700000000000003,91.299999999999997,76.900000000000006,41.900000000000006,12.800000000000001,37.900000000000006,57.400000000000006,71.599999999999994,30.700000000000003,57.600000000000001,81.299999999999997,30.100000000000001,95.5,38.600000000000001,45.200000000000003,79,48.200000000000003,54.400000000000006,64.5,25.900000000000002,6.5,49.500000000000007,96,24.500000000000004,92.200000000000003,53.900000000000006,33.200000000000003,85.799999999999997,93.200000000000003,18.800000000000001,67.899999999999991,18.100000000000001,98.799999999999997,81,35.200000000000003,28.600000000000001,4,72.5,0.5,35.900000000000006,37,86.599999999999994,30.800000000000004,11.800000000000001,63.100000000000001,36.200000000000003,1.9000000000000001,45.000000000000007,28.100000000000001,7.2000000000000002,42.100000000000001,55.600000000000001,87.400000000000006,57.200000000000003,42.700000000000003,62.200000000000003,16.300000000000001,47.800000000000004,65.399999999999991,37.300000000000004,41.300000000000004,12.6,68.200000000000003,18.700000000000003,72,80.700000000000003,40.900000000000006,53.800000000000004,7.9000000000000004,22.500000000000004,35,10.800000000000001,80,75.700000000000003,43.400000000000006,46.300000000000004,10.1,75.899999999999991,65.700000000000003,11.200000000000001,81.5,42.200000000000003,43.700000000000003,93.799999999999997,13,15.6,41.600000000000001,34.200000000000003,91.5,86.900000000000006,15.700000000000001,93.299999999999997,54.100000000000001,67.799999999999997,6.4000000000000004,51.500000000000007,71.200000000000003,26.900000000000002,17.000000000000004,20.600000000000001,64.899999999999991,27.900000000000002,77.799999999999997,100,4.5999999999999996,1.6000000000000001,40.600000000000001,41.100000000000001,71.799999999999997,60.500000000000007,18.500000000000004,47.100000000000001,36.600000000000001,2.4000000000000004,31.000000000000004,51.900000000000006,33.300000000000004,10.300000000000001,83.700000000000003,90.299999999999997,73.599999999999994,92.400000000000006,65.599999999999994,94.599999999999994,2.7000000000000002,0.30000000000000004,25.700000000000003,55.300000000000004,70,12.1,38.800000000000004,43.800000000000004,11.5,18.400000000000002,30.900000000000002,51.700000000000003,92.099999999999994,9.4000000000000004,14.200000000000001,6.5999999999999996,3.8000000000000003,19.200000000000003,9.0999999999999996,24.000000000000004,62.600000000000001,57.100000000000001,11.6,40.300000000000004,29.600000000000001,53.300000000000004,13.5,22.400000000000002,60.900000000000006,83.5,23.700000000000003,89.900000000000006,73.5,36,89.599999999999994,2,0.90000000000000002,28.300000000000004,65.099999999999994,63.800000000000004,61.000000000000007,73.399999999999991,25.400000000000002,78.099999999999994,62.100000000000001,59.700000000000003,1.2000000000000002,35.400000000000006,21.500000000000004,15,78.200000000000003,61.900000000000006,58.100000000000001,59.900000000000006,69.200000000000003,2.2000000000000002,47.700000000000003,34.5,73.700000000000003,44.000000000000007,10.6,79.700000000000003,39.700000000000003,1,50.100000000000001,57.700000000000003,9.7000000000000011,87.5,85.299999999999997,31.200000000000003,95.299999999999997,34.800000000000004,23.900000000000002,8.5,25.600000000000001,94.900000000000006,19.500000000000004,17.100000000000001,56.200000000000003,20.800000000000004,75,93.599999999999994,54.000000000000007,73.299999999999997,74,70.299999999999997,1.4000000000000001,9.5999999999999996,1.8000000000000003,72.399999999999991,92.700000000000003,11.300000000000001,20.000000000000004,54.500000000000007,5.2999999999999998,89,54.300000000000004,99.700000000000003,8.9000000000000004,3.9000000000000004,21.000000000000004,75.099999999999994,45.500000000000007,59.400000000000006,95.400000000000006,65,4.7999999999999998,96.5,25.200000000000003,94.099999999999994,95.099999999999994,43.600000000000001,38.100000000000001,55.100000000000001,85,97.400000000000006,21.100000000000001,2.5000000000000004,17.600000000000001,50.900000000000006,62.300000000000004,29.100000000000001,88.299999999999997,60.600000000000001,82.5,72.099999999999994,21.300000000000004,15.200000000000001,12.300000000000001,62.900000000000006,60.800000000000004,46.900000000000006,66.899999999999991,44.300000000000004,8.5999999999999996,39.000000000000007,39.900000000000006,32.100000000000001,42.900000000000006,30.200000000000003,99,10.5,89.400000000000006,55.500000000000007,33.900000000000006,65.899999999999991,42.600000000000001,16.500000000000004,71.5,88,88.700000000000003,64.099999999999994,24.900000000000002,82.099999999999994,95,8.3000000000000007,63.500000000000007,44.600000000000001,26.800000000000004,86,84.799999999999997,12.5,96.099999999999994,27.500000000000004,87.200000000000003,37.100000000000001,47.600000000000001,23.100000000000001,77.599999999999994,89.099999999999994,81.599999999999994,89.5,35.100000000000001,13.800000000000001,51.100000000000001,14.4,51.400000000000006,45.100000000000001,49.100000000000001,78,61.500000000000007,57.300000000000004,28.800000000000004,82.599999999999994,45.600000000000001,4.3999999999999995,85.900000000000006,13.4,57.000000000000007,42.300000000000004,21.900000000000002,64.399999999999991,22.800000000000004,19.400000000000002,55.400000000000006,2.9000000000000004,74.299999999999997,44.800000000000004,39.100000000000001,25.100000000000001,43.300000000000004,37.700000000000003,0.20000000000000001,97.799999999999997,7.7999999999999998,31.600000000000001,7.4000000000000004,98.099999999999994,5.0999999999999996,43.200000000000003,2.8000000000000003,3.0000000000000004,65.299999999999997,31.100000000000001,27.800000000000004,90.900000000000006,84.200000000000003,59.100000000000001,86.200000000000003,89.700000000000003,77.299999999999997,5,20.400000000000002,38.300000000000004,91.700000000000003,30.400000000000002,77.200000000000003,85.200000000000003,85.400000000000006,36.400000000000006,76.599999999999994,31.500000000000004,7.2999999999999998,74.700000000000003,81.700000000000003,29.900000000000002,40.000000000000007,4.7000000000000002,7.5999999999999996,97.900000000000006,79.900000000000006,58.900000000000006,83,38,28.700000000000003,61.800000000000004,87.799999999999997,95.200000000000003,60.300000000000004,77,12.4,38.400000000000006,58.800000000000004,52.200000000000003,53.700000000000003,69.700000000000003,23.500000000000004,5.7999999999999998,71.299999999999997,4.2000000000000002,68,7,61.600000000000001,53.600000000000001,3.7000000000000002,90.599999999999994,95.700000000000003,24.300000000000004,68.299999999999997,69.299999999999997,54.200000000000003,13.1,99.5,51.300000000000004,32.800000000000004,3.2000000000000002,52.600000000000001,22.200000000000003,98.200000000000003,63.000000000000007,79.400000000000006,52.800000000000004,26.600000000000001,94.400000000000006,5.4000000000000004,21.700000000000003,78.700000000000003,88.5,9.8000000000000007,94.299999999999997,43.100000000000001,74.5,77.099999999999994,98.400000000000006,23.000000000000004,27.300000000000004,78.900000000000006,14.700000000000001,45.700000000000003,45.800000000000004,61.200000000000003,17.500000000000004,8.8000000000000007,48.000000000000007,73.799999999999997,50.200000000000003,79.200000000000003,63.900000000000006,99.299999999999997,12,98.5,18.300000000000001,31.400000000000002,9.9000000000000004,42.000000000000007,78.5,71.399999999999991,55.900000000000006,35.600000000000001,14.9,99.900000000000006,80.799999999999997,78.299999999999997,32.300000000000004,85.599999999999994,5.5999999999999996,39.200000000000003,11.4,32.5,56.500000000000007,28.400000000000002,22.100000000000001,46.600000000000001,47.200000000000003,86.5,9,26.300000000000004,20.100000000000001,25.300000000000004,62.400000000000006,38.900000000000006,82,56.800000000000004,35.5,66.5,87.900000000000006,84,82.400000000000006,90,16.400000000000002,29.500000000000004,30.000000000000004,7.0999999999999996,77.400000000000006,19.000000000000004,20.700000000000003,41.800000000000004,99.799999999999997,64.599999999999994,31.700000000000003,98.900000000000006,48.700000000000003,1.1000000000000001,8.0999999999999996,51.000000000000007,89.799999999999997,11.700000000000001,52.300000000000004,83.099999999999994,50.500000000000007,28.200000000000003,34.600000000000001,53.100000000000001,36.300000000000004,0.80000000000000004,65.799999999999997,85.099999999999994,21.400000000000002,58.600000000000001,61.700000000000003,39.500000000000007,62.000000000000007,70.5,6.7999999999999998,23.300000000000004,6.7000000000000002,32.200000000000003,32.900000000000006,14.300000000000001,1.7000000000000002,59.800000000000004,79.5,59.600000000000001,52.700000000000003,49.400000000000006,54.900000000000006,75.799999999999997,28.000000000000004,86.099999999999994,82.200000000000003,23.600000000000001,54.800000000000004,67.099999999999994,95.900000000000006,41.200000000000003,56.700000000000003,57.500000000000007,69.399999999999991,89.299999999999997,72.299999999999997,60.200000000000003,74.899999999999991,92.799999999999997,27.600000000000001,17.700000000000003,42.500000000000007,46.700000000000003,94.5,12.9,91.400000000000006,80.5,93.700000000000003,56.600000000000001,50.000000000000007,67.399999999999991,38.500000000000007,74.099999999999994,64.200000000000003,76.200000000000003,46.500000000000007,86.700000000000003,5.9000000000000004,41.000000000000007,17.400000000000002,50.400000000000006,72.899999999999991,92.299999999999997,19.900000000000002,64,84.299999999999997,49.600000000000001,62.800000000000004,32.700000000000003,68.399999999999991,3.4000000000000004,48.300000000000004,81.799999999999997,36.800000000000004,24.700000000000003,52.500000000000007,10.700000000000001,1.5000000000000002,22.900000000000002,94.200000000000003,19.100000000000001,27.400000000000002,94,29.300000000000004,95.599999999999994,60.400000000000006,19.800000000000004,31.800000000000004,37.5,74.799999999999997,91.200000000000003,7.5,58.200000000000003,40.700000000000003,45.900000000000006,28.900000000000002,36.700000000000003,18.900000000000002,97.700000000000003,82.799999999999997,8,39.400000000000006,44.200000000000003,37.600000000000001,88.200000000000003,29.700000000000003,43.000000000000007,46.400000000000006,73.899999999999991,56.900000000000006,75.200000000000003,6.0999999999999996,42.400000000000006,93.099999999999994,70.200000000000003,65.200000000000003,51.200000000000003,52.400000000000006,6.2000000000000002,63.300000000000004,62.700000000000003,13.700000000000001,88.099999999999994,89.200000000000003,98.700000000000003,17.300000000000001,60.000000000000007,34.700000000000003,52.000000000000007,70.899999999999991,76,0.10000000000000001,3.5000000000000004,72.599999999999994,75.399999999999991,59.500000000000007,49.900000000000006,2.1000000000000001,84.900000000000006,36.900000000000006,76.5,15.800000000000001,49.000000000000007,20.500000000000004,83.400000000000006,23.400000000000002,21.200000000000003,58.500000000000007,69.799999999999997,50.700000000000003,76.799999999999997,82.900000000000006,60.700000000000003,88.599999999999994,16,73.099999999999994,67.599999999999994,13.6,65.5,22.300000000000004,59.300000000000004,54.700000000000003,14.1,33.5,76.700000000000003,27.000000000000004,36.100000000000001,38.200000000000003,33.400000000000006,48.400000000000006,92.900000000000006,90.400000000000006,15.5,76.399999999999991,56.000000000000007,87.099999999999994,46.200000000000003,0.40000000000000002,26.500000000000004,64.700000000000003,59.000000000000007,11.1,69.899999999999991,10,2.6000000000000001,53.200000000000003,66.399999999999991,69.099999999999994,10.4,35.300000000000004,58.400000000000006,98,7.7000000000000002,55.000000000000007,66.099999999999994,90.200000000000003,63.700000000000003,24.100000000000001,14.5,13.200000000000001,52.100000000000001,71,85.700000000000003,0.70000000000000007,50.800000000000004,93.400000000000006,32,5.7000000000000002,78.400000000000006,62.500000000000007,70.599999999999994,97.5,34.900000000000006,9.3000000000000007,16.200000000000003,30.500000000000004,58.300000000000004,39.300000000000004,4.2999999999999998,91.799999999999997,45.400000000000006,46.800000000000004,69.5,67,70.399999999999991,6.9000000000000004,63.200000000000003,8.1999999999999993,67.5,96.799999999999997,20.900000000000002,18.200000000000003,37.400000000000006,14,97.200000000000003,84.700000000000003,67.299999999999997,21.600000000000001,30.300000000000004,54.600000000000001,17.900000000000002,75.299999999999997,40.400000000000006,16.800000000000001,92.599999999999994,58.700000000000003,78.799999999999997,21.800000000000004,6.2999999999999998,31.900000000000002,40.500000000000007,96.400000000000006,82.299999999999997,77.700000000000003,25.800000000000004,94.799999999999997,88.400000000000006,90.700000000000003,55.800000000000004,77.5,16.900000000000002,94.700000000000003,17.200000000000003,0.59999999999999998,29.800000000000004,8.4000000000000004,86.799999999999997,87.599999999999994,88.799999999999997,99.200000000000003,44.900000000000006,80.599999999999994,16.100000000000001,9.1999999999999993,13.300000000000001,12.200000000000001,26.000000000000004,82.700000000000003,24.600000000000001,4.9000000000000004,19.300000000000004,67.700000000000003,31.300000000000004,48.800000000000004,19.700000000000003,18.600000000000001,84.5,79.299999999999997,64.299999999999997,27.100000000000001,29.400000000000002,15.1,12.700000000000001,92.5,4.0999999999999996,74.200000000000003,72.799999999999997,83.799999999999997,91.099999999999994,33.800000000000004,55.200000000000003,93,85.5,9.5,3.6000000000000001,13.9,41.700000000000003,76.099999999999994,71.899999999999991,99.599999999999994,91,66,68.799999999999997,98.299999999999997,66.799999999999997,8.6999999999999993,71.700000000000003,58.000000000000007,90.799999999999997,97.099999999999994,84.400000000000006,77.900000000000006,34.100000000000001,11.9,43.500000000000007,34,35.800000000000004,96.299999999999997,47.500000000000007,20.200000000000003,15.300000000000001,37.800000000000004,96.599999999999994,28.500000000000004,47.000000000000007,11,34.400000000000006,87,80.299999999999997,69.599999999999994,86.400000000000006,81.099999999999994,1.3000000000000003,98.599999999999994,26.100000000000001,44.500000000000007,50.600000000000001,83.299999999999997,51.600000000000001,61.300000000000004,91.900000000000006,38.700000000000003,44.400000000000006,56.100000000000001,34.300000000000004,33.600000000000001,79.799999999999997,74.399999999999991,22.600000000000001,70.099999999999994,14.6,22.700000000000003,48.900000000000006,44.700000000000003,37.200000000000003,55.700000000000003,15.9,93.900000000000006,57.800000000000004,96.900000000000006,66.700000000000003,63.400000000000006,53.400000000000006,10.200000000000001,39.800000000000004,95.799999999999997,68.599999999999994,66.200000000000003,93.5,50.300000000000004,91.599999999999994,53.000000000000007,32.400000000000006,5.2000000000000002,3.3000000000000003,71.099999999999994,32.600000000000001,70.700000000000003,80.900000000000006,2.3000000000000003,33.700000000000003,72.200000000000003,25.000000000000004,17.800000000000001,59.200000000000003,75.5,80.099999999999994,19.600000000000001,15.4,10.9,33,86.299999999999997,23.800000000000004,24.200000000000003,16.600000000000001,67.200000000000003,73.200000000000003,87.299999999999997,76.299999999999997,23.200000000000003,63.600000000000001,78.599999999999994,92,90.5,30.600000000000001,22.000000000000004,27.700000000000003,68.700000000000003,26.400000000000002,83.900000000000006,4.5,48.500000000000007,16.700000000000003,46.100000000000001,69,3.1000000000000001],"x":[32.038828828828827,97.697927927927921,48.053243243243237,21.629459459459458,74.376936936936929,8.0172072072072069,72.975675675675674,23.53117117117117,97.798018018018013,33.239909909909905,4.0136036036036034,8.4175675675675663,89.290360360360353,14.222792792792792,89.990990990990994,45.651081081081074,35.441891891891885,100,16.925225225225226,71.274144144144145,97.998198198198196,79.081171171171164,70.873783783783779,8.617747747747746,82.08387387387387,94.795315315315307,35.942342342342336,57.661891891891884,85.086576576576576,68.571711711711714,20.028018018018017,46.051441441441433,38.444594594594591,0.71063063063063059,71.073963963963962,22.129909909909909,44.750270270270263,31.838648648648647,2.0118018018018016,86.387747747747738,10.619549549549548,12.321081081081079,65.268738738738733,24.331891891891892,86.087477477477478,98.899009009009006,64.367927927927923,74.577117117117112,22.730450450450451,98.999099099099098,87.889099099099099,78.880990990990995,7.4166666666666661,8.3174774774774765,96.396756756756758,40.446396396396388,17.425675675675677,8.7178378378378376,50.655585585585577,80.382342342342341,24.732252252252252,76.779099099099099,79.981981981981974,31.238108108108108,15.523963963963963,0.91081081081081072,15.223693693693692,16.224594594594596,72.174954954954956,1.8116216216216214,11.82063063063063,80.482432432432432,14.122702702702702,50.155135135135126,56.761081081081073,38.144324324324316,23.831441441441441,68.371531531531531,67.47072072072072,82.183963963963961,12.62135135135135,46.551891891891884,95.095585585585582,50.055045045045041,43.949549549549545,62.46621621621621,71.774594594594589,69.772792792792785,95.596036036036026,29.536576576576575,83.785405405405399,54.559099099099093,30.237207207207206,5.6150450450450444,72.775495495495491,52.357117117117113,71.874684684684681,65.569009009009008,77.880090090090093,13.221891891891891,43.549189189189185,0.51045045045045045,61.064954954954949,99.39945945945945,88.189369369369373,69.572612612612616,98.398558558558548,58.262432432432426,40.946846846846839,97.297567567567569,34.040630630630623,61.165045045045041,26.333693693693693,17.525765765765765,61.965765765765759,79.681711711711714,34.741261261261258,6.2155855855855844,34.841351351351349,59.963963963963955,39.845855855855852,85.58702702702702,6.5158558558558548,53.858468468468459,94.595135135135138,54.759279279279269,12.421171171171169,74.47702702702702,89.690720720720719,74.877387387387387,95.495945945945948,18.126306306306308,2.3120720720720715,55.359819819819812,49.254324324324315,25.232702702702703,14.623153153153151,47.75297297297297,59.463513513513504,82.484234234234236,62.366126126126119,86.988288288288288,9.7187387387387378,87.98918918918919,93.894504504504496,71.374234234234237,15.023513513513512,43.148828828828826,22.63036036036036,21.829639639639637,42.748468468468459,34.641171171171166,65.068558558558564,65.969369369369375,58.162342342342335,76.278648648648641,47.853063063063054,24.63216216216216,41.547387387387381,4.7142342342342332,3.7133333333333329,97.497747747747738,25.532972972972971,77.379639639639635,38.945045045045042,56.861171171171165,47.052342342342335,38.344504504504499,66.469819819819818,16.124504504504504,46.651981981981976,87.789009009009007,19.427477477477478,37.94414414414414,42.848558558558551,63.367027027027021,22.43018018018018,63.166846846846838,37.844054054054048,23.631261261261262,64.468018018018014,33.740360360360356,37.54378378378378,30.137117117117114,34.140720720720715,1.7115315315315314,50.755675675675668,29.836846846846846,20.928828828828827,27.534774774774775,82.284054054054053,75.377837837837831,14.823333333333332,91.992792792792784,25.332792792792791,96.897207207207202,55.459909909909904,47.152432432432427,9.2182882882882868,22.23,45.250720720720714,73.275945945945949,63.467117117117112,3.9135135135135131,64.267837837837831,35.041531531531525,62.966666666666661,45.851261261261257,37.643873873873865,7.1163963963963957,28.735855855855856,62.766486486486478,47.953153153153146,73.976576576576576,35.541981981981976,9.9189189189189175,42.147927927927924,1.0109009009009009,67.270540540540537,18.026216216216216,21.12900900900901,19.627657657657657,68.671801801801806,85.286756756756759,30.937837837837836,46.151531531531525,67.670900900900904,15.624054054054053,28.835945945945944,80.282252252252249,92.092882882882876,16.725045045045047,89.390450450450444,86.287657657657661,90.691621621621621,91.592432432432432,31.538378378378376,12.92162162162162,4.3138738738738729,24.532072072072072,63.76738738738738,48.65378378378378,86.48783783783783,59.163243243243237,70.673603603603596,56.260630630630622,95.696126126126117,83.084774774774772,81.983783783783778,13.522162162162161,29.236306306306304,43.849459459459453,49.054144144144139,39.24531531531531,20.528468468468468,12.521261261261261,34.240810810810807,39.745765765765761,96.49684684684685,8.9180180180180173,69.072162162162158,99.699729729729725,67.370630630630629,81.583423423423426,83.184864864864863,64.868378378378381,97.898108108108104,54.058648648648642,39.645675675675669,83.885495495495491,78.780900900900903,96.697027027027019,60.964864864864857,71.574414414414406,15.724144144144143,74.076666666666668,1.110990990990991,12.82153153153153,0.41036036036036033,85.787207207207203,10.419369369369369,47.452702702702695,91.292162162162157,93.093783783783778,35.74216216216216,90.491441441441438,96.196576576576575,65.6690990990991,92.893603603603594,51.456306306306303,45.350810810810806,4.213783783783783,37.243513513513506,21.52936936936937,69.672702702702708,10.019009009009007,66.770090090090093,26.233603603603601,88.289459459459451,12.02081081081081,14.422972972972971,59.863873873873864,61.465315315315308,91.192072072072065,93.594234234234236,2.912612612612612,68.972072072072066,10.319279279279279,60.66459459459459,70.273243243243243,13.82243243243243,79.881891891891883,84.786306306306301,80.582522522522524,18.927027027027027,75.678108108108106,45.450900900900898,95.796216216216209,36.142522522522519,36.542882882882878,81.483333333333334,8.2173873873873866,40.246216216216212,57.161441441441433,66.56990990990991,66.269639639639635,16.324684684684684,42.3481081081081,3.1127927927927921,68.471621621621622,88.890000000000001,24.031621621621621,18.426576576576576,96.296666666666667,54.659189189189185,25.833243243243242,33.640270270270264,84.686216216216209,27.034324324324324,23.73135135135135,21.929729729729729,17.325585585585586,28.235405405405405,17.225495495495494,1.9117117117117115,24.231801801801801,0.11009009009009008,86.788108108108105,44.850360360360355,1.3111711711711711,81.183063063063059,29.036126126126124,73.676306306306302,20.328288288288288,60.064054054054047,36.242612612612611,8.8179279279279275,78.280450450450445,9.3183783783783767,88.089279279279282,94.394954954954954,41.347207207207198,82.98468468468468,56.460810810810806,11.520360360360359,7.9171171171171162,27.835045045045042,81.283153153153151,36.342702702702695,65.468918918918916,87.488738738738732,92.793513513513517,10.119099099099097,14.923423423423422,59.663693693693688,29.436486486486487,87.588828828828824,81.082972972972968,23.230900900900899,31.338198198198196,94.495045045045046,90.891801801801805,93.394054054054052,24.932432432432432,76.378738738738733,27.935135135135134,54.859369369369361,59.563603603603596,43.749369369369361,62.566306306306302,27.334594594594595,27.734954954954954,52.757477477477472,35.241711711711709,93.694324324324327,10.219189189189189,19.827837837837837,4.9144144144144137,58.862972972972969,81.683513513513518,72.47522522522523,91.49234234234234,0.61054054054054052,88.990090090090092,22.930630630630631,44.449999999999996,32.138918918918911,71.674504504504498,33.540180180180172,30.437387387387385,83.685315315315307,75.277747747747739,7.8170270270270263,98.698828828828823,91.091981981981974,92.593333333333334,78.080270270270262,7.0163063063063058,80.082072072072066,21.028918918918919,91.892702702702692,51.656486486486479,96.096486486486484,22.830540540540539,56.360720720720714,7.2164864864864855,82.384144144144145,25.132612612612611,31.438288288288287,25.432882882882883,5.5149549549549546,28.936036036036036,44.049639639639636,78.58072072072072,17.025315315315314,46.852162162162159,75.878288288288289,6.8161261261261252,37.343603603603597,68.771891891891897,19.927927927927929,46.351711711711708,75.778198198198197,73.175855855855858,27.134414414414412,7.5167567567567559,95.395855855855856,2.612342342342342,13.422072072072071,38.544684684684682,8.5176576576576561,2.8125225225225221,90.091081081081072,25.633063063063062,32.739459459459454,72.074864864864864,17.725945945945945,41.647477477477473,90.391351351351346,5.2146846846846842,43.64927927927927,68.271441441441439,47.252522522522518,71.174054054054054,80.682612612612616,84.48603603603604,6.0154054054054047,33.039729729729721,9.8188288288288277,87.38864864864864,95.295765765765765,63.867477477477472,49.95495495495495,9.618648648648648,40.046036036036028,61.665495495495485,97.097387387387386,73.876486486486485,58.362522522522518,63.066756756756746,58.462612612612602,45.050540540540531,83.585225225225216,11.92072072072072,36.943243243243238,48.553693693693688,2.4121621621621618,10.519459459459458,11.019909909909909,77.67990990990991,66.970270270270262,79.581621621621622,53.758378378378374,99.599639639639634,55.960360360360355,62.86657657657657,14.523063063063061,60.864774774774766,5.4148648648648638,74.276846846846851,88.489639639639634,38.84495495495495,51.956756756756747,67.070360360360354,95.8963063063063,46.752072072072067,23.130810810810811,25.733153153153154,49.754774774774766,55.760180180180171,94.895405405405398,66.169549549549544,88.789909909909909,42.548288288288283,93.193873873873869,70.373333333333335,32.839549549549545,45.751171171171165,52.957657657657649,75.578018018018014,99.899909909909908,45.150630630630623,4.5140540540540535,69.272342342342341,89.490540540540536,3.0127027027027022,7.3165765765765753,53.257927927927923,42.648378378378375,2.7124324324324318,86.587927927927922,57.561801801801792,53.157837837837832,97.59783783783783,67.971171171171164,98.598738738738732,6.415765765765765,28.335495495495493,99.499549549549542,66.069459459459452,75.177657657657662,85.386846846846851,56.660990990990982,51.356216216216211,32.539279279279278,46.251621621621616,64.968468468468473,65.368828828828825,76.478828828828824,69.472522522522524,41.947747747747741,6.6159459459459455,29.736756756756755,56.060450450450446,85.486936936936928,53.558198198198191,75.97837837837838,13.321981981981981,30.837747747747745,38.644774774774767,50.455405405405401,76.178558558558564,48.453603603603597,81.783603603603595,34.340900900900898,41.147027027027022,12.120900900900899,76.078468468468472,89.890900900900903,15.323783783783782,40.646576576576571,95.195675675675673,20.228198198198196,30.737657657657657,35.341801801801793,63.667297297297289,51.556396396396387,23.33099099099099,15.423873873873871,5.8152252252252241,60.164144144144139,30.637567567567565,20.42837837837838,26.433783783783785,5.1145945945945943,54.35891891891891,70.573513513513518,33.440090090090088,20.628558558558559,16.524864864864863,90.59153153153153,47.352612612612603,6.1154954954954945,60.764684684684674,39.445495495495493,9.118198198198197,92.693423423423425,78.180360360360353,57.361621621621616,33.940540540540539,84.586126126126118,71.974774774774772,6.7160360360360354,52.257027027027021,63.967567567567556,94.294864864864863,71.474324324324328,73.476126126126118,60.264234234234223,3.2128828828828824,94.695225225225215,33.139819819819813,81.883693693693687,65.869279279279283,73.776396396396393,83.985585585585582,48.853963963963956,10.919819819819818,30.037027027027026,6.3156756756756751,21.32918918918919,89.090180180180184,44.650180180180172,0.01,20.128108108108108,96.797117117117111,84.886396396396393,19.127207207207206,16.424774774774775,99.199279279279281,55.159639639639636,18.826936936936935,26.734054054054052,51.75657657657657,83.385045045045047,16.024414414414416,58.963063063063053,31.138018018018016,27.634864864864863,58.662792792792786,26.133513513513513,9.5185585585585581,86.688018018018013,17.625855855855857,57.061351351351341,1.5113513513513512,61.365225225225217,24.83234234234234,38.044234234234231,30.537477477477477,9.0181081081081071,67.570810810810812,94.194774774774771,4.6141441441441433,99.09918918918919,42.047837837837832,52.15693693693693,39.145225225225218,13.02171171171171,1.6114414414414413,44.249819819819812,57.461711711711708,57.962162162162151,77.079369369369374,72.275045045045047,13.722342342342341,21.429279279279278,37.743963963963957,85.987387387387386,49.654684684684675,62.065855855855851,51.055945945945936,4.1136936936936932,75.07756756756757,83.485135135135138,17.125405405405406,44.950450450450447,26.533873873873873,15.123603603603602,91.692522522522523,62.165945945945936,24.131711711711713,1.4112612612612612,45.951351351351342,55.25972972972972,82.584324324324328,70.173153153153152,14.723243243243243,52.457207207207198,40.546486486486479,21.229099099099098,49.454504504504499,55.66009009009008,21.729549549549549,23.93153153153153,19.027117117117118,76.879189189189191,15.824234234234233,31.638468468468467,83.284954954954955,87.08837837837838,64.067657657657662,50.955855855855852,26.633963963963964,32.639369369369362,85.887297297297295,98.098288288288288,40.14612612612612,70.773693693693687,53.958558558558551,89.590630630630628,36.64297297297297,26.033423423423422,15.924324324324322,78.680810810810812,3.4130630630630625,54.459009009009002,42.248018018018016,96.997297297297294,98.49864864864864,22.330090090090088,59.263333333333328,84.285855855855857,3.8134234234234228,48.753873873873864,54.959459459459453,42.448198198198192,60.364324324324315,19.527567567567566,41.847657657657649,69.372432432432433,69.872882882882877,97.39765765765766,79.381441441441439,66.870180180180185,4.4139639639639636,5.0145045045045036,38.244414414414408,54.258828828828818,12.72144144144144,61.765585585585576,40.846756756756754,88.589729729729726,11.420270270270269,55.059549549549544,52.056846846846838,31.938738738738738,28.135315315315314,60.464414414414406,94.09468468468468,59.763783783783779,58.762882882882877,80.782702702702707,8.1172972972972968,95.996396396396392,34.941441441441434,18.726846846846847,36.743063063063055,59.363423423423413,10.719639639639638,68.071261261261256,2.5122522522522517,98.798918918918915,28.035225225225226,92.993693693693686,43.24891891891891,47.652882882882878,18.526666666666667,33.339999999999996,39.345405405405401,0.21018018018018017,7.7169369369369356,25.032522522522523,16.825135135135135,64.768288288288289,74.677207207207204,51.856666666666662,45.550990990990982,82.684414414414405,42.948648648648643,77.780000000000001,27.434684684684683,68.171351351351348,53.658288288288283,11.320180180180179,46.952252252252244,37.143423423423421,19.227297297297298,31.738558558558559,77.579819819819818,35.842252252252244,13.1218018018018,67.770990990990995,52.657387387387381,50.555495495495492,35.642072072072068,99.299369369369359,4.8143243243243239,82.784504504504497,49.55459459459459,84.385945945945949,37.443693693693689,82.884594594594589,78.480630630630628,49.854864864864858,61.5654054054054,67.871081081081087,26.834144144144144,3.5131531531531528,55.559999999999995,92.39315315315315,55.860270270270263,36.442792792792787,79.48153153153153,76.679009009009008,29.636666666666667,70.473423423423426,63.567207207207197,39.945945945945937,66.670000000000002,70.07306306306306,2.1118918918918914,93.794414414414405,11.220090090090089,64.167747747747754,77.980180180180184,28.535675675675673,61.865675675675668,18.326486486486488,93.994594594594588,46.451801801801793,56.560900900900897,19.727747747747749,12.220990990990989,50.355315315315309,20.828738738738739,69.17225225225225,84.986486486486484,79.781801801801805,84.185765765765765,60.564504504504498,85.687117117117111,67.170450450450446,23.030720720720719,49.354414414414407,48.353513513513505,36.042432432432427,88.389549549549542,27.234504504504503,80.882792792792785,79.181261261261255,34.541081081081074,22.029819819819821,32.439189189189186,53.358018018018008,3.6132432432432426,73.075765765765766,49.154234234234231,31.037927927927928,39.545585585585577,9.4184684684684665,44.149729729729721,58.562702702702694,20.728648648648647,86.187567567567569,78.981081081081072,41.04693693693693,58.062252252252243,90.191171171171163,48.153333333333329,74.777297297297295,37.043333333333329,17.826036036036037,50.85576576576576,63.266936936936929,92.493243243243242,38.744864864864859,57.761981981981975,64.668198198198198,72.575315315315308,77.279549549549543,43.048738738738734,91.392252252252248,73.376036036036041,14.322882882882881,32.339099099099094,50.255225225225217,81.383243243243243,56.961261261261257,36.843153153153146,65.168648648648642,28.435585585585585,26.934234234234232,18.626756756756755,56.160540540540531,65.769189189189191,1.211081081081081,44.349909909909904,99.799819819819817,13.92252252252252,41.247117117117114,59.063153153153145,54.158738738738734,62.266036036036027,72.875585585585583,11.620450450450448,78.380540540540537,5.314774774774774,32.939639639639637,89.790810810810811,22.530270270270268,62.666396396396387,87.288558558558549,44.550090090090087,61.265135135135125,32.239009009009003,72.375135135135139,70.97387387387387,3.3129729729729727,13.622252252252251,77.479729729729726,41.747567567567565,17.926126126126125,88.689819819819817,2.2119819819819817,43.349009009009002,0.81072072072072066,97.197477477477477,79.281351351351347,5.7151351351351343,57.862072072072067,84.085675675675674,72.6754054054054,86.888198198198197,23.431081081081082,29.336396396396395,90.991891891891882,94.99549549549549,74.17675675675676,53.4581081081081,24.431981981981981,5.9153153153153148,69.972972972972968,48.954054054054048,76.578918918918916,93.293963963963961,40.346306306306303,7.6168468468468458,18.226396396396396,41.44729729729729,96.596936936936928,77.179459459459451,52.557297297297289,51.256126126126119,91.792612612612615,51.156036036036028,74.977477477477478,47.552792792792786,48.253423423423421,68.871981981981975,75.477927927927922,85.186666666666667,76.979279279279282,10.819729729729728,16.624954954954955,87.188468468468471,92.293063063063059,14.022612612612612,73.57621621621621,64.568108108108106,19.327387387387386,28.635765765765765,25.933333333333334,98.198378378378379,90.291261261261255,29.136216216216216,39.045135135135126,80.182162162162157,34.440990990990983,90.791711711711713,87.688918918918915,92.192972972972967,6.9162162162162151,30.337297297297297,11.119999999999999,43.449099099099094,40.746666666666663,52.857567567567564,80.982882882882876,0.31027027027027027,57.261531531531524,89.190270270270261,33.840450450450447,93.494144144144144,11.72054054054054,53.05774774774774,98.298468468468471,35.141621621621617,66.369729729729727,29.936936936936934],"expected":[2.0717585439619369e-76,7.7044753151865743e-98,2.4475605650192315e-13,2.072329811440301e-51,8.7911773126812357e-23,0.099370966892059764,1.1120773124978796e-15,1.030097404925194e-60,1.3292131685444808e-42,0,1.9282054665921627e-27,0.060163608818433481,1.1270830541455066e-18,3.2703376006552488e-05,2.8809141740913041e-18,7.0390749270311307e-07,8.4456179189617644e-57,1.3886870339577563e-82,0,3.201792213406593e-41,6.2417148364852187e-37,9.3970764420221671e-29,1.836709766534129e-142,0,8.0453082162701164e-65,3.2860955576222531e-11,1.7757119878034475e-27,5.3357097698947457e-18,9.5716018179825036e-08,4.5358583407047567e-26,0.0072167004453169634,5.2669971649433385e-10,4.8513155621822222e-11,1.2894099435630103e-14,5.4830204620106633e-22,3.3543195491603211e-12,1.0910556139296568e-16,0,5.411415050574314e-05,3.0386480951773071e-279,4.8696578912301153e-12,1.4964267579641184e-13,0,2.9498719902680215e-200,2.5042945822739721e-21,1.753318503558719e-20,6.2316483665850176e-116,2.8496614317716782e-130,2.2388068739672466e-05,0,3.1425321836133525e-19,1.2709182517419313e-22,0.094359869803172666,8.7139686049876014e-05,6.103120865618626e-12,3.3329328097021088e-06,5.4999271990241859e-05,0.023843596774519128,5.0351172062641253e-101,7.4933820103293625e-19,8.5151101312818613e-23,0,0,4.3221506732490026e-05,0.014312192665697356,1.9197099697755486e-05,9.587577784174624e-05,1.7481733845581999e-06,8.1454366910345608e-42,0.00016352922251586415,0.00078896482739063036,1.0235786034176587e-71,9.7172516079189883e-21,2.727922992451656e-18,1.4330860231037922e-08,8.4331276030719218e-139,5.2825610600812202e-38,9.1205720744139349e-104,4.8491927600582201e-61,6.7593540823646336e-13,0.028951128791192805,3.3141601301596256e-05,0,5.0921246202018684e-14,1.8951470065936e-06,1.8930415609741402e-16,0,1.4201934739799328e-10,2.4388317380367535e-34,2.2079956382730413e-34,3.1385378364377105e-128,2.5400245496208078e-20,0.00039304505155096821,1.8214648864786543e-30,1.2680441121072866e-17,1.2008659834440657e-77,1.2410708052048258e-55,2.8355517691352766e-14,1.2745270113814415e-171,0.034221556048455802,1.2330723184718706e-17,2.1004951296709844e-20,5.4170507324742745e-16,3.5909849020486561e-41,7.4012413110081964e-64,3.4069895620399975e-12,0,3.5148815204356359e-07,0,4.0596138820622836e-23,0,8.2659963815481655e-10,0.0046053845889895331,0.0031367236326276574,0.000517541737805487,0,7.1075943620045558e-43,0.2119581854906247,8.939372999178603e-05,0,4.7070931034420798e-24,2.0511179542042354e-155,0.03306083201917271,4.5090827031532706e-37,5.6767297837275569e-243,0.00024036407120244619,0.039233355413146861,1.5461923417506942e-30,0,6.1531543157392876e-29,1.9610618101617974e-17,0.0090268464551848879,0.34664329074641159,1.1040406245106226e-37,7.7533179558803192e-22,4.1522517374310921e-07,3.0025872691774535e-05,8.013835285323781e-40,1.8394318745290344e-14,1.0115275427051834e-08,2.5692855404999428e-40,7.8366115451920894e-40,3.6614598953830915e-05,5.8555702913376736e-15,4.7278628734143807e-09,2.1381387489128996e-11,3.9003469475117831e-06,1.0686897465074532e-17,1.2633872282247673e-27,7.036672911065052e-11,5.4741857210657838e-10,1.4141859133686231e-05,6.2903925477300823e-16,2.1347306695637353e-122,1.3171653769639802e-09,3.6577565165014139e-126,5.4943101529282464e-168,5.0757640385124645e-27,3.2663339005486678e-06,3.0536276077761157e-06,0.19579444347698888,5.5396643961936823e-32,0.0014356224196144776,4.5719340868563684e-21,1.1970085024578929e-58,3.1261958650760748e-186,0.00045645637256672605,1.1842554770581566e-11,2.1806969068000307e-10,0.018295547240855442,1.5517487968826374e-05,0,2.3781351111137653e-05,3.3703829417381615e-10,4.6825663930162115e-10,3.0634825104678322e-06,8.574842012343846e-12,0,6.1152835561927948e-07,0.00042389000447768527,0.00051009258354296424,0.0022214194234541898,4.4094871975259299e-12,0,3.5492083984569207e-07,3.2025743551478986e-05,3.2413262491195258e-10,1.1793834199726999e-13,0.00015255715798138925,0.0018066758106259479,0,2.7814786700219326e-12,0.0069271941207448891,1.2911649319681615e-16,1.3536374627641517e-98,2.3123338876441083e-52,1.0645675223180051e-223,6.0510757148719478e-238,5.0222671049752842e-06,3.8294451997609544e-06,3.431447249818987e-46,0.00030056276481185945,2.9332647970972709e-07,0.086022340341247963,5.699120388576067e-65,0.00025550464281051905,1.2573956427335923e-09,1.2815759283106224e-15,1.0885962520668793e-34,0.085832232667604286,3.8379097474678541e-10,4.5890912187532468e-08,0,2.4017799450072921e-06,0.00056687410563108578,0.032192828104088307,0.0004596567881625661,0.011550447488388758,2.2106940198634693e-13,0.0064458976963270983,0.000492760777721102,0.0030564091486676411,0,1.7718180899632961e-182,0.00081482829292706105,5.0771468332900753e-40,2.7635099514103086e-05,0.022495848649178349,5.6269058623899559e-06,4.5320321784748774e-31,1.9438824308859957e-63,0,3.7291052025099138e-58,2.2159994711295246e-10,0,0.00030913297976894685,0.0019711830801724954,0.038129427184129698,0.34646101952693642,6.4966152180297096e-12,3.0860040237889299e-69,2.2859072484361815e-09,1.7514163861283229e-07,2.7565705474301698e-10,4.2363004318927499e-16,2.4154173493419297e-13,7.4947506945309013e-05,5.5809842727737103e-50,6.5613729869208681e-09,0.013905076146020186,5.4952619500136526e-271,1.8848476811256125e-22,2.7859053471611104e-25,2.1237107772766961e-19,0,2.4668161292677327e-07,6.0533231097122346e-21,6.8006285390568305e-22,0,0.0362993454638776,0,3.1387264665831622e-169,1.0952522155386436e-26,9.4171694803180583e-05,2.627171529951407e-172,3.317404314114811e-22,2.4617350501274898e-132,6.8563930673125195e-24,2.8526642530502359e-43,8.7887426901337184e-74,2.5845327806776778e-220,1.7148655478246759e-12,3.7558378322457487e-101,0.00011276562665299411,1.373762907392394e-05,0,0.0020622035248622824,3.9381421313283136e-22,1.6720950385535527e-25,4.5109670269366885e-08,1.0784223224125577e-05,2.1594752706077201e-18,2.5267522041257855e-102,1.3231097627315058e-15,1.274047068271641e-09,6.4149877306296752e-35,2.4287950640824788e-09,9.7975212695627627e-05,1.0014160445183406e-05,1.4010895979656664e-13,1.001056302933023e-56,0.1181755421792393,1.2966483310968626e-80,0.00039987421966393335,0.00019576228101547894,0.0062192951289105616,8.0563283236885926e-14,9.8828722002690712e-31,1.9201907523446354e-05,0.017969282431246431,6.4496420114871205e-32,2.4779157501026034e-28,6.2440549667447506e-11,7.760338356391167e-18,4.4878884179210542e-60,0.0061148160843734105,4.0196601824046139e-30,0.10933397689863095,2.8542489860895435e-24,6.2787695019859967e-62,1.3647445202611816e-07,5.4589963297812124e-11,1.4831267511711949e-09,0,1.6339498929100012e-18,0,4.1827056103570951e-29,1.1434100883824004e-52,4.3734720091656945e-15,2.8772406719862798e-23,0,0.0018700944307267521,2.9797028026066617e-14,2.2037948233007987e-32,2.4681799974259158e-17,3.2329939924648956e-85,5.8081407381988984e-05,2.5969591490080216e-19,0.059568255708575615,2.3909768056396918e-278,0,2.6695349539337067e-62,5.7232650130715614e-16,1.7342744697081248e-21,1.3541094450353584e-228,0.0027556812668637662,1.7649601910290093e-05,1.151200183111816e-13,4.4330952844470709e-12,3.4923222927912511e-06,2.736580558380011e-13,0.013183023512462144,2.1502579994813491e-06,0.010020743179731503,0.79352574638342654,1.0916000908134449e-14,1.0994372840745538e-75,2.7284028273865569e-13,6.8582692860709979e-20,4.0379620356500834e-08,2.4348698130798193e-17,4.340840813707097e-52,7.867435466041871e-52,0.0012684947572648392,1.4755152825423839e-231,1.4461105844021421e-32,0.065413118873138998,4.6274679592051002e-16,0.0089410958354387542,8.3653228091527467e-25,2.354183500511336e-52,0.00014590454818518987,0,8.8208296932411883e-191,4.6370000416537031e-294,2.8780446972407027e-07,4.1956320129974794e-104,6.8096860917799237e-217,1.5534902947838499e-52,3.551005849434762e-18,8.1831425298710717e-17,6.2280354670607663e-101,0.038481879740131723,0.014822338087893161,1.9645943083932778e-205,3.4666631541324691e-31,0,0,7.8859455533575052e-05,0,0,6.1750439222194416e-16,2.4787820440776603e-12,5.4157432615013949e-10,7.898944238422525e-17,0.0040306062722694188,0,2.2733668642728533e-300,1.1410898121903585e-07,3.7222222721687484e-29,0.0030754865288437471,4.3580684419824837e-14,4.5375516896302841e-11,1.2544356725351955e-15,4.6580676726047965e-52,0.019876569981438295,1.6204595995229164e-64,0.10495791325906137,1.3362302966054701e-12,3.1549645369179166e-171,3.9938727197848956e-15,2.9066228138861644e-42,0.32719972450858392,0,7.5453335838303389e-208,1.5072590422834384e-09,1.4826019992168234e-20,5.5846560371913853e-25,0.00023891038153742855,2.3711711615014872e-16,2.922301039332768e-08,0.00023914001678141403,9.5437280045693037e-07,9.7601299075627309e-83,0,8.3467356389064659e-99,3.1074806548497057e-14,0.0008957610915894846,2.3248599289102026e-19,2.9434204163702837e-05,1.4663355134406825e-167,0.00012610295290628611,0,0,1.91700613916001e-22,0,1.1097439831784962e-171,7.8003151550824673e-15,8.9930214192297679e-06,5.8981870528381189e-42,0.22910916425683964,7.0734307348274883e-10,9.1593355447017006e-11,0,1.7330329435016554e-05,1.3674531696159958e-16,1.0101070818085084e-10,0,1.7131578352794806e-09,2.180175916475864e-20,0.00093954545063862165,2.1650527950085328e-07,0,1.1338343867913642e-12,1.565465994048942e-06,0.12026600671181771,1.9041174885988143e-52,0.92184321827555482,0.00022422428989721745,8.0311511705635887e-19,4.5894019285775156e-11,0.427947998696873,1.7152341268536967e-86,2.2775449662478669e-06,6.089431551316306e-12,6.0529344754492401e-31,5.5271503397518596e-05,3.527645242723061e-08,2.7045970590968409e-38,2.0579636334825311e-12,1.4334687821156831e-263,0.00016826210348851219,5.55994541955086e-14,1.1397132136234363e-166,7.0015568074568722e-05,3.0463897642925672e-173,0.13387241034527256,4.3280565287628487e-05,5.4868342098158322e-16,3.0172175790362622e-18,2.9874379191759611e-19,0.00010536519655898748,0,0,4.6111000281213809e-08,0,8.7669171233542849e-59,6.732878699718735e-08,2.8413106102194778e-13,1.2530455701645351e-13,0,4.7997833007150342e-08,1.1848131326385286e-72,0.0025320170851451376,1.3746567265258458e-06,7.6770074442045634e-99,0.00019217724798300945,0.00059367747892206165,0.032700576651553181,0,0,1.3108521656688985e-25,1.680315049690581e-11,0,2.3376841752495399e-08,4.0539130945915664e-08,0.03098157269076535,2.2534039374327521e-23,2.4244321999605817e-217,1.2280739125747571e-113,5.0726117096005675e-66,5.3905591722551307e-36,0.00055835557131915514,2.7745354339104061e-92,1.8810837954891127e-33,3.3545807585892568e-07,5.2881718091425135e-06,2.7921170167596448e-06,3.408922766043095e-55,0.00021350731702626848,4.832260332588988e-31,6.3892383870335392e-31,1.6569502746576772e-36,1.2209174753410074e-05,1.4709513973529221e-24,2.9190091845501629e-34,2.682656646785118e-09,1.2617549130712352e-106,6.1851133574809891e-42,7.6977878322558651e-06,4.5536580827357016e-25,9.3495023044120436e-09,0.36788454026230705,1.859129530120506e-30,2.5204182775260754e-28,0.1191751210807651,0.12155012686099474,1.1425102142963845e-15,1.6133407826616661e-181,0.0029885473488908813,5.1833549775890926e-65,2.1223834833065619e-58,4.9911679469578043e-08,0,2.1235658442435824e-162,2.2713850899288648e-06,0.1247351119464096,0.00045459914456114748,1.688725753193615e-14,9.8554751952610588e-12,6.7919478303106973e-21,4.1680526071364411e-38,0,2.3283722486678147e-29,2.9422913605087634e-40,1.4923309174655051e-15,0,0,1.1307455797549951e-32,8.0672372753924577e-07,2.2306942641985793e-08,0.060214619742734905,1.6898587700976465e-10,8.6227478977716403e-226,3.4712668544224372e-37,1.1017482158129042e-23,1.595540999221109e-122,0.046940974866127798,7.9352339049889295e-09,6.7674603227442311e-05,1.0201707854227962e-81,6.8890228265983517e-18,0.00089291229792336127,1.7661062406009179e-280,3.1385361117883988e-07,0,0.020116041373711983,0,3.6222433102319552e-45,3.0644326481334406e-05,2.6023662244998467e-44,6.3856953018831229e-10,7.4793333762008277e-20,7.3446504420896715e-11,0.0012084904179731045,1.2141618393903851e-62,3.3208598353718585e-13,7.3636880528084296e-07,1.2098247459698251e-08,0.098134269885525899,6.2867253669736416e-228,0,4.8400397582549633e-101,0.00075840535977588614,0.15878879241241128,0.00032103894935952843,5.6935428443944829e-07,0.00053218062570353991,1.1452464060197848e-06,0.0067638304783570035,1.8551294455684765e-28,5.6631913932577013e-80,3.7051528476873567e-34,1.4948966851756222e-46,0,1.1618773525037736e-65,2.3960302942120094e-24,3.1082290768933638e-14,0,1.2391996614880728e-52,1.8370924389987728e-20,6.0180010764705254e-17,0.12311899205878774,4.6314949068415814e-27,2.505222450845866e-12,1.3626312646308285e-12,3.2239736661010703e-43,1.1245833659053742e-20,4.1512221117292722e-69,0.0076076562560982441,3.4672625026103624e-53,1.5986797231760903e-98,5.6868711774250988e-22,1.924917731471388e-301,1.7201068509729793e-10,0,1.4247236388460791e-31,0.053454458996530479,0.00092284608941425948,0.020199643593868818,5.1988494796965146e-148,0,2.3717340667796809e-06,0,4.237658542531372e-37,4.076690677955782e-32,7.116278565089754e-39,0.00011266259777105789,5.1021000779209925e-07,1.4221452160152741e-48,3.4657867402069691e-37,0.00033415915959831666,1.5125154846067465e-10,8.6087988690259976e-07,1.7796850365302942e-61,0.0050743637724501335,3.5671331488539699e-20,1.5263353741345434e-09,1.5446609783523819e-15,2.2390309534710082e-128,2.0322605116762184e-14,1.8216167140870021e-23,1.0466283016679884e-09,0.0010479731544030234,0.00085523013774541719,0.00028216980792283251,6.1354640996216471e-46,0.00075185731532762966,1.1556417063533366e-05,2.085905420448254e-06,4.0444954934155678e-32,2.4800251762575996e-10,1.0661661210822838e-25,0.38049508978575358,1.7627904223774488e-93,9.3660415363150717e-36,0,0,0,0.021300223496675076,6.9607375720548869e-17,1.1707858839325323e-06,1.0495873732667239e-19,1.1191693674537174e-74,9.3994325523499536e-41,1.1845872617269011e-06,0,0,3.7014101332163917e-33,1.4890958970537597e-05,1.3668586432340922e-07,1.2471798702810478e-17,0.12959227608220192,0,3.4084558846804652e-18,0.019538975895249736,7.5260551680985087e-16,4.6931530824069283e-07,4.2259441258897667e-42,8.1845788844639425e-152,0,5.3341159803997364e-166,9.9676571090727273e-09,0,2.2218125384147612e-12,4.8349079389669718e-05,2.564460411166643e-12,0.01693527458638738,4.0772934509409982e-55,6.6184007995922641e-06,0,4.7834807796515827e-38,7.0387738166269485e-05,0.00023525951912480264,5.7673696001164008e-91,1.5777443030908486e-13,2.7855684221759653e-34,9.2002318634503352e-105,1.8139439116239966e-14,3.1785519047055416e-07,1.106902379285381e-23,2.1387976747050614e-109,6.4114699435140097e-64,0.00015240697193302907,2.859980629082748e-06,0.00011297802431927954,6.5959338587330943e-152,6.9242261840209102e-09,1.9058183790269456e-16,8.5296421204409508e-71,0,0.0014705449231785074,6.4916593811789892e-09,0.017166880624564361,7.0074064206190207e-42,0.095913864043729105,1.7014631936768946e-96,6.2726197924087887e-09,7.3624484033386977e-48,8.0446332151075438e-08,3.895793288146152e-15,0,5.7666548214896333e-45,4.8491031856727052e-32,1.8339659887265529e-09,5.5803021513268502e-24,1.6559800229882201e-08,0,0.007582074069599461,0,4.7302392822105348e-11,7.441061187186734e-08,8.7041761305587939e-50,0,2.1753409513059261e-65,0.13288229567591989,0.10562412487248511,1.5604320693290472e-09,4.0865591406869494e-09,0.010544212783131975,1.5150829511976725e-07,9.6705904712943254e-16,8.445080899747231e-10,0.0019542905626000768,1.7819702981440907e-89,4.9633750093586141e-22,0.00066331768775312948,8.0192008468444009e-93,7.2574646280768657e-37,1.0609291864408199e-81,2.941908316626405e-10,0.00048778035179468745,1.8241182471064582e-25,0.047344324082050249,9.9979768743315312e-90,9.5361440091771748e-48,1.9511685097483734e-28,0.0020261240883476602,2.0935586025573058e-05,0.0062229144648875481,0,0.00049857674496139675,2.586612616228619e-07,3.9503981101867253e-05,0,7.3715164551718658e-248,2.9862048230786037e-05,8.3377793669931776e-08,0,0,32.887112952597406,0.084811201447076268,8.4622385511022587e-298,0.0056137911387504087,7.4560029672633471e-59,2.436374680757786e-65,0,0.00097733188913535162,2.0504649429067503e-226,4.9584055477927799e-18,2.5927729786701239e-09,0.0043525208859054882,0,6.7133180820767732e-40,0.052323343081020116,0,0,0.007095599874097515,0.00053224641713389221,1.3477361013680313e-16,2.0699517035710913e-24,0.024355493444455447,5.4835218139760366e-24,2.0455544448518495e-207,1.4594334959419862e-14,3.1281025693051284e-157,1.6878801630706026e-52,0.056993954785981418,2.0914500269412019e-49,5.2667346575238701e-06,3.3975311193783737e-18,0.00060026407804695452,3.1245589689286631e-183,1.2850070920505687e-33,7.9855918634747999e-16,1.5230353527745246e-33,5.816943898331735e-22,7.8104279071133538e-08,0.011843339264542127,5.6154333812062648e-11,1.9339765428289411e-38,6.7665359300085606e-10,0.00029707061416323717,3.7639632188917843e-14,1.6197593348379356e-06,0,1.6744962616994183e-205,3.1856193190651446e-05,2.465357026987048e-210,9.9334496911622277e-153,0,0.026685328730000991,1.1366145215004737e-37,0.00040932131232958757,6.2483725071091193e-24,9.5976169044068935e-19,1.484735062661937e-18,1.7748805722591427e-48,0.00059665191482585181,4.1330940633138834e-19,1.3765819413769864e-166,2.1867835938529231e-96,4.0436819693418926e-36,7.4842491723600516e-171,2.2479081755057558e-09,0.0017225788018139926,1.2098743248429262e-37,0.00022628318878340723,8.3942560947428162e-19,5.4817320347692638e-06,7.4227169429461559e-12,0,5.682300085531363e-26,5.6915906223787018e-138,7.0809136786356224e-261,6.0672479031016047e-109,7.2388556529572636e-47,2.1022383699049254e-42,1.1158919175060434e-13,1.5643122626872499e-06,1.1540173414416871e-128,3.2929425345375366e-60,0.0026225877567730999,0.0010873237115241333,1.184899095577431e-08,5.9677986175131941e-45,5.0007680689354584e-28,0,3.176718882468126e-06,4.3425677090236653e-05,0.00012669455689988282,4.6800616517520689e-14,2.5206758948566289e-27,0.0043702616657861617,1.1075328053909672e-07,1.4837076871624255e-06,0.0010665543765362223,1.2361850853363173e-21,3.359249856011209e-132,1.1353997991464895e-07,1.7975823080898873e-28,1.1687146760186968e-08,3.5427428470327059e-235,0,0,1.6081629875733484e-165,1.8252346097734283e-51,6.2885186780880829e-16,6.9233303785225111e-06,3.1641992332258116e-09,5.7400693442049255e-27,4.516387295007829e-16,0,0,0.011194970804446241,2.4321357130238585e-20,1.2129694622589554e-196,1.9233500136076475e-242,1.3809952811862679e-21,4.7081749023224148e-07,3.4370664360895827e-10,3.6981556004518352e-06,3.4093523163279024e-24,0.0057530729203696786,0,2.5499640332712831e-253,4.9957572776847737e-05,1.9212627057747166e-10,1.4819518394629765e-12,0.016999429559085809,2.0465623523950912e-08,6.4097825314149425e-160,0,6.5113748636319535e-06,1.7195733168561053e-05,6.6380346223243584e-49,2.7817946165252701e-41,0.16235963514763424,7.4482915944088773e-05,8.0838590279854988e-87,1.6274181032821652e-18,0,0,0,4.9322612302900213e-12,1.0036803863404419e-07,0.00048707801786871042,2.7969472756873903e-25,0.30790384757629496,0.0049870895080144769,4.3167515194302799e-33,1.3860317364199717e-26,0.013675518644159943,5.2038490204403182e-15,0.00054052621062295337,7.7021244305462485e-10,7.2037357621607344e-10,6.4355430634545137e-27,2.5294828962226842e-11,0.10957917831785517,3.5104453547627311e-11,4.2669715071957286e-37,7.1449839788030604e-36,1.3483992446155187e-16,0.00038426348698422663,6.6004025006687373e-66,1.9730910485406938e-19,1.2587968904644316e-19,7.4649359359959122e-88,1.138754939726363e-08,0.0015157821383709553,0.064376071630187146,2.8558723794545156e-38,6.8744283548464753e-15,5.9081510120661911e-70,0,2.2082766713973971e-64,0.058695547235573381,4.2728870093256703e-15,2.4412751673616367e-08,0,0,1.2701849804834675e-42,1.1406488720777993e-40,0,7.8342722066668441e-09,6.0118968501186642e-08,5.1217218169865062e-06,0.00099132142423391089,9.7351753069893568e-81,2.3092041427085107e-18,1.7828102341755178e-19,2.0921774556908825e-20,0.016718998683951877,0.0159791555473182,3.8062569871422893e-40,4.5284255811824551e-09,5.4930172565577138e-17,1.7675639094933546e-130,1.696317626155252e-31,1.7566789237354162e-13,0.00016542719420512079,6.7770296236261435e-19,8.6577730732847435e-20,4.6682817845572448e-16,0,3.8430341692689643e-07,5.6987438030072925e-08,1.9235380969871653e-16,6.4890392529218728e-209,3.3432178452992185e-150,4.7056944997289274e-36,0.00021973261381252741,1.7117962263209185e-171,0.061008943972044573,1.9595898126815441e-20,1.4724331893503133e-08,1.0579121302442462e-18,4.5060147196030302e-89,3.3365478353724571e-13,6.1262794816587372e-08,4.9868153071488282e-24,0.00052824041834758739,4.1138332618444911e-24,0.020895069507795436,2.5169358991707166e-07,3.6566079661720911e-10,0.00016627875326698734,8.4871141752238672e-24,0.00027224080989969216]} diff --git a/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/test/fixtures/r/runner.R b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/test/fixtures/r/runner.R new file mode 100644 index 000000000000..2320d2bc2f4b --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/test/fixtures/r/runner.R @@ -0,0 +1,102 @@ +#!/usr/bin/env Rscript +# +# @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. + +# Set the precision to 16 digits: +options( digits = 16L ); + +# Set the PRNG seed: +set.seed( 200 ); + +#' Generate test fixtures. +#' +#' @examples +#' main(); +main <- function() { + #' Get the script filepath. + #' + #' @return The absolute path of this script + #' + #' @examples + #' filepath <- get_script_path(); + get_script_path <- function() { + args <- commandArgs( trailingOnly = FALSE ); + needle <- "--file="; + match <- grep( needle, args ); + if ( length( match ) > 0 ) { + # Rscript: + filepath <- sub( needle, "", args[match] ); + } else { + ls_vars <- ls( sys.frames()[[1]] ) + if ( "fileName" %in% ls_vars ) { + # Source'd via RStudio: + filepath <- sys.frames()[[1]]$fileName; # nolint + } else { + # Source'd via R console: + filepath <- sys.frames()[[1]]$ofile; + } + } + return( normalizePath( filepath ) ); + } + + #' Convert a data structure to JSON. + #' + #' @param x A data structure to convert + #' @return JSON blob + #' + #' @examples + #' x <- seq( -6.5, 25, 0.5 ); + #' json <- to_json( x ); + to_json <- function( x ) { + return( jsonlite::toJSON( x, digits = 16, auto_unbox = TRUE ) ); + } + + #' Generate an output absolute filepath based on the script directory. + #' + #' @param name An output filename + #' @return An absolute filepath + #' + #' @examples + #' filepath <- get_filepath( "data.json" ); + get_filepath <- function( name ) { + return( paste( source_dir, "/", name, sep = "" ) ); + } + + # Get the directory of this script: + source_dir <- dirname( get_script_path() ); + + # Load the statmod library for dinvgauss: + library( statmod ); + + # Generate test fixture data: + # Note: x, mu, and lambda must be > 0 for Wald distribution + mu <- sample( seq( 0.1, 10.0, length.out = 1000 ) ); + lambda <- sample( seq( 0.1, 100.0, length.out = 1000 ) ); + x <- sample( seq( 0.01, 100.0, length.out = 1000 ) ); + y <- dinvgauss( x, mu, lambda ); + + data <- list( mu = mu, lambda = lambda, x = x, expected = y ); + + # Convert fixture data to JSON: + data <- to_json( data ); + + # Write the data to file... + filepath <- get_filepath( "data.json" ); + write( data, filepath ); +} + +main(); diff --git a/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/test/test.factory.js b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/test/test.factory.js new file mode 100644 index 000000000000..a51484f8c36b --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/test/test.factory.js @@ -0,0 +1,271 @@ +/** +* @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 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 data = require( './fixtures/r/data.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 pdf = factory( 1.0, 1.0 ); + t.strictEqual( typeof pdf, 'function', 'returns expected value' ); + t.end(); +}); + +tape( 'if provided `NaN` for any parameter, the created function returns `NaN`', function test( t ) { + var pdf; + var y; + + pdf = factory( 1.0, 1.0 ); + y = pdf( NaN ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + pdf = factory( NaN, 1.0 ); + y = pdf( 1.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + pdf = factory( 1.0, NaN ); + y = pdf( 1.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + pdf = factory( NaN, NaN ); + y = pdf( 1.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + pdf = factory( NaN, NaN ); + y = pdf( NaN ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if provided finite `mu` and `lambda`, the function returns a function which returns `0` when provided `+infinity` for `x`', function test( t ) { + var pdf; + var y; + + pdf = factory( 1.0, 1.0 ); + y = pdf( PINF ); + t.strictEqual( y, 0.0, 'returns expected value' ); + + t.end(); +}); + +tape( 'if provided finite `mu` and `lambda`, the function returns a function which returns `0` when provided `-infinity` for `x`', function test( t ) { + var pdf; + var y; + + pdf = factory( 1.0, 1.0 ); + y = pdf( NINF ); + t.strictEqual( y, 0.0, 'returns expected value' ); + + t.end(); +}); + +tape( 'if provided a negative `lambda`, the created function always returns `NaN`', function test( t ) { + var pdf; + var y; + + pdf = factory( 1.0, -1.0 ); + y = pdf( 2.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = pdf( 1.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + pdf = factory( PINF, -1.0 ); + y = pdf( 2.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + pdf = factory( NINF, -1.0 ); + y = pdf( 2.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + pdf = factory( NaN, -1.0 ); + y = pdf( 2.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + pdf = factory( 1.0, NINF ); + y = pdf( 2.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + pdf = factory( PINF, NINF ); + y = pdf( 2.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + pdf = factory( NINF, NINF ); + y = pdf( 2.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + pdf = factory( NaN, NINF ); + y = pdf( 2.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if provided a non-positive `mu`, the created function always returns `NaN`', function test( t ) { + var pdf; + var y; + + pdf = factory( 0.0, 1.0 ); + y = pdf( 2.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + pdf = factory( 0.0, PINF ); + y = pdf( 2.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + pdf = factory( 0.0, NINF ); + y = pdf( 2.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + pdf = factory( 0.0, NaN ); + y = pdf( 2.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + pdf = factory( -1.0, 1.0 ); + y = pdf( 1.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + pdf = factory( -1.0, PINF ); + y = pdf( 2.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + pdf = factory( -1.0, NINF ); + y = pdf( 2.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + pdf = factory( -1.0, NaN ); + y = pdf( 2.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + pdf = factory( NINF, 1.0 ); + y = pdf( 2.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + pdf = factory( NINF, PINF ); + y = pdf( 2.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + pdf = factory( NINF, NINF ); + y = pdf( 2.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + pdf = factory( NINF, NaN ); + y = pdf( 2.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `lambda` equals `0`, the created function evaluates a degenerate distribution centered at `mu`', function test( t ) { + var pdf; + var y; + + pdf = factory( 2.0, 0.0 ); + + y = pdf( 2.0 ); + t.strictEqual( y, PINF, 'returns +infinity for x equal to mu' ); + + y = pdf( 1.0 ); + t.strictEqual( y, 0.0, 'returns expected value' ); + + y = pdf( PINF ); + t.strictEqual( y, 0.0, 'returns expected value' ); + + y = pdf( NINF ); + t.strictEqual( y, 0.0, 'returns expected value' ); + + y = pdf( NaN ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if provided a non-positive `x`, the created function returns `0` (outside support)', function test( t ) { + var pdf; + var y; + + pdf = factory( 1.0, 1.0 ); + + y = pdf( 0.0 ); + t.strictEqual( y, 0.0, 'returns 0 for x=0' ); + + y = pdf( -1.0 ); + t.strictEqual( y, 0.0, 'returns 0 for negative x' ); + + pdf = factory( 2.0, 3.0 ); + y = pdf( -10.0 ); + t.strictEqual( y, 0.0, 'returns 0 for negative x' ); + + pdf = factory( 1.0, 1.0 ); + y = pdf( NINF ); + t.strictEqual( y, 0.0, 'returns 0 for -infinity' ); + + t.end(); +}); + +tape( 'the created function evaluates the pdf for `x` given parameters `mu` and `lambda`', function test( t ) { + var expected; + var delta; + var lambda; + var pdf; + var tol; + var mu; + var x; + var y; + var i; + + expected = data.expected; + x = data.x; + mu = data.mu; + lambda = data.lambda; + for ( i = 0; i < x.length; i++ ) { + pdf = factory( mu[i], lambda[i] ); + y = pdf( x[i] ); + if ( y === expected[i] ) { + t.strictEqual( y, expected[i], 'x: '+x[i]+', mu: '+mu[i]+', lambda: '+lambda[i]+', y: '+y+', expected: '+expected[i] ); + } else { + delta = abs( y - expected[ i ] ); + tol = 5300.0 * EPS * abs( expected[ i ] ); + t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. mu: '+mu[i]+'. lambda: '+lambda[i]+'. y: '+y+'. E: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' ); + } + } + t.end(); +}); diff --git a/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/test/test.js b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/test/test.js new file mode 100644 index 000000000000..6518984d716e --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/test/test.js @@ -0,0 +1,38 @@ +/** +* @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 pdf = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof pdf, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'attached to the main export is a factory method for generating `pdf` functions', function test( t ) { + t.strictEqual( typeof pdf.factory, 'function', 'exports a factory method' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/test/test.native.js b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/test/test.native.js new file mode 100644 index 000000000000..3311af3000a2 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/test/test.native.js @@ -0,0 +1,232 @@ +/** +* @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 resolve = require( 'path' ).resolve; +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 tryRequire = require( '@stdlib/utils/try-require' ); + + +// FIXTURES // + +var data = require( './fixtures/r/data.json' ); + + +// VARIABLES // + +var pdf = tryRequire( resolve( __dirname, './../lib/native.js' ) ); +var opts = { + 'skip': ( pdf instanceof Error ) +}; + + +// TESTS // + +tape( 'main export is a function', opts, function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof pdf, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'if provided `NaN` for any parameter, the function returns `NaN`', opts, function test( t ) { + var y; + + y = pdf( NaN, 1.0, 1.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = pdf( 1.0, NaN, 1.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = pdf( 1.0, 1.0, NaN ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = pdf( 1.0, NaN, NaN ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = pdf( NaN, 1.0, NaN ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = pdf( NaN, NaN, 1.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = pdf( NaN, NaN, NaN ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if provided `+infinity` for `x` and finite `mu` and `lambda`, the function returns `0`', opts, function test( t ) { + var y = pdf( PINF, 1.0, 1.0 ); + t.strictEqual( y, 0.0, 'returns expected value' ); + t.end(); +}); + +tape( 'if provided `-infinity` for `x` and finite `mu` and `lambda`, the function returns `0`', opts, function test( t ) { + var y = pdf( NINF, 1.0, 1.0 ); + t.strictEqual( y, 0.0, 'returns expected value' ); + t.end(); +}); + +tape( 'if provided a negative `lambda`, the function always returns `NaN`', opts, function test( t ) { + var y; + + y = pdf( 2.0, 1.0, -1.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = pdf( 1.0, 1.0, -1.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = pdf( 2.0, PINF, -1.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = pdf( 2.0, NINF, -1.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = pdf( 2.0, NaN, -1.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = pdf( 2.0, 1.0, NINF ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = pdf( 2.0, PINF, NINF ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = pdf( 2.0, NINF, NINF ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = pdf( 2.0, NaN, NINF ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if provided a non-positive `mu`, the function always returns `NaN`', opts, function test( t ) { + var y; + + y = pdf( 2.0, 0.0, 1.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = pdf( 2.0, 0.0, PINF ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = pdf( 2.0, 0.0, NINF ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = pdf( 2.0, 0.0, NaN ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = pdf( 1.0, -1.0, 1.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = pdf( 2.0, -1.0, PINF ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = pdf( 2.0, -1.0, NINF ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = pdf( 2.0, -1.0, NaN ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = pdf( 2.0, NINF, 1.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = pdf( 2.0, NINF, PINF ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = pdf( 2.0, NINF, NINF ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = pdf( 2.0, NINF, NaN ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if provided `lambda` equals `0`, the function evaluates a degenerate distribution centered at `mu`', opts, function test( t ) { + var y; + + y = pdf( 2.0, 2.0, 0.0 ); + t.strictEqual( y, PINF, 'returns +infinity for x equal to mu' ); + + y = pdf( 1.0, 2.0, 0.0 ); + t.strictEqual( y, 0.0, 'returns expected value' ); + + y = pdf( PINF, 2.0, 0.0 ); + t.strictEqual( y, 0.0, 'returns expected value' ); + + y = pdf( NINF, 2.0, 0.0 ); + t.strictEqual( y, 0.0, 'returns expected value' ); + + y = pdf( NaN, 2.0, 0.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if provided a non-positive `x`, the function returns `0` (outside support)', opts, function test( t ) { + var y; + + y = pdf( 0.0, 1.0, 1.0 ); + t.strictEqual( y, 0.0, 'returns 0 for x=0' ); + + y = pdf( -1.0, 1.0, 1.0 ); + t.strictEqual( y, 0.0, 'returns 0 for negative x' ); + + y = pdf( -10.0, 2.0, 3.0 ); + t.strictEqual( y, 0.0, 'returns 0 for negative x' ); + + y = pdf( NINF, 1.0, 1.0 ); + t.strictEqual( y, 0.0, 'returns 0 for -infinity' ); + + t.end(); +}); + +tape( 'the function evaluates the pdf for `x` given parameters `mu` and `lambda`', opts, function test( t ) { + var expected; + var delta; + var lambda; + var tol; + var mu; + var x; + var y; + var i; + + expected = data.expected; + x = data.x; + mu = data.mu; + lambda = data.lambda; + for ( i = 0; i < x.length; i++ ) { + y = pdf( x[i], mu[i], lambda[i] ); + if ( y === expected[i] ) { + t.strictEqual( y, expected[i], 'x: '+x[i]+', mu:'+mu[i]+', lambda: '+lambda[i]+', y: '+y+', expected: '+expected[i] ); + } else { + delta = abs( y - expected[ i ] ); + tol = 5300.0 * EPS * abs( expected[ i ] ); + t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. mu: '+mu[i]+'. lambda: '+lambda[i]+'. y: '+y+'. E: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' ); + } + } + t.end(); +}); diff --git a/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/test/test.pdf.js b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/test/test.pdf.js new file mode 100644 index 000000000000..3d0c18056b89 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/test/test.pdf.js @@ -0,0 +1,223 @@ +/** +* @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 PINF = require( '@stdlib/constants/float64/pinf' ); +var NINF = require( '@stdlib/constants/float64/ninf' ); +var EPS = require( '@stdlib/constants/float64/eps' ); +var pdf = require( './../lib' ); + + +// FIXTURES // + +var data = require( './fixtures/r/data.json' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof pdf, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'if provided `NaN` for any parameter, the function returns `NaN`', function test( t ) { + var y; + + y = pdf( NaN, 1.0, 1.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = pdf( 1.0, NaN, 1.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = pdf( 1.0, 1.0, NaN ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = pdf( 1.0, NaN, NaN ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = pdf( NaN, 1.0, NaN ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = pdf( NaN, NaN, 1.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = pdf( NaN, NaN, NaN ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if provided `+infinity` for `x` and finite `mu` and `lambda`, the function returns `0`', function test( t ) { + var y = pdf( PINF, 1.0, 1.0 ); + t.strictEqual( y, 0.0, 'returns expected value' ); + t.end(); +}); + +tape( 'if provided `-infinity` for `x` and finite `mu` and `lambda`, the function returns `0`', function test( t ) { + var y = pdf( NINF, 1.0, 1.0 ); + t.strictEqual( y, 0.0, 'returns expected value' ); + t.end(); +}); + +tape( 'if provided a negative `lambda`, the function always returns `NaN`', function test( t ) { + var y; + + y = pdf( 2.0, 1.0, -1.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = pdf( 1.0, 1.0, -1.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = pdf( 2.0, PINF, -1.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = pdf( 2.0, NINF, -1.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = pdf( 2.0, NaN, -1.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = pdf( 2.0, 1.0, NINF ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = pdf( 2.0, PINF, NINF ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = pdf( 2.0, NINF, NINF ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = pdf( 2.0, NaN, NINF ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if provided a non-positive `mu`, the function always returns `NaN`', function test( t ) { + var y; + + y = pdf( 2.0, 0.0, 1.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = pdf( 2.0, 0.0, PINF ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = pdf( 2.0, 0.0, NINF ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = pdf( 2.0, 0.0, NaN ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = pdf( 1.0, -1.0, 1.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = pdf( 2.0, -1.0, PINF ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = pdf( 2.0, -1.0, NINF ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = pdf( 2.0, -1.0, NaN ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = pdf( 2.0, NINF, 1.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = pdf( 2.0, NINF, PINF ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = pdf( 2.0, NINF, NINF ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = pdf( 2.0, NINF, NaN ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if provided `lambda` equals `0`, the function evaluates a degenerate distribution centered at `mu`', function test( t ) { + var y; + + y = pdf( 2.0, 2.0, 0.0 ); + t.strictEqual( y, PINF, 'returns +infinity for x equal to mu' ); + + y = pdf( 1.0, 2.0, 0.0 ); + t.strictEqual( y, 0.0, 'returns expected value' ); + + y = pdf( PINF, 2.0, 0.0 ); + t.strictEqual( y, 0.0, 'returns expected value' ); + + y = pdf( NINF, 2.0, 0.0 ); + t.strictEqual( y, 0.0, 'returns expected value' ); + + y = pdf( NaN, 2.0, 0.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if provided a non-positive `x`, the function returns `0` (outside support)', function test( t ) { + var y; + + y = pdf( 0.0, 1.0, 1.0 ); + t.strictEqual( y, 0.0, 'returns 0 for x=0' ); + + y = pdf( -1.0, 1.0, 1.0 ); + t.strictEqual( y, 0.0, 'returns 0 for negative x' ); + + y = pdf( -10.0, 2.0, 3.0 ); + t.strictEqual( y, 0.0, 'returns 0 for negative x' ); + + y = pdf( NINF, 1.0, 1.0 ); + t.strictEqual( y, 0.0, 'returns 0 for -infinity' ); + + t.end(); +}); + +tape( 'the function evaluates the pdf for `x` given parameters `mu` and `lambda`', function test( t ) { + var expected; + var delta; + var lambda; + var tol; + var mu; + var x; + var y; + var i; + + expected = data.expected; + x = data.x; + mu = data.mu; + lambda = data.lambda; + for ( i = 0; i < x.length; i++ ) { + y = pdf( x[i], mu[i], lambda[i] ); + if ( y === expected[i] ) { + t.strictEqual( y, expected[i], 'x: '+x[i]+', mu:'+mu[i]+', lambda: '+lambda[i]+', y: '+y+', expected: '+expected[i] ); + } else { + delta = abs( y - expected[ i ] ); + tol = 5300.0 * EPS * abs( expected[ i ] ); + t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. mu: '+mu[i]+'. lambda: '+lambda[i]+'. y: '+y+'. E: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' ); + } + } + t.end(); +}); From e368f2378cc91f5ed31104a39bad0f60756a3b80 Mon Sep 17 00:00:00 2001 From: manit2004 Date: Thu, 25 Dec 2025 20:44:53 +0530 Subject: [PATCH 9/9] feat: add tests for Wald distribution PDF with infinity handling fixes --- .../@stdlib/stats/base/dists/wald/pdf/docs/repl.txt | 2 +- lib/node_modules/@stdlib/stats/base/dists/wald/pdf/package.json | 1 - .../@stdlib/stats/base/dists/wald/pdf/test/test.factory.js | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/docs/repl.txt b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/docs/repl.txt index 4f07c262ae7f..acefed09364f 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/docs/repl.txt +++ b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/docs/repl.txt @@ -49,7 +49,7 @@ > y = {{alias}}( 2.0, 1.0, 0.0 ) 0.0 > y = {{alias}}( 1.0, 1.0, 0.0 ) - infinity + Infinity // Outside support (x <= 0): > y = {{alias}}( 0.0, 1.0, 1.0 ) diff --git a/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/package.json b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/package.json index 4d5b87e5fe0d..2a6db4369493 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/package.json +++ b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/package.json @@ -16,7 +16,6 @@ "main": "./lib", "gypfile": true, "directories": { - "benchmark": "./benchmark", "doc": "./docs", "example": "./examples", "include": "./include", diff --git a/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/test/test.factory.js b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/test/test.factory.js index a51484f8c36b..ce8ce7ace217 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/test/test.factory.js +++ b/lib/node_modules/@stdlib/stats/base/dists/wald/pdf/test/test.factory.js @@ -243,8 +243,8 @@ tape( 'if provided a non-positive `x`, the created function returns `0` (outside tape( 'the created function evaluates the pdf for `x` given parameters `mu` and `lambda`', function test( t ) { var expected; - var delta; var lambda; + var delta; var pdf; var tol; var mu;