diff --git a/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/README.md new file mode 100644 index 000000000000..ee0e6e61c932 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/README.md @@ -0,0 +1,264 @@ + + +# Logarithm of Cumulative Distribution Function + +> [Log-logistic][log-logistic-distribution] distribution logarithm of [cumulative distribution function (CDF)][cdf]. + +
+ +The [cumulative distribution function][cdf] (CDF) for a [log-logistic][log-logistic-distribution] random variable is + + + +```math +\ln F(x;\alpha,\beta) = -\ln\left(1+\left(\frac{x}{\alpha}\right)^{-\beta}\right) +``` + + + + + +where `alpha` is the scale parameter and `beta` is the shape parameter. + +
+ + + +
+ +## Usage + +```javascript +var logcdf = require( '@stdlib/stats/base/dists/log-logistic/logcdf' ); +``` + +#### logcdf( x, alpha, beta ) + +Evaluates the natural logarithm of the [cumulative distribution function][cdf] (CDF) for a [log-logistic][log-logistic-distribution] distribution with parameters `alpha` (scale parameter) and `beta` (shape parameter). + +```javascript +var y = logcdf( 2.0, 1.0, 1.0 ); +// returns ~-0.405 + +y = logcdf( 4.0, 2.0, 3.0 ); +// returns ~-0.118 +``` + +If provided a value `x <= 0`, the function returns `-Infinity`. + +```javascript +var y = logcdf( -1.0, 1.0, 1.0 ); +// returns -Infinity + +y = logcdf( 0.0, 1.0, 1.0 ); +// returns -Infinity +``` + +If provided `NaN` as any argument, the function returns `NaN`. + +```javascript +var y = logcdf( NaN, 1.0, 1.0 ); +// returns NaN + +y = logcdf( 1.0, NaN, 1.0 ); +// returns NaN + +y = logcdf( 1.0, 1.0, NaN ); +// returns NaN +``` + +If provided `alpha <= 0`, the function returns `NaN`. + +```javascript +var y = logcdf( 2.0, -1.0, 1.0 ); +// returns NaN +``` + +If provided `beta <= 0`, the function returns `NaN`. + +```javascript +var y = logcdf( 2.0, 1.0, -1.0 ); +// returns NaN +``` + +#### logcdf.factory( alpha, beta ) + +Returns a function for evaluating the natural logarithm of the [cumulative distribution function][cdf] (CDF) of a [log-logistic][log-logistic-distribution] distribution with parameters `alpha` (scale parameter) and `beta` (shape parameter). + +```javascript +var mylogcdf = logcdf.factory( 1.0, 1.0 ); + +var y = mylogcdf( 2.0 ); +// returns ~-0.405 + +y = mylogcdf( -1.0 ); +// returns -Infinity +``` + +
+ + + +
+ +## Examples + + + +```javascript +var uniform = require( '@stdlib/random/array/uniform' ); +var logEachMap = require( '@stdlib/console/log-each-map' ); +var logcdf = require( '@stdlib/stats/base/dists/log-logistic/logcdf' ); + +var opts = { + 'dtype': 'float64' +}; +var x = uniform( 10, 0.1, 10.0, opts ); +var alpha = uniform( 10, 0.1, 10.0, opts ); +var beta = uniform( 10, 0.1, 10.0, opts ); + +logEachMap( 'x: %0.4f, alpha: %0.4f, beta: %0.4f, ln(F(x;α,β)): %0.4f', x, alpha, beta, logcdf ); +``` + +
+ + + + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/stats/base/dists/log-logistic/logcdf.h" +``` + +#### stdlib_base_dists_log_logistic_logcdf( x, alpha, beta ) + +Evaluates the natural logarithm of the [cumulative distribution function][cdf] (CDF) for a [log-logistic][log-logistic-distribution] distribution with parameters `alpha` (scale parameter) and `beta` (shape parameter). + +```c +double out = stdlib_base_dists_log_logistic_logcdf( 2.0, 1.0, 1.0 ); +// returns ~-0.405 +``` + +The function accepts the following arguments: + +- **x**: `[in] double` input parameter. +- **alpha**: `[in] double` scale parameter. +- **beta**: `[in] double` shape parameter. + +```c +double stdlib_base_dists_log_logistic_logcdf( const double x, const double alpha, const double beta ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/stats/base/dists/log-logistic/logcdf.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 alpha; + double beta; + double x; + double y; + int i; + + for ( i = 0; i < 25; i++ ) { + x = random_uniform( 0.1, 10.0 ); + alpha = random_uniform( 0.1, 10.0 ); + beta = random_uniform( 0.1, 10.0 ); + y = stdlib_base_dists_log_logistic_logcdf( x, alpha, beta ); + printf( "x: %lf, alpha: %lf, beta: %lf, ln(F(x;α,β)): %lf\n", x, alpha, beta, y ); + } +} +``` + +
+ + + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/benchmark/benchmark.js b/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/benchmark/benchmark.js new file mode 100644 index 000000000000..43e81ca64596 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/benchmark/benchmark.js @@ -0,0 +1,95 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var EPS = require( '@stdlib/constants/float64/eps' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var logcdf = require( './../lib' ); + + +// MAIN // + +bench( pkg, function benchmark( b ) { + var alpha; + var beta; + var opts; + var x; + var y; + var i; + + opts = { + 'dtype': 'float64' + }; + x = uniform( 100, EPS, 20.0, opts ); + alpha = uniform( 100, EPS, 5.0, opts ); + beta = uniform( 100, EPS, 5.0, opts ); + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + y = logcdf( x[ i % x.length ], alpha[ i % alpha.length ], beta[ i % beta.length ] ); + if ( isnan( y ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( y ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); +}); + +bench( format( '%s::factory', pkg ), function benchmark( b ) { + var mylogcdf; + var alpha; + var beta; + var opts; + var x; + var y; + var i; + + alpha = 2.0; + beta = 3.0; + mylogcdf = logcdf.factory( alpha, beta ); + + opts = { + 'dtype': 'float64' + }; + x = uniform( 100, EPS, 20.0, opts ); + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + y = mylogcdf( x[ i % x.length ] ); + if ( isnan( y ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( y ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); +}); diff --git a/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/benchmark/benchmark.native.js new file mode 100644 index 000000000000..add3d012eca9 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/benchmark/benchmark.native.js @@ -0,0 +1,71 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var EPS = require( '@stdlib/constants/float64/eps' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var logcdf = tryRequire( resolve( __dirname, './../lib/native.js' ) ); +var opts = { + 'skip': ( logcdf instanceof Error ) +}; + + +// MAIN // + +bench( format( '%s::native', pkg ), opts, function benchmark( b ) { + var arrayOpts; + var alpha; + var beta; + var x; + var y; + var i; + + arrayOpts = { + 'dtype': 'float64' + }; + x = uniform( 100, EPS, 20.0, arrayOpts ); + alpha = uniform( 100, EPS, 5.0, arrayOpts ); + beta = uniform( 100, EPS, 5.0, arrayOpts ); + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + y = logcdf( x[ i % x.length ], alpha[ i % alpha.length ], beta[ i % beta.length ] ); + if ( isnan( y ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( y ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); +}); diff --git a/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/benchmark/c/Makefile b/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/benchmark/c/Makefile new file mode 100644 index 000000000000..979768abbcec --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/benchmark/c/Makefile @@ -0,0 +1,146 @@ +#/ +# @license Apache-2.0 +# +# Copyright (c) 2026 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#/ + +# 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 := benchmark.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 benchmarks. +# +# @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/log-logistic/logcdf/benchmark/c/benchmark.c b/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/benchmark/c/benchmark.c new file mode 100644 index 000000000000..f1d71f4144f2 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/benchmark/c/benchmark.c @@ -0,0 +1,141 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include "stdlib/stats/base/dists/log-logistic/logcdf.h" +#include "stdlib/constants/float64/eps.h" +#include +#include +#include +#include +#include + +#define NAME "log-logistic-logcdf" +#define ITERATIONS 1000000 +#define REPEATS 3 + +/** +* Prints the TAP version. +*/ +static void print_version( void ) { + printf( "TAP version 13\n" ); +} + +/** +* Prints the TAP summary. +* +* @param total total number of tests +* @param passing total number of passing tests +*/ +static void print_summary( int total, int passing ) { + printf( "#\n" ); + printf( "1..%d\n", total ); + printf( "# total %d\n", total ); + printf( "# pass %d\n", passing ); + printf( "#\n" ); + printf( "# ok\n" ); +} + +/** +* Prints benchmark results. +* +* @param elapsed elapsed time in seconds +*/ +static void print_results( double elapsed ) { + double rate = (double)ITERATIONS / elapsed; + printf( " ---\n" ); + printf( " iterations: %d\n", ITERATIONS ); + printf( " elapsed: %0.9f\n", elapsed ); + printf( " rate: %0.9f\n", rate ); + printf( " ...\n" ); +} + +/** +* Returns a clock time. +* +* @return clock time +*/ +static double tic( void ) { + struct timeval now; + gettimeofday( &now, NULL ); + return (double)now.tv_sec + (double)now.tv_usec/1.0e6; +} + +/** +* Generates a random number on the interval [min,max). +* +* @param min minimum value (inclusive) +* @param max maximum value (exclusive) +* @return random number +*/ +static double random_uniform( const double min, const double max ) { + double v = (double)rand() / ( (double)RAND_MAX + 1.0 ); + return min + ( v*(max-min) ); +} + +/** +* Runs a benchmark. +* +* @return elapsed time in seconds +*/ +static double benchmark( void ) { + double alpha[ 100 ]; + double beta[ 100 ]; + double x[ 100 ]; + double elapsed; + double y; + double t; + int i; + + for ( i = 0; i < 100; i++ ) { + x[ i ] = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 20.0 ); + alpha[ i ] = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 5.0 ); + beta[ i ] = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 5.0 ); + } + t = tic(); + for ( i = 0; i < ITERATIONS; i++ ) { + y = stdlib_base_dists_log_logistic_logcdf( x[ i%100 ], alpha[ i%100 ], beta[ i%100 ] ); + if ( y != y ) { + printf( "should not return NaN\n" ); + break; + } + } + elapsed = tic() - t; + if ( y != y ) { + printf( "should not return NaN\n" ); + } + return elapsed; +} + +/** +* Main execution sequence. +*/ +int main( void ) { + double elapsed; + int i; + + srand( time( NULL ) ); + + print_version(); + for ( i = 0; i < REPEATS; i++ ) { + printf( "# c::%s\n", NAME ); + elapsed = benchmark(); + print_results( elapsed ); + printf( "ok %d benchmark finished\n", i+1 ); + } + print_summary( REPEATS, REPEATS ); +} diff --git a/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/binding.gyp b/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/binding.gyp new file mode 100644 index 000000000000..0d6508a12e99 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/binding.gyp @@ -0,0 +1,170 @@ +# @license Apache-2.0 +# +# Copyright (c) 2026 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# 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 +} diff --git a/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/docs/img/equation_log_logistic_logcdf.svg b/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/docs/img/equation_log_logistic_logcdf.svg new file mode 100644 index 000000000000..23d371b30532 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/docs/img/equation_log_logistic_logcdf.svg @@ -0,0 +1,62 @@ + +ln upper F left-parenthesis x semicolon alpha comma beta right-parenthesis equals minus ln left-parenthesis 1 plus left-parenthesis StartFraction x Over alpha EndFraction right-parenthesis Superscript negative beta Baseline right-parenthesis + + + \ No newline at end of file diff --git a/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/docs/repl.txt b/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/docs/repl.txt new file mode 100644 index 000000000000..fffbfc4731b4 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/docs/repl.txt @@ -0,0 +1,75 @@ + +{{alias}}( x, alpha, beta ) + Evaluates the natural logarithm of the cumulative distribution function + (CDF) for a log-logistic distribution with scale parameter `alpha` and + shape parameter `beta` at a value `x`. + + If provided `alpha <= 0` or `beta <= 0`, the function returns `NaN`. + + If `x <= 0`, the function returns `-Infinity`. + + Parameters + ---------- + x: number + Input value. + + alpha: number + Scale parameter. + + beta: number + Shape parameter. + + Returns + ------- + out: number + Evaluated logCDF. + + Examples + -------- + > var y = {{alias}}( 2.0, 1.0, 1.0 ) + ~-0.405 + > y = {{alias}}( 4.0, 2.0, 3.0 ) + ~-0.118 + > y = {{alias}}( -1.0, 1.0, 1.0 ) + -Infinity + > y = {{alias}}( 0.0, 1.0, 1.0 ) + -Infinity + > y = {{alias}}( NaN, 1.0, 1.0 ) + NaN + > y = {{alias}}( 1.0, NaN, 1.0 ) + NaN + > y = {{alias}}( 1.0, 1.0, NaN ) + NaN + > y = {{alias}}( 1.0, -1.0, 1.0 ) + NaN + > y = {{alias}}( 1.0, 1.0, -1.0 ) + NaN + + +{{alias}}.factory( alpha, beta ) + Returns a function for evaluating the natural logarithm of the cumulative + distribution function (CDF) of a log-logistic distribution with scale + parameter `alpha` and shape parameter `beta`. + + Parameters + ---------- + alpha: number + Scale parameter. + + beta: number + Shape parameter. + + Returns + ------- + logcdf: Function + Logarithm of cumulative distribution function (CDF). + + Examples + -------- + > var mylogcdf = {{alias}}.factory( 1.0, 1.0 ); + > var y = mylogcdf( 2.0 ) + ~-0.405 + + See Also + -------- + diff --git a/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/docs/types/index.d.ts b/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/docs/types/index.d.ts new file mode 100644 index 000000000000..e4548cdb2ad8 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/docs/types/index.d.ts @@ -0,0 +1,122 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// TypeScript Version: 4.1 + +/** +* Evaluates the natural logarithm of the cumulative distribution function (CDF) for a log-logistic distribution. +* +* @param x - input value +* @returns evaluated logCDF +*/ +type Unary = ( x: number ) => number; + +/** +* Interface for the natural logarithm of the cumulative distribution function (CDF) of a log-logistic distribution. +*/ +interface LogCDF { + /** + * Evaluates the natural logarithm of the cumulative distribution function (CDF) for a log-logistic distribution with scale parameter `alpha` and shape parameter `beta` at a value `x`. + * + * ## Notes + * + * - If provided `alpha <= 0` or `beta <= 0`, the function returns `NaN`. + * + * @param x - input value + * @param alpha - scale parameter + * @param beta - shape parameter + * @returns evaluated logCDF + * + * @example + * var y = logcdf( 2.0, 1.0, 1.0 ); + * // returns ~-0.405 + * + * @example + * var y = logcdf( 4.0, 2.0, 3.0 ); + * // returns ~-0.118 + * + * @example + * var y = logcdf( -1.0, 1.0, 1.0 ); + * // returns -Infinity + * + * @example + * var y = logcdf( 0.0, 1.0, 1.0 ); + * // returns -Infinity + * + * @example + * var y = logcdf( NaN, 1.0, 1.0 ); + * // returns NaN + * + * @example + * var y = logcdf( 1.0, NaN, 1.0 ); + * // returns NaN + * + * @example + * var y = logcdf( 1.0, 1.0, NaN ); + * // returns NaN + * + * @example + * var y = logcdf( 1.0, -1.0, 1.0 ); + * // returns NaN + * + * @example + * var y = logcdf( 1.0, 1.0, -1.0 ); + * // returns NaN + */ + ( x: number, alpha: number, beta: number ): number; + + /** + * Returns a function for evaluating the natural logarithm of the cumulative distribution function (CDF) for a log-logistic distribution. + * + * @param alpha - scale parameter + * @param beta - shape parameter + * @returns logCDF + * + * @example + * var mylogcdf = logcdf.factory( 1.0, 1.0 ); + * var y = mylogcdf( 2.0 ); + * // returns ~-0.405 + * + * y = mylogcdf( -1.0 ); + * // returns -Infinity + */ + factory( alpha: number, beta: number ): Unary; +} + +/** +* Log-logistic distribution natural logarithm of the cumulative distribution function (CDF). +* +* @param x - input value +* @param alpha - scale parameter +* @param beta - shape parameter +* @returns evaluated logCDF +* +* @example +* var y = logcdf( 2.0, 1.0, 1.0 ); +* // returns ~-0.405 +* +* var mylogcdf = logcdf.factory( 1.0, 1.0 ); +* y = mylogcdf( 2.0 ); +* // returns ~-0.405 +*/ +declare var logcdf: LogCDF; + + +// EXPORTS // + +export = logcdf; diff --git a/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/docs/types/test.ts b/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/docs/types/test.ts new file mode 100644 index 000000000000..784bffdc827a --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/docs/types/test.ts @@ -0,0 +1,119 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +import logcdf = require( './index' ); + + +// TESTS // + +// The function returns a number... +{ + logcdf( 2, 2, 4 ); // $ExpectType number + logcdf( 1, 2, 8 ); // $ExpectType number +} + +// The compiler throws an error if the function is provided values other than three numbers... +{ + logcdf( true, 3, 6 ); // $ExpectError + logcdf( false, 2, 4 ); // $ExpectError + logcdf( '5', 1, 2 ); // $ExpectError + logcdf( [], 1, 2 ); // $ExpectError + logcdf( {}, 2, 4 ); // $ExpectError + logcdf( ( x: number ): number => x, 2, 4 ); // $ExpectError + + logcdf( 9, true, 12 ); // $ExpectError + logcdf( 9, false, 12 ); // $ExpectError + logcdf( 5, '5', 10 ); // $ExpectError + logcdf( 8, [], 16 ); // $ExpectError + logcdf( 9, {}, 18 ); // $ExpectError + logcdf( 8, ( x: number ): number => x, 16 ); // $ExpectError + + logcdf( 9, 5, true ); // $ExpectError + logcdf( 9, 5, false ); // $ExpectError + logcdf( 5, 2, '5' ); // $ExpectError + logcdf( 8, 4, [] ); // $ExpectError + logcdf( 9, 4, {} ); // $ExpectError + logcdf( 8, 5, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + logcdf(); // $ExpectError + logcdf( 2 ); // $ExpectError + logcdf( 2, 0 ); // $ExpectError + logcdf( 2, 0, 4, 1 ); // $ExpectError +} + +// Attached to main export is a `factory` method which returns a function... +{ + logcdf.factory( 3, 4 ); // $ExpectType Unary +} + +// The `factory` method returns a function which returns a number... +{ + const fcn = logcdf.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 = logcdf.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 = logcdf.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... +{ + logcdf.factory( true, 3 ); // $ExpectError + logcdf.factory( false, 2 ); // $ExpectError + logcdf.factory( '5', 1 ); // $ExpectError + logcdf.factory( [], 1 ); // $ExpectError + logcdf.factory( {}, 2 ); // $ExpectError + logcdf.factory( ( x: number ): number => x, 2 ); // $ExpectError + + logcdf.factory( 9, true ); // $ExpectError + logcdf.factory( 9, false ); // $ExpectError + logcdf.factory( 5, '5' ); // $ExpectError + logcdf.factory( 8, [] ); // $ExpectError + logcdf.factory( 9, {} ); // $ExpectError + logcdf.factory( 8, ( x: number ): number => x ); // $ExpectError + + logcdf.factory( [], true ); // $ExpectError + logcdf.factory( {}, false ); // $ExpectError + logcdf.factory( false, '5' ); // $ExpectError + logcdf.factory( {}, [] ); // $ExpectError + logcdf.factory( '5', ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the `factory` method is provided an unsupported number of arguments... +{ + logcdf.factory( 0 ); // $ExpectError + logcdf.factory( 0, 4, 8 ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/examples/c/Makefile b/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/examples/c/Makefile new file mode 100644 index 000000000000..c8f8e9a1517b --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/examples/c/Makefile @@ -0,0 +1,146 @@ +#/ +# @license Apache-2.0 +# +# Copyright (c) 2026 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#/ + +# 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/log-logistic/logcdf/examples/c/example.c b/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/examples/c/example.c new file mode 100644 index 000000000000..bb33632ce18c --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/examples/c/example.c @@ -0,0 +1,42 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include "stdlib/stats/base/dists/log-logistic/logcdf.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 alpha; + double beta; + double x; + double y; + int i; + + for ( i = 0; i < 25; i++ ) { + x = random_uniform( 0.1, 10.0 ); + alpha = random_uniform( 0.1, 10.0 ); + beta = random_uniform( 0.1, 10.0 ); + y = stdlib_base_dists_log_logistic_logcdf( x, alpha, beta ); + printf( "x: %lf, alpha: %lf, beta: %lf, ln(F(x;α,β)): %lf\n", x, alpha, beta, y ); + } +} diff --git a/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/examples/index.js b/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/examples/index.js new file mode 100644 index 000000000000..b6ea9be82368 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/examples/index.js @@ -0,0 +1,32 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +var uniform = require( '@stdlib/random/array/uniform' ); +var logEachMap = require( '@stdlib/console/log-each-map' ); +var logcdf = require( './../lib' ); + +var opts = { + 'dtype': 'float64' +}; +var x = uniform( 10, 0.1, 10.0, opts ); +var alpha = uniform( 10, 0.1, 10.0, opts ); +var beta = uniform( 10, 0.1, 10.0, opts ); + +logEachMap( 'x: %0.4f, alpha: %0.4f, beta: %0.4f, ln(F(x;α,β)): %0.4f', x, alpha, beta, logcdf ); diff --git a/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/include.gypi b/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/include.gypi new file mode 100644 index 000000000000..bee8d41a2caf --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/include.gypi @@ -0,0 +1,53 @@ +# @license Apache-2.0 +# +# Copyright (c) 2026 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# 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': [ + '=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "stdmath", + "statistics", + "stats", + "distribution", + "dist", + "probability", + "logcdf", + "cumulative distribution", + "distribution function", + "logarithm", + "log-logistic", + "univariate", + "continuous" + ] +} diff --git a/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/src/Makefile b/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/src/Makefile new file mode 100644 index 000000000000..2caf905cedbe --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/src/Makefile @@ -0,0 +1,70 @@ +#/ +# @license Apache-2.0 +# +# Copyright (c) 2026 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#/ + +# 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/log-logistic/logcdf/src/addon.c b/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/src/addon.c new file mode 100644 index 000000000000..411b6be406c1 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/src/addon.c @@ -0,0 +1,22 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include "stdlib/stats/base/dists/log-logistic/logcdf.h" +#include "stdlib/math/base/napi/ternary.h" + +STDLIB_MATH_BASE_NAPI_MODULE_DDD_D( stdlib_base_dists_log_logistic_logcdf ) diff --git a/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/src/main.c b/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/src/main.c new file mode 100644 index 000000000000..a65731a209ee --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/src/main.c @@ -0,0 +1,61 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include "stdlib/stats/base/dists/log-logistic/logcdf.h" +#include "stdlib/math/base/assert/is_nan.h" +#include "stdlib/math/base/special/log1p.h" +#include "stdlib/math/base/special/ln.h" +#include "stdlib/math/base/special/pow.h" +#include "stdlib/constants/float64/ninf.h" + +/** +* Evaluates the natural logarithm of the cumulative distribution function (CDF) for a log-logistic distribution +* with scale parameter `alpha` and shape parameter `beta` at a value `x`. +* +* @param x input value +* @param alpha scale parameter +* @param beta shape parameter +* @return evaluated logCDF +* +* @example +* double y = stdlib_base_dists_log_logistic_logcdf( 2.0, 1.0, 1.0 ); +* // returns ~-0.405 +*/ +double stdlib_base_dists_log_logistic_logcdf( const double x, const double alpha, const double beta ) { + double base; + double xb; + if ( + stdlib_base_is_nan( x ) || + stdlib_base_is_nan( alpha ) || + stdlib_base_is_nan( beta ) || + alpha <= 0.0 || + beta <= 0.0 + ) { + return 0.0 / 0.0; // NaN + } + if ( x <= 0.0 ) { + return STDLIB_CONSTANT_FLOAT64_NINF; + } + // Select the algebraically equivalent form which keeps the intermediate power bounded, thus avoiding overflow to infinity as `x` grows large, while preserving accuracy in the lower tail... + if ( x <= alpha ) { + base = x / alpha; + xb = stdlib_base_pow( base, beta ); + return ( beta * stdlib_base_ln( base ) ) - stdlib_base_log1p( xb ); + } + return -stdlib_base_log1p( stdlib_base_pow( alpha / x, beta ) ); +} diff --git a/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/test/fixtures/julia/REQUIRE b/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/test/fixtures/julia/REQUIRE new file mode 100644 index 000000000000..98be20b58ed3 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/test/fixtures/julia/REQUIRE @@ -0,0 +1,3 @@ +Distributions 0.23.8 +julia 1.5 +JSON 0.21 diff --git a/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/test/fixtures/julia/data.json b/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/test/fixtures/julia/data.json new file mode 100644 index 000000000000..328d4e6266a3 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/test/fixtures/julia/data.json @@ -0,0 +1 @@ +{"x":[10.356623663790524,9.357682333318516,10.811533685298636,3.451434585256502,9.918400803105905,4.516826072465628,11.339457550309598,0.2952754795458168,4.099289699913934,14.884650831334293,12.738896412299946,14.796060869228095,3.2688799647055564,13.192186997728422,9.74733505117707,8.674285116828978,9.151271492699161,5.1327894565090535,3.7479258894361553,4.193358527952805,5.275933150658384,9.921377695389092,11.034397133151069,13.960607652077451,14.318107043616473,12.857639747196808,14.357281478112563,1.658561143083498,2.335018433621153,2.0886608639173208,12.094343645256012,1.4740462258830667,4.906825462346896,1.5431983275245875,9.095827448870986,6.054692652067169,13.77706087612547,0.7902113168872893,7.689149011382833,8.957224360890686,9.961678329380229,3.6075220263935623,9.656908107679337,0.5901152344793081,0.29989924816414715,5.0336583431251345,8.912328599942848,4.261505244756117,0.6336984033603221,6.790318799428642,8.803296911753714,11.628495411239564,4.095842949571088,4.415978858703747,9.884978914158419,3.6573803943954406,8.474541846187785,6.40336367836222,1.6060360341705382,0.9533498000726104,6.988373333113268,5.369514438314363,7.903823647173121,3.6884369661472736,5.5086942186951635,2.0580800978839395,7.764950808594003,3.140083846626803,0.471737965233624,11.532929697530344,2.8331533884536473,7.629359422242269,7.428471183627844,7.311204736577347,2.7351274604350326,3.0578817364200948,8.919018811536953,13.827114105913788,7.454633527193218,4.788253369731828,4.052085559340194,4.2204128457140175,12.806014236519113,9.718106342004612,7.550733070345595,9.50641000945121,8.423029257208109,2.288910963796079,14.018370490046218,0.329166318513453,13.103557294923812,8.870231772996485,6.71551368384622,8.619378925757482,8.966078472547233,8.30210578231141,5.877705368436873,4.873346597412601,6.966371584674343,10.39166737766005,6.855328267663717,13.409924538098275,8.382744657099247,5.875350773092359,3.049558307500556,4.354010697677731,9.835119823217392,2.032365442244336,6.037479460462928,10.718386639598757,5.025474015381187,6.0029081716109065,6.634356695683673,3.868330444199964,0.26666499859653414,0.7401910454407334,5.735576418917626,3.539212389839813,4.042083263155073,0.8932207228988409,11.831343174669891,7.676655264329165,11.601337776044383,2.402946759937331,1.6387920717149973,10.162058621169999,5.811270651863888,0.9642073856573552,13.27844995142892,13.287016158681363,11.592972570322454,4.115544651392847,4.404809061195701,3.148228063471615,12.693670980622992,3.6687640352081505,12.300983783314004,14.187530413726344,5.234355872487649,0.5122694263607264,4.362911678142845,6.284195401929319,5.691356518762186,13.106079207025468,8.985124943535775,14.77023856899701,3.087607296872884,0.58894422323443,10.936482904469594,6.284000550620258,10.664389431001618,10.707937490185722,4.106504719927907,14.39300679787062,11.622651481991634,10.692814046740532,9.994685223316774,6.11953573253937,11.530220044767484,12.802338981525972,11.90141821116209,0.6949502678960562,8.885145976198837,11.823707529800012,9.705675235707313,6.880187979657203,14.883542708810419,14.460720530003309,9.786332648470998,5.789690460767597,8.59158046961762,0.9800582455843687,2.8305992269795386,7.51676350784488,1.0966987495683134,2.833044172255322,7.141939571117982,5.498734914688393,1.875919716656208,10.804258780078962,3.0234954256936906,11.710247172266245,10.565576672777533,7.806628491487354,2.2661019612476228,2.245673062968999,3.3857527696434406,13.86620121145621,5.724604909298941,6.909396443041041,6.820629629762843,2.922281713215634,2.3310614454001186,0.4085167795326561,14.921511511309072,13.36475860745646,10.51694732228294,2.5867937896307556,5.666349948840216,10.062126630907878,7.683739886377007,2.1396520147006957,1.145774813592434,9.571582582537085,4.852987436568364,4.87367835314013,12.718310954039916,3.6202064861916003,0.04247464657761157,7.253767790496349,2.0089234209060667,8.268745954371989,0.01738820410333574,11.208836723342538,14.41874224412255,2.1685020259954033,2.0913046174589542,14.036906670769676,2.003319388711825,14.225581289026886,11.231179021522403,1.2596138515416533,1.3907864382397384,3.690086437379941,10.756918440563604,6.642357637863606,5.601719765216112,12.107079618833959,4.761627353252843,2.5457764679938553,11.47392573369667,10.732060143016279,0.49797743278555573,5.90300942607224,2.495812676604837,3.5722431931551544,6.861693820208311,9.880633183745667,10.976158964438364,5.332095656301826,0.844905767114833,8.233750020842999,13.428228732189163,5.246511081457138,9.216960527226329,2.0741597104258833,7.62673353263177,9.859973573582247,9.416876035500318,10.437939496003091,9.186952744601294,11.670991380922496,4.702862940719351,0.1170936385076493,4.096532979272306,7.39796966150403,2.487933069458231,8.042644364284351,0.6691513112653047,1.2953066145908088,3.8259496872685848,1.5969224781636149,6.991951270718127,14.318308911276981,0.3641170561220497,13.309525522161275,8.897307901168242,11.30792703781277,2.9733009049575774,0.4211712391022593,2.782256879834458,13.795667946795001,6.583891278821975,4.52034084893763,13.405809798967093,13.177132439557463,3.8355767710506914,5.2958928334899245,5.242992728706449,1.2991346402466297,0.7909668651316315,3.015429167533293,2.041675225589424,2.6736707491707055,5.0794343051873145,0.38917117937467993,11.425613645222038,8.046786037264392,12.083893172200769,0.3283214017190039,9.723475436437875,3.383930746456608,1.931176774194464,14.532273484617471,3.1139773789234457,14.218293608389795,1.2562478748057038,9.501155974101275,2.0169176086690275,2.435891910679638,2.322822635285556,4.163533858479932,6.914249645303935,4.172306966027245,13.162924722526222,2.3739123153407125,10.614548710398376,0.7876497793383896,2.1757184010837225,1.5067703947331756,10.546606421228498,2.548582208799198,11.677129211127758,12.706558376774192,6.176713314596563,3.2404476026911286,10.364236901039257,14.258215610859915,2.5803147007152436,8.62742494860664,2.8537912161462007,7.1637610981613395,5.9465376795176415,1.418821822842583,1.2305232866108418,3.4322813218366353,9.148135375687852,6.8439321378152815,11.47497409674339,12.25305680138059,12.097200571550056,9.126318731103092,10.136891687978059,6.227008823296055,8.472685516569763,8.00754374078475,12.083834044858813,3.2424026990681885,11.999808063954115,1.1860555859655142,4.171019530147314,9.775230370685458,14.199773248508572,14.417686903141439,7.912582446113229,1.2129470573179424,1.2458092272188515,4.713231347957626,5.155280914148316,3.1277812628448007,8.520769390268251,4.6066953120660035,12.932905497252941,13.675382820181548,5.585319115305319,7.496537140794098,6.60960399265401,9.108529597977176,11.161047414168715,2.6691288892086593,6.611789933629334,14.214827691428363,12.594922560490668,9.473024400174618,1.7272119964379817,10.070990926576778,5.580556769380346,4.509607818434015,4.551745227761566,3.407899804404005,6.8088646682351825,13.39508534943685,10.08849813089706,12.71230581634678,7.5885115058533845,13.060081777619198,3.497376016564667,1.2464382890518755,10.65300445606932,8.89428036822006,2.117892974745482,11.503714479729533,11.756989690000191,11.983822339205071,8.396099815834313,8.78065370324999,3.4640179243776945,1.794999897936359,13.89704382465221,13.725807815315202,0.9350142332166433,3.1515189488325266,10.911828828500584,8.813486466640606,6.658745449492708,5.629973620632663,10.832070905705914,13.860113693624735,5.886745872665196,6.605547685865313,3.123058713497594,1.3405614003911615,3.975203883126378,9.879691246422007,9.94503998266533,14.645942593449726,0.2932638332620263,10.389205954959616,8.025012849355116,8.78737755770795,8.58831446453929,6.704601989584043,8.433514183377847,3.5834547220636157,4.745044913832098,14.615983530636877,11.506471179416403,10.169153654240072,12.571601161723956,13.18439729347825,9.742466035056859,9.61688682156615,14.05037415748462,1.5225817968510091,7.258745911056176,13.887494332846254,0.9963935585599393,5.419725754288956,13.51801418768242,7.621018820898607,6.775504627255723,0.637006454160437,6.1496789213176815,8.198373122829944,1.3444768842216581,5.725516664786264,3.7986552105192093,9.490811270186677,2.632737442143261,9.774088668162003,14.150699842246249,9.731096171997487,12.055266119530424,3.9743054688349364,2.671578566767275,9.108890630993992,1.6779279424715787,3.7917406677640972,13.98617585142143,6.785886201066896,6.841724484218284,8.621844144761562,13.014384133964777,8.553212891090661,7.3620695720799265,10.526847306862473,1.01980632356368,13.878575959932059,4.848404236361384,15.003680855259299,10.045017018672079,8.88414411874488,11.044130943007767,14.639411505302414,13.56581394280307,2.139694423638284,12.775663029858842,13.369586223959923,10.543195143798366,4.940453001288697,12.226200729599222,3.275338388737291,9.99504654620774,12.32203377014026,8.49548258189112,11.66893891826272,13.308874192405492,5.676228685295209,12.274659490901977,4.58516604103148,11.157333801491186,9.887939304569736,5.421487022647634,4.056320173656568,14.246024691490456,12.672955648265779,12.960189426774159,2.312739694714546,5.270049414355308,11.077697398830205,3.073388707814738,8.904436517730355,0.31578885693103076,9.022270622188225,3.7590864458959548,7.500466695744544,4.139053769866004,5.07872906233184,8.050693069342524,1.4490639530029148,12.641805216660723,0.47653627301566304,5.409398041190579,10.643210055530071,3.771991768842563,14.846429670685902,13.9594995016139,3.687772438386455,8.242521001482382,11.106764309331774,7.191093181716278,1.3191070181690157,0.7855345746409148,9.696912315664813,1.6197561828792095,9.602957181157544,9.422704521091655,9.179229959370568,2.8374741198401896,1.737221270557493,10.457199967456981,1.0427817522920668,2.019574706899002,11.165061193276197,5.2843528177961705,5.2277390304859725,3.561743731368333,10.259403540510684,3.496708184937015,6.029213912077248,7.6953988727089015,0.5634909851849079,3.139027262330055,0.1818029787298292,11.08074492960237,8.368377579133957,6.958856310918927,7.696401924584061,12.622236654385924,3.6258016824629156,8.655417452789843,1.6775491747446358,7.5439652982074765,4.804429499888792,5.003452792987227,3.67534229950048,3.850229399502277,4.845239191306755,11.635764002092182,11.924155607810244,5.755641469256952,6.068825525688007,7.450569278551265,5.497013690872118,0.20411860150285066,14.22430058660917,6.439663382004946,10.191730987969786,12.727471577925607,8.287768292464316,9.53923929085955,6.978830145196989,8.053239617254585,4.785582972215488,9.641592215737328,1.5616501758247614,7.1094177972897885,12.725885201469064,1.7392142286896706,4.209299454921856,4.451685598576441,6.252094109766185,9.355258007524535,1.1886455137189478,1.6103220644779503,3.183595647094771,3.266333095487207,3.1517736993171273,9.893122788742184,0.22536683780141176,14.525998194692656,10.384490324174985,4.450642641857266,4.996792431445792,5.758312907526269,8.64951183622703,1.7717373820394278,5.849822209673002,10.938057895507663,7.111928819902241,7.993680558390915,2.405879189716652,9.43819861928001,14.768978402242064,1.7088122032489628,2.072996064778417,1.4222987550217658,12.452379946587607,3.029905175315216,3.916242492375895,0.9773997713252902,9.733012718604877,11.636339122885838,11.641099390797317,4.391795175140723,0.7190553920716047,0.8933188121207059,4.4446997851971535,10.972364630540833,10.806822814736515,6.5025348851829765,13.534951663566753,8.903045645672828,2.708719335021451,10.360841786712408,7.245403356608003,8.466224969122559,4.276985718859359,14.605580614404753,4.987060304954648,9.20394937925972,1.0635461048129946,8.13260866514407,3.1702710543666033,0.4693347862828523,10.297817778298631,6.253039106484502,4.610257100537419,0.9701852856576443,4.363374282363802,10.24322296445258,9.711586939627304,6.548416661787778,0.7487375098187476,7.338331945464015,6.967580520538613,10.47544010634534,8.541982213025912,10.1307570603583,3.880316670509055,7.681359562082216,14.599580956380814,0.7920423331577331,5.203415152607485,13.354336542068049,13.53887816610746,11.00342550500296,11.665376605922356,6.71589804998599,9.295525345476344,1.0924331152252853,5.646622287565842,14.130805646525696,13.500479110041633,13.85732861770317,4.474559595799073,11.70775720918551,14.696209505889565,8.221351516656577,13.65363292697817,6.540109245795756,14.763737847786397,1.8057618983928114,9.029359952071681,14.822095029046759,3.9273593407031147,5.077574706627056,4.873592064939439,8.019722946444526,12.957991583496332,1.0517665587738156,4.549323434000835,1.024781384728849,7.426307021630928,14.712357881469652,11.517035349495709,10.817186287129298,8.70115823181346,5.269863255778327,0.6028860313724727,1.1490835524071008,0.6390749018080533,10.253786945939064,9.303886692030355,13.012343702828511,8.474682239573449,9.734168282700702,12.44657705723308,12.597430523708463,1.8028265314549208,10.206946538053453,5.640118866683915,5.342782844780013,4.78500484092161,13.487580765029415,11.570628274455666,8.836119672739878,13.853626076122746,1.0445149168279022,10.867663952047005,9.791159115955233,14.355101861981675,0.871396580003202,10.585231526745483,11.714440411413088,6.371680838745087,9.274138102298602,1.0457547155581415,3.5549116001836953,14.300488932747394,6.086658880338073,9.554145555701107,11.81675929877907,0.7928950486145914,3.339207251081243,9.952144459346309,4.798829047465697,6.696330965021625,1.0190992925688624,6.874130336325615,3.55948767228052,3.5210657720360903,6.418737761666998,6.201037332173437,3.9047076420299707,10.454373806240037,11.883637232929468,2.7327105072233824,3.629038469623774,2.9627092073112724,3.2093709178641436,9.965750715453177,7.436237289328128,6.942421630481258,4.0318124527018515,2.7012663772236554,6.576026158398017,0.42348853148519994,9.522966754846275,1.382073240345344,1.7742526025883854,11.867045702636242,8.582627811226994,5.50137246562168,9.383398522147909,13.804995747739449,8.241322343926877,13.341211518961936,9.683568255966529,3.0055250688362865,2.139405398154631,6.339117850400507,5.020010729311034,2.9695720581710336,10.631480874251574,14.5828259999305,13.749889414282515,11.488836650494486,0.06621484364382922,4.73238180343993,10.343412935724482,3.0550951517559586,13.438434163797647,2.0631013747677205,8.757544233920052,0.18216717242263258,9.021322251753881,1.6572039767540991,0.6151634345203638,8.41622000861913,7.626364879067987,12.197163302442059,5.829782346952706,4.276240225406363,10.122806912511587,13.138127019153908,3.759916984234005,3.8713772066310046,1.8213053170964122,10.297376712076366,10.965317971529439,7.556296768123284,6.730266416668892,9.523268573209643,13.023059522490948,1.070880881268531,5.007107075760141,0.7820320811495185,14.608378968657926,11.485608814507723,13.280736251724884,9.814311329498887,3.3002093534357844,14.661766781462356,2.0254423743952064,11.778267259467393,3.1008746656496076,13.808746502725407,1.8703933427948505,1.4863004600536078,12.634498439254239,13.289316774569452,8.201962239798158,12.499186316961422,2.593909623790532,4.045997587488964,5.699208392286673,14.410826084893197,6.896783732334152,4.66688552474603,3.1512367231678216,12.09260821760632,2.2006061749905346,9.728935778364539,9.837118173707276,10.537333378558978,6.0885316699184475,14.02777139864862,12.438534624632448,8.91200137742795,2.9933683336619286,9.867979122316465,1.9704564644396305,11.056749734086916,5.652658710712567,11.157077549248934,3.140443412810564,6.5052659572008995,12.025571055235341,9.537008272707462,3.2565596112888304,13.534437454761937,8.174550000801682,11.48583020851016,0.9803470929525793,4.535601280620321,0.6862617686763406,0.6098951359651983,8.28583763282746,3.332492323350161,8.971260392097756,9.51108021730557,9.247756477668881,5.886486903289333,13.74934464645572,3.3401801700145004,1.8844329048786312,7.220060592042282,6.1720680917985735,12.590854648258537,13.853240417772904,13.038091561282053,5.094508766885847,0.15532985165715218,0.08785912486724555,12.010038204714656,12.21814109314233,9.55700066591613,14.243534508384764,1.3801682013925165,2.595386518621817,10.539183205217123,14.064961326764896,12.87634556367062,9.529680778030306,0.9439704120066017,8.196893098754808,7.815388477863744,6.292065233681351,7.443912905398756,10.27138567365706,9.327702364642173,1.509625574797392,0.11713757015764713,0.5694682286027819,6.181562242088839,2.3819847900792954,0.8991136827878654,1.808879774287343,6.102241498408839,6.706492527844384,12.122225448945537,4.675675242431462,0.0176336192432791,6.793667467534542,7.18659717425704,4.8044273136090485,11.004127534795552,2.2491912271268664,7.608495810525492,6.2605813140887765,3.0558523938432334,10.385711525557562,5.465942862899974,11.635997577793896,9.813524411981925,4.094154666634276,3.9558894671406595,8.583836596915498,14.179548756908625,2.548034573663026,13.52178172044456,3.6947106320783494,3.591987950019538,0.20986099796369673,0.11077607235871255,5.234702652776614,4.280782046951353,12.763263610647991,11.75797847867012,10.44942786869593,2.5299043320026247,5.698931992044672,10.708543410981074,13.214423170536756,13.278104812595993,1.7144767108745873,4.8933405587356535,13.686699716597795,1.9723769470490515,12.156566165611148,8.480288409153,10.56459955940023,10.9561466956418,3.2402679610438643,14.753086659582332,3.7378566532768307,10.215490515800193,12.11327695007436,6.547630987586453,6.212719962457195,1.4374702477268875,9.929081520056352,3.444021836146712,11.183902496229857,0.47396024175919593,7.173621799554676,9.993921453822404,6.737304976666346,0.4707561929151416,14.054888420030474,4.868922356506809,7.675494929533452,3.8722687442693857,14.392349258521572,4.911362785603851,14.264981682170182,13.838302214387804,10.084566173134371,10.823096828060224,10.94701591831632,7.475403177775442,2.218385948324576,9.919256214741617,4.1940207087807355,1.473716991711408,7.731580632496625,0.5392011797428131,11.307073578462004,14.629720303453505,9.11902792122215,11.791668997136876,12.362213907288387,2.5174414862319825,3.8430276997294275,10.929322167756036,2.466812828313559,9.91843465551734,2.3405696493480352,13.191177275255322,10.838498190967366,3.8519982919003812,5.14786387629807,7.464037984134629,11.206999714011326,5.036866893749684,10.01219248002395,3.820761097120121,12.14777379016392,0.2041585761960596,2.8275544238183645,14.65356796699576,0.5316723238117993,0.7322790911328048,3.2082107332441954,5.128375238962471,2.3949794187117366,0.33286923029460014,10.771865148087963,13.123274000352248,0.9937938658893108,14.480308269374072,3.43571331304498,2.3121358833648262,8.369917453490197,6.616320907594636,7.37693792627193,8.588562348848209,9.347170633953064,7.2469120363146065],"alpha":[4.363716366467997,0.9256860062014312,2.790521062677726,4.399317071773112,0.5691071024630219,4.982748914742842,4.117416507331654,4.467541229212657,1.1163096311502159,1.727362536592409,2.0851212036795914,1.859879404772073,4.846121943090111,3.0577645422890782,1.19814738817513,2.075916517758742,0.5406345189549029,2.25054720020853,1.3761013951152563,5.491432782262564,4.292529415804893,0.8838828834705055,3.123620261438191,0.7476475515868515,1.9261188812088221,4.73407876631245,4.012429477414116,1.9702420274261385,1.7605476460885257,0.9002648347523063,3.715814867289737,1.952570310793817,4.013897112570703,4.417533311760053,1.056957459775731,0.7592793665826321,2.0563421219121665,4.582107099238783,4.634298068238422,1.0045357765629888,1.7710447353310883,1.7665605708025396,2.764567892998457,3.59222447918728,1.2232671277597547,3.711899360176176,4.84291442274116,0.8188088804017752,1.63516257959418,0.710826275870204,1.9304025028832257,5.351710285292938,4.524883676320314,4.3290724297985435,3.151722184382379,3.826372131705284,3.5262114002835006,3.3447238996159285,2.3581702024675906,3.5452348187100142,2.4204683310817927,1.761799334315583,3.805739287752658,4.4500355161726475,3.9482383052818477,5.461439691251144,2.458232125034556,5.416288667591289,3.5661085550673306,3.091409678570926,4.82859351974912,1.031377209117636,2.048641762929037,5.4287742003798485,1.6583944805897772,4.442414142657071,0.5262748787645251,0.5068510638084263,3.2818771987222135,3.7840428105555475,2.3104206980206072,4.573507516877726,5.389355000341311,0.9038890334777534,3.046727276640013,2.5875329978298396,5.422302655177191,2.3011769966688007,4.895257522119209,4.307384733809158,3.9742962720338255,4.796156208729371,0.8332734957803041,4.447492506122217,2.35665566008538,2.402421780396253,2.446438429877162,2.4263310555834323,1.6106964375358075,1.9532338653225452,1.0966259050182998,1.2125283451750875,4.161172662395984,4.77740540006198,0.9766533733345568,4.590773445786908,0.66021947725676,3.458309667883441,1.6926217179279774,2.4058209657669067,2.137506353436038,4.931916893227026,3.630309320986271,2.385570277227089,3.3549211099743843,4.750715804519132,2.9949382164049894,1.5735242953523993,4.0635546303819865,5.336392140714452,4.404107803246006,2.331048169406131,5.0614271552767605,4.346710410434753,4.656637451378629,3.064708220306784,3.2030240185558796,1.2468707230873406,1.4560604835860431,0.7272589399944991,4.7080888082273304,1.2364299811888486,2.9759335070848465,4.639245625119656,4.64580492535606,1.4218520822469145,5.035179878585041,2.2536427860613912,2.863455087179318,0.5689210451673716,2.6171407867223024,3.161774307489395,4.95918673183769,2.992364108329639,5.422551044728607,1.3085770660545677,1.5262434708420187,3.369796378072351,1.7500155135057867,2.3926315696444362,3.0884763593785465,0.5464118167292327,3.2127782290335745,1.735057299491018,2.7972288134042174,2.493812118889764,2.776441976428032,3.4719573410693556,3.3309423103928566,1.2150367449503392,5.406443734653294,2.9866614444181323,1.7787674891296774,4.587066858774051,4.569380412111059,4.238336137030274,4.000833803554997,2.524954011430964,0.783530205488205,2.729238166473806,1.112690708367154,4.9895576080307364,0.8641559451352805,3.6674474745523185,2.2679867474362254,4.113382813055068,2.7135102283209562,4.521798800677061,2.332174086011946,0.9650621337350458,2.995145903667435,2.2292453662957996,2.589981669560075,0.8558304475154728,3.3110964386723936,4.521049467846751,2.677126113092527,0.8069435455836356,4.280505869071931,2.851645523449406,3.5962753645144403,0.6253586390521377,5.411711153108627,3.4196914995554835,1.7779514340218157,0.6538194413296878,4.969593492103741,1.298912487225607,3.9465866594109684,2.492842205800116,3.0323805527295917,2.1262554132845253,3.5248290055897087,2.291662712348625,4.283747911220416,4.377209943020716,4.085012897383422,4.064423605566844,5.026513768360019,4.482415570644662,0.6092683174647391,0.5971600553020835,3.459159892052412,3.013861684128642,2.986647453624755,2.212252189172432,0.7865241828840226,5.281565953744575,2.5164136169478297,0.6921984856016934,4.117955825757235,5.4683962552808225,4.083121872507036,1.2931631221435964,1.9556839293800294,2.1499480861239135,0.5739091681316495,5.03691054135561,5.119109708582982,2.730720784282312,0.5956382427830249,2.2944715509656817,4.254507307894528,5.4061718583106995,4.068484908901155,3.7195333566050977,4.014270241139457,4.093964413739741,3.975861306069419,1.8196014461573213,5.22114990814589,2.4587204372510314,1.9335353462956846,2.9313633772544563,1.2512812234926969,5.307015736587346,3.2565715310629457,4.141116279177368,2.226643091533333,0.8528396191541106,4.3312593509908766,1.6728376056998968,4.149536573793739,0.9443386383354664,1.1916468183044344,0.9908697295468301,3.6080622458830476,3.3417831065598875,3.3827684093266726,3.6714100821409374,1.0890693166293204,2.2399410461075604,2.440224115969613,2.4234939152374864,1.355004892218858,5.4888301733881235,5.022791001945734,4.199253227096051,3.2804007777012885,2.2041491519194096,0.9349384154193103,1.248052119743079,3.1451425324194133,1.6456913501024246,4.239120694808662,1.2522739819251,2.5248299196828157,3.8414108550641686,1.1388068269006908,0.5728113681543618,3.624211139511317,4.5487494552508,4.206378415226936,0.88457723101601,1.8071627845056355,1.0611062154639512,4.075956042623147,4.715442619752139,2.7147832775954157,3.077071270206943,3.212938580662012,0.7109435922466218,0.7746839809697121,4.303339069709182,4.380767427617684,4.071836695773527,1.1884855695534497,2.6264500764664263,4.7107192578259856,4.519159117015079,2.5119732979219407,5.471143476432189,2.707730944501236,2.68309081858024,1.5578277905005962,3.708203511312604,5.47869212878868,1.988482269924134,1.8151391490828246,1.7389890500344336,0.8460899495985359,2.396986940409988,1.9657821576111019,1.678371284622699,1.161034274380654,1.2237320125568658,1.4806823742110282,3.5712042574305087,4.370790966320783,3.020888904109597,1.1435422459617257,4.581353225046769,5.31224745279178,1.2462365610990673,4.701737899566069,2.708384097320959,0.7655267587397248,1.2053405593615025,3.3277914423961192,3.9316100482828915,3.737390643917024,1.5209871095139533,1.8729824859183282,3.451871866825968,1.1862650450784713,3.954442188376561,3.0533568719401956,2.2649802390951663,1.8375476759392768,4.2980546755716205,2.264416032237932,3.070606772787869,5.344874242553487,1.9341413555666804,2.311860663583502,1.3428352908231318,2.743406956549734,3.8192482497543097,5.172509168740362,2.097651147749275,4.18867868441157,2.1872166271787137,3.8457786648068577,3.5857351957820356,4.533836921444163,5.268964692484587,4.430267576361075,2.1760243056342006,1.3634424523916095,3.094262738712132,2.733709479914978,4.473122462630272,2.751218615565449,2.019457525573671,5.259955954505131,3.272789782611653,1.8132967532146722,3.374068705132231,2.7920494829304516,2.981342852115631,2.207739185076207,0.6109663862735033,5.132113965926692,3.5238581623416394,3.6503855460323393,3.292442445643246,4.040618942352012,1.069182545877993,3.936652219388634,2.6975201880559325,4.067928072297946,1.4065527142956853,3.2161512163002044,1.185391960432753,3.2284178440459073,2.7068349400069565,3.4669571248814464,4.020528405206278,5.2830013441853225,1.6553317378275096,0.6943636336363852,2.2356360191479325,3.2470469917170703,5.097891017328948,0.8152704448439181,2.798504380742088,0.73392140166834,5.376883876277134,0.9433242348022759,3.2206500933971256,4.642463582102209,4.657951918896288,3.532131347572431,2.8900378320831805,0.5121849926654249,1.1868380936793983,3.12852352228947,4.959574585780501,5.277498512994498,4.001680850749835,3.4665265313815325,5.472263107774779,1.5376700467895716,1.7073116039391607,5.038502615178004,3.671064705820754,1.5966834344435483,4.367222563130781,0.6902847422752529,1.575646688695997,3.6620642147026956,0.6096460688859224,4.101981094107032,4.153772404650226,1.335893356706947,4.28442253684625,2.8740638268645853,1.8343556341715157,1.1750408606603742,2.2464064992964268,1.2349124969914556,2.437179637607187,2.558853885391727,3.8822399156633765,3.2722755272407085,4.1187031283043325,5.104380268137902,5.473516217432916,2.7188049973919988,3.4638718941714615,2.328327397815883,4.073746946640313,1.7020008102990687,2.852046101586893,3.7028052781242877,5.2173548163846135,2.4052372907754034,1.5131752712186426,4.387475954834372,5.185124355601147,1.5514348756987602,4.786598092876375,4.951177498558536,1.1193562760017812,1.8747664098627865,5.151891505345702,2.7861144004855305,3.5476096644997597,3.4121218039654195,1.0303277762141079,2.1990497580263764,1.8012638268992305,1.14696328015998,5.103466331027448,1.8605849829036742,2.6188096422702074,3.3054613119456917,0.8577331581618637,4.526684721466154,2.3456872436217964,5.215983032947406,0.8304281050805002,1.1682315282523632,4.044799705268815,2.5953944965731353,4.552471895702183,3.1479873165953904,3.1700924639590085,1.7702776805963367,2.8764798790216446,1.5897052532527596,3.4969872999936342,2.276350988075137,2.3756656511686742,4.1373251979239285,1.4764291776809841,2.5633250288665295,3.093848538817838,3.2630343614146113,0.5692901446018368,0.7799415506888181,4.072502409806475,4.375241804635152,0.9759589477907866,2.42160393926315,4.797506380826235,2.9231584649533033,2.4966618821490556,5.196588333463296,3.8868816192261875,3.5773437744937837,3.1588580873794854,4.162919333437458,1.5588145442306995,1.6450552404858172,5.294784360565245,1.4281133359763771,1.7735903321299702,1.8724918314255774,4.073563669342548,5.152944854460657,2.6657963609322906,2.1925211693160236,2.5907266961876303,2.9410100583918393,4.488050218904391,5.036679214797914,3.82087344257161,4.228041497524828,0.978386472677812,5.189699881710112,2.286657526390627,3.093389564426616,2.8423126828856766,3.694902976974845,3.2479962003417313,1.6368763458449394,1.1262155645526946,3.9154816914815456,3.8642156689893454,1.4020471572875977,3.4772696853615344,1.5609126195777208,4.421807381557301,4.46695657633245,2.8875337466597557,2.0822910133283585,0.9136517876759171,4.930126176448539,0.6383236469700933,5.485204548574984,3.6011650955770165,0.9618967941496521,3.0899033015593886,1.6715384223498404,3.321267859544605,4.428716802038252,4.323959867004305,3.04540809430182,1.9047191140707582,2.9059969279915094,4.017839559353888,3.451422710902989,1.2335830060765147,5.150985251646489,4.194415809586644,3.5050515080802143,3.6414097012020648,3.7543222268577665,3.260046754265204,1.654489602195099,4.79772543720901,3.9929413581267,5.405917359283194,3.462394858477637,3.5368786794133484,1.1003663747105747,3.9536084660794586,1.7408954999409616,2.0734005719423294,1.1815879081841558,4.424394260393456,5.266910792095587,4.318255541846156,3.9195451566483825,1.8215052941814065,1.344245923217386,3.4666196112520993,2.960485410410911,4.469709548400715,4.668189051561058,5.141119211446494,1.1753112375736237,1.7281084270216525,3.4802744614426047,2.1887282440438867,2.4724232039880008,1.0986452056095004,3.281151559902355,4.4470792771317065,1.0897197930607945,3.024062938755378,1.407985942903906,3.2629949478432536,4.197578627616167,5.137280411552638,3.1827681809663773,3.4040308098774403,1.7680339941289276,5.017367179505527,4.853666177485138,1.4924620238598436,5.400974580086768,3.946943685412407,4.358147562714294,4.556402049027383,2.6628630452323705,4.4511973259504884,1.3360306231770664,3.6478188757319003,5.461688561597839,5.169975934084505,4.76960707642138,3.6416572397574782,1.2320295879617333,5.202000757679343,2.1331014910247177,3.4577789222821593,3.660319833550602,1.6424302321393043,2.300937009975314,4.073095919564366,4.897402037866414,0.7897299523465335,2.307271088473499,3.1775177964009345,2.048035793239251,2.2955863929819316,3.317258528666571,1.5385141393635422,1.9830263669136912,0.8426242060959339,3.2045942842960358,4.286148183280602,2.4728794042021036,3.585001528961584,3.15726710553281,3.3348625253420323,0.6636511774268001,4.84297751635313,1.9088434097357094,1.9514202228747308,4.934138449141756,4.656698125880212,2.1258835582993925,3.8891090017277747,1.7077413161750883,3.2940940111875534,0.6235721667762846,3.6915134482551366,3.3187570243608207,1.4919242491014302,2.104664031183347,2.722812573891133,5.366085073444992,1.5807435750029981,2.222443354083225,1.97666011354886,1.9645016833674163,1.995316926157102,4.83636273490265,1.5132391366641968,1.5027991118840873,5.367593558738008,4.089736719150096,4.59253412974067,0.8130266338121146,5.082409088034183,1.9721221488434821,1.3131876855622977,3.4525116935838014,5.338545449310914,3.0649597821757197,4.776333058951423,5.290818010224029,3.5292656808160245,0.6403635705355555,3.758969949092716,1.901688156183809,2.9731434776913375,4.256050100782886,0.880158982006833,3.7602702360600233,4.847001529531553,4.198272856418043,5.305267782649025,1.6545239749830216,4.9415776582900435,2.802985554561019,2.7490384662523866,0.5594489660579711,2.5665123756043613,4.290942557388917,4.804325225530192,5.2572021605446935,1.6429074441548437,1.6212548008188605,0.9872780048754066,4.304245131323114,2.09328572335653,4.747989221476018,4.819831501925364,0.8899423533584923,4.794411452719942,1.2446410041302443,0.9694847879000008,3.5037180986255407,2.4014458649326116,2.7422813437879086,2.4268656813073903,4.6820431931409985,4.496658710530028,2.518898359965533,1.0647086491808295,1.584302633535117,4.025774232111871,3.142875196179375,3.945103178964928,4.098660358693451,0.7169732179027051,5.326611430617049,1.3697346725966781,2.375584707595408,3.690039941109717,3.1884125033393502,2.316213302081451,2.651575987227261,0.756927179871127,2.9753683735616505,5.4541860178578645,2.7469172172714025,1.9526774536352605,1.1062746385578066,5.347342524444684,3.3241072595119476,4.156993483891711,0.6402402215171605,1.5565717483405024,1.9044123387429863,1.0078742001205683,1.372896967921406,4.279798925388604,1.5129895177669823,3.9471395413856953,3.9807120822370052,3.1019666448701173,1.1007760507054627,2.929923224262893,1.8003817445132881,2.4729694130364805,5.360070439754054,1.7907976971473545,1.9150041725952178,1.4994122991338372,2.6537278790492564,4.056083912262693,4.372679274063557,4.998287326423451,0.9509202146437019,4.726622949354351,0.5756493792869151,2.072813004022464,2.2649136565160006,2.2648576386272907,1.3816627273336053,0.6000794523861259,2.78357549989596,2.7107208298984915,4.052365332143381,4.118199775228277,2.79670463479124,5.168485191650689,4.997218178585172,1.116254957858473,3.1716031914111227,3.6831032689660788,5.076458836672828,4.382799975108355,2.779996027937159,3.977964698104188,2.2078392999246716,4.012853414285928,1.292408372508362,3.2866948395967484,0.6721454050857574,1.2963088934775442,2.3260487669613212,1.997682420304045,2.1984229756053537,3.342841590754688,5.496142762247473,3.719259703764692,4.703946804627776,3.7875922054518014,4.067086401162669,5.092911042273045,0.9186326661147177,3.360462354728952,2.0777713910210878,4.590954409912229,3.3380551387090236,4.471914566354826,3.2382801892235875,2.524964998709038,0.8359307849314064,1.363441441906616,1.7057565723080188,4.058082851814106,4.654675988247618,3.716663827188313,1.1615801015868783,3.061059081926942,1.2640366349369287,2.2444026691373438,2.7392967937048525,2.434475655434653,2.3528749514371157,3.040036999853328,3.001804968342185,2.678589371033013,4.966836820356548,0.6301431690808386,4.947485815035179,1.280429826118052,3.8768015855457634,0.7150304743554443,4.3820225186645985,3.273188166320324,3.8922367088962346,5.076097980607301,0.8922405431512743,3.2310043666511774,3.315604134229943,3.554321553790942,4.53082360397093,3.6536653672810644,3.8915278664790094,2.5260087540373206,1.8641470379661769,0.5660258007701486,3.438314378261566,4.569040414178744,0.8334400430321693,5.406991913449019,0.9522383527364582,5.33726549660787,2.286384198348969,2.5760477986186743,1.0033390072640032,0.9106343537569046,3.4626278742216527,2.2127840244211257,2.959666607901454,5.196557343704626,1.4533016057685018,4.528718024492264,2.6074797702021897,2.1271961154416203,1.6899633426219225,1.5700128320604563,3.676124576712027,4.038627645466477,1.0985763028729707,2.3570719298440963,2.9717278336174786,4.231947389896959,1.3129231352359056,5.295768317999318,0.6496655307710171,1.2949899917002767,3.1592865062411875,4.721160999732092,5.328856640961021,3.594601313350722,2.5547409541904926,0.8863637195900083,1.7064594437833875,4.164883433375508,3.4678648547269404,4.31029520300217,0.9099038382992148,5.104930874193087,2.822271561715752,5.434879726497456,2.1575527691747993,4.536229386692867,4.037385250674561,2.6456094388850033,1.9445871661882848,3.523200746392831,3.346046118065715,2.4265335891395807,2.0320184105075896,4.8477851746138185,4.069286790443584,0.7874395006801933,3.191012576688081,3.473502854583785,1.9062168856617063,4.309225434670225,5.377968983491883,4.8060230382252485,2.350412810454145,2.767505790805444,4.943227513693273,3.4882304510101676,4.625827116658911,3.121072098845616,3.824404511367902,2.9133920937310904,4.472511974861845,1.1175606837496161,4.4129552454687655,2.324437086470425,1.469309100182727,1.1105651741381735,1.8299717078916728,4.8071236135438085,1.8591877452563494,3.888646792154759,1.545468816300854,4.339596299221739,3.6018201424740255,4.375826990697533,5.332150837173685,4.523410943336785,3.8828530262690037,3.550569602055475,1.002756800269708,3.9701717796269804,3.604484836803749,1.561042754445225,2.6830122137907892,4.146374935051426,3.778212551958859,4.788462675176561,2.2145667294971645,4.272092435974628,5.286220332607627,3.79217771301046,4.909928640816361,3.9167697466909885,1.7884355837013572,0.9265054373536259,0.7891421900130808,2.460236292798072,1.705294686369598,0.545028175227344,4.011144624790177,2.343514577485621,3.396845453651622,1.6060084728524089,2.332030212972313,3.4395603842567652,1.736165298614651,4.905755326151848,4.061130922753364,1.2691067026462406,5.196866263402626,1.8188248046208173,4.737511700484902,0.6186388777568936,3.8893226564396173,4.268928494537249,5.10918034426868,0.7882200689055026,4.361112865852192,5.301420067669824,4.255078040994704,3.9245782904326916,3.2895621000789106,4.42572981887497,4.721096533583477,3.258440966717899,5.169214797904715,0.8592458460479975,0.9450146923772991,2.7357385605573654,5.37053016317077,4.5481119230389595,2.774422664195299,4.57833507633768,0.6719528064131737,3.7311122748069465,5.310046561760828,2.0750243607908487,1.6327338626142591,2.3009115394670516,1.2038989325519651,3.078477405477315,3.7082134624943137,1.0334986955858767,2.6571146603673697,1.233542707748711,2.2337569419760257,4.89827372552827,2.2509803944267333,1.1580434693023562,3.0365428114309907,4.813863916322589],"beta":[1.5988150513730943,3.4608247010037303,5.028107501100749,4.203064062865451,2.827007040148601,1.9405793964397162,1.767890491290018,1.5414373187813908,2.8503881506621838,0.9047243623062968,2.537810158217326,2.430512166582048,4.111807165434584,4.525343105895445,3.6802378385327756,4.394427896011621,5.1600514580495656,4.873012238647789,4.668329740641639,0.5686275935731828,2.071158915758133,0.8996844089124352,1.7671828852035105,4.17355095455423,3.165852998616174,3.3944658942054957,3.2009071048814803,3.147286212304607,4.334311562823132,2.1334676439873874,2.5626627805177122,5.284559113904834,4.22076184139587,5.158589073223993,2.3089141719974577,2.606506251730025,4.334059281507507,1.0032838368788362,1.5486163152381778,2.319169701775536,3.906519341515377,5.423346771392971,4.211466408567503,3.7783264212775975,2.168162120040506,5.24421294988133,4.366937712300569,1.3502761425916106,4.954604694619775,4.386092727771029,4.971563471015543,1.4153376519680023,1.8706321048084646,0.5196035706903785,1.8531143846921623,4.547811900964007,3.8565207524225116,1.4962453902699053,2.98035159194842,2.77061829296872,3.0024914159439504,2.6747736260294914,2.2942486598622054,0.8373019595164806,1.1490336649585515,0.903773644939065,1.1664954731240869,2.4635760004166514,3.9370485797990113,1.6321570898871869,5.29561434360221,3.89884294080548,1.0391160806175321,3.093724239850417,5.275060313986614,4.129002651432529,2.660971045959741,4.3277711579576135,2.71311331843026,4.800646188203245,0.5189868721645325,2.980888784630224,3.022456090664491,1.0447615042794496,3.1625603600405157,0.5227245083078742,1.0312675843015313,4.854989359853789,2.8173495405353606,2.1638172429520637,0.7950772852636874,5.3221160972025245,3.965780052356422,1.536280863918364,3.567742263665423,1.2766561408061534,1.4927993000019342,4.369913772214204,1.6870698479469866,4.517558597261086,3.403540044790134,4.119574949843809,3.0456277700141072,2.9801641737576574,0.5244278041645885,2.6057096088770777,4.6131673799827695,3.230694110505283,1.9865011780057102,3.639589555794373,1.7202272401191294,4.287111374549568,4.850216742604971,3.3873260074760765,0.5181485945358872,5.161293551325798,4.854112980654463,3.621493805665523,2.2870738997589797,3.768628567457199,3.0983746501151472,2.1942820767872036,5.299407165264711,0.803912692470476,5.3410978994797915,2.9116574076469988,5.327174462843686,3.5300036224070936,3.8790704410057515,4.49007230415009,2.706606123363599,2.876938438974321,4.23958059004508,1.397880169795826,2.699103970779106,0.5934991193935275,0.8130750067066401,2.4987593090627342,2.5582259842194617,0.724721395643428,1.5546212689951062,5.248264530207962,4.730801876401529,3.213112687924877,1.5564802726730704,1.9117105351760983,3.5898092256393284,3.108680776320398,3.466249603778124,4.128027652157471,4.341298165498301,3.277578745735809,5.069147959118709,3.902213065419346,2.616817084606737,3.1615485979709774,2.4181834044866264,2.3284026032779366,0.8426162106916308,3.2975961368065327,2.019822928821668,2.9315751786343753,2.0837210998870432,2.8293951677624136,4.286722755758092,3.5564609391149133,5.205851341132075,5.006363436812535,5.3570875998120755,5.220144720049575,0.970048546558246,4.147713240934536,2.5631090877577662,3.217791338218376,2.988075459841639,3.892137496266514,0.6221981411799788,2.386400809744373,1.2285360235255212,2.655731157399714,2.887389129726216,2.118126928806305,4.491298830369487,4.7639543081168085,2.9768467899411917,2.028653478017077,0.8999308019410819,5.185873461421579,5.245310496073216,1.165732561610639,3.183120750589296,3.8699467056430876,2.343131728237495,2.1970656474586576,0.6907759415917099,3.069495802745223,4.914686398813501,4.3329101470299065,5.209623614326119,2.5338047109544277,1.7532142107374966,2.1556194645818323,3.923479674383998,4.366934712277725,1.378836412448436,5.348141382681206,1.171841570874676,3.8529672457370907,3.034971198765561,3.353327551856637,1.2485219254158437,4.474184236722067,0.6404617703519762,1.402576280059293,1.8327736663632095,0.9260949650779366,3.5083587183617055,1.8623602769803256,3.9644583985209465,3.6826718093361706,2.4043801177758723,2.989021864021197,2.693340548546985,3.0224812631495297,2.1142625629436225,4.665780020412058,1.2702751189935952,5.002871101722121,5.357153950724751,2.3488109461031854,1.848883182508871,1.42649593250826,1.626115364022553,5.147465869784355,4.431160533102229,4.91075230948627,1.6336244805715978,3.8957516064401716,1.2063211151398718,5.4018292455002666,5.021473017521203,5.072871793061495,4.99369860929437,1.0549119715578854,5.304315123474225,1.541696957545355,3.040510125691071,3.263591872062534,2.1750249033793807,4.752855734666809,4.765660721575841,2.1521012084558606,4.689354822738096,2.990822677500546,0.9407667089253664,1.7584279861766845,1.5582780302502215,2.9862343491986394,4.536801444599405,1.9124259853269905,0.7028987265657634,1.4250051691196859,2.564957849215716,3.2390021074097604,5.237122593214735,5.037516401614994,2.51791406259872,3.333233092678711,4.022075058426708,3.9025959589052945,3.7865298190154135,2.9644731741864234,2.2738196393474936,5.3786050605122,2.6882737800478935,5.3837304569315165,4.589067303575575,4.255929811159149,2.194922181777656,4.372473741648719,3.5021066695917398,3.305311115225777,1.7585240858606994,0.5883144745603204,2.4250787829514593,0.51717334613204,4.411262571346015,1.9515460201073438,3.153833634685725,2.552548610372469,4.750309016788378,3.3388924070168287,1.9908462960738689,1.4646768553648144,0.5537584233097732,2.330186826409772,3.804542516125366,4.679112850688398,1.8445513020269573,1.8378671172540635,2.4394377118442208,3.150420442223549,5.466865306487307,0.9136374848894775,1.710110979154706,1.6199336359277368,5.388599811820313,1.981178276007995,3.750707696424797,0.7086788532324135,3.335891278227791,3.1753987290430814,2.2193263035733253,2.988450160017237,3.709629707271233,3.013065419625491,3.811528213089332,3.2019605587702245,3.564143123337999,1.9959424536209553,1.4153756650630385,4.258136326214299,4.331598709803075,4.213881529401988,3.899476616177708,5.043988100485876,1.2698184403125197,3.9561747824773192,1.687443061498925,2.489677535602823,4.879915642784908,4.959610233316198,2.3668825598433614,2.3883884814567864,3.6546718580648303,5.2848886414431036,2.3837799120228738,4.792393667856231,0.6199506968259811,4.887097709113732,4.496827470837161,0.6282775646541268,3.7052834250498563,3.6349812040571123,3.017675773706287,3.9271073539275676,3.9898257663007826,1.0386672518216074,1.0946405394934118,3.109978780383244,5.1938164823222905,4.729891877621412,3.484980478649959,4.313755247974768,1.0439615179784596,2.54094476881437,4.1557154869660735,4.715527919586748,4.547097570728511,3.0430487538687885,2.969566670479253,3.726725326385349,4.026218413608149,2.4523166737053543,1.7211856327485293,5.027350952848792,2.2638931539840996,4.970147034153342,3.553016613703221,4.291562595870346,2.648039013845846,0.9431041970383376,2.892269376432523,3.9241637936793268,4.936159947654232,0.8689544450026006,3.216354321455583,2.171820137416944,0.8314630768727511,0.8587756142951548,2.2719302768819034,1.539381354348734,2.642121803481132,5.1404085494577885,4.379310952033848,2.270006474107504,3.824990894179791,3.155296124285087,2.8870150302536786,5.28812065673992,4.609467808157206,4.640320937149227,2.747459627687931,4.642667355481535,2.0482105826959014,3.830198022304103,3.8741262974217534,1.412654377752915,1.882454251870513,2.185412236256525,2.5948557602241635,5.468940357211977,1.8771719683427364,3.762789170257747,1.171108904061839,5.415538664208725,5.431814044248313,1.7221110425889492,4.829803877044469,4.46365700988099,3.358802044065669,1.929613622603938,3.1523991499561816,4.87379936571233,2.036186415469274,4.935197954298928,3.500333800446242,2.8864251689519733,1.0036195029970258,2.576279434841126,1.611304477090016,1.9713732874952257,2.6127086004707962,1.2864970283117145,2.231456535635516,4.428442482138053,4.321878071175888,5.321622458985075,1.9354013174306601,3.370271153515205,0.7925484022125602,4.888653927017003,1.9990765857510269,0.5465441646520048,4.349439389305189,4.456162628019229,5.174202145542949,3.5018946016207337,3.1485474640503526,2.1384629590902478,4.135791946435347,1.9099222258664668,2.3745408672839403,5.00152380624786,0.732143783941865,3.0848889898043126,3.6867240089923143,2.159137026872486,1.472333278041333,4.42939243116416,4.288101976970211,4.045508151873946,3.9862685773987323,2.8609145218506455,0.9764318792149425,5.081129697617143,2.972348699811846,2.392929569585249,1.4152099618222564,2.5796140073798597,3.795727407094091,0.6591043546795845,2.412537895841524,3.693544562673196,0.5904541125055403,2.865209455601871,2.142168255057186,3.0184242066461593,1.276183680864051,3.4913706658408046,2.529751075897366,0.8011561371386051,1.241856920067221,4.1114528751932085,5.32478442019783,2.9206384422723204,1.104955597082153,4.126500737154856,4.243853206979111,1.5800966364331543,1.018097406020388,1.3106294565368444,3.3878952213563025,5.289493312127888,4.068124808371067,2.7842005745042115,4.3661440124269575,0.6986478618346155,3.9290615667123348,5.242752565070987,3.26118170353584,2.410172854550183,2.680106909945607,1.184786990750581,2.489129481371492,3.623431184794754,4.459027609089389,1.1912937411107123,1.7566145975142717,3.0182476674672216,1.6208059662021697,0.5833437265828252,5.103157377569005,3.8641173248179257,5.34198251622729,2.9834730883594602,1.3764909743331373,0.5877716159448028,3.104770368197933,1.0894988682121038,2.172014157520607,5.223428322467953,3.9849671879783273,4.059329089475796,4.41019104863517,3.846101436764002,3.2816829027142376,4.129662432940677,2.357280923286453,0.5404525361955166,3.367747840937227,1.1816259771585464,3.80896319122985,5.475770418532193,0.8576015110593289,5.2472818195819855,3.9711591457016766,0.7925019967369735,3.8089527988340706,3.6273586652241647,3.921649861847982,3.0394099310506135,4.278972494183108,4.148797089699656,2.5192601066082716,3.224886250216514,5.099088131217286,4.080170511268079,0.6931235007941723,4.298661356559023,1.8579278928227723,3.0633417547214776,4.936824282165617,4.237454438814893,1.0208832526113838,5.3555913195014,3.7960528729017824,4.339421377051622,4.175063834525645,1.0493496416602284,5.411257496569306,3.8368001284543425,1.1499584391713142,0.8543719777371734,1.206617251271382,1.1320254190359265,3.2016713190823793,0.5255184818524867,2.587575006298721,2.476722863037139,4.534840785898268,0.9029642476234585,5.007039309246466,1.5949603549670428,1.170375400222838,4.251267234329134,2.1428644116967916,0.6830895396415144,1.0950839549768716,0.9713597940281034,2.798647811403498,5.212162378709763,2.1862146428320557,3.2740654058288783,3.977025571046397,1.3536508679389954,1.207520564319566,1.6047680233605206,1.7644887890201062,4.5996192244347185,1.6739064496941864,4.342794686788693,0.9651002690661699,2.6670375659596175,0.7815903269220144,0.8731452953070402,4.898536757798865,2.6417758148163557,1.5494272760115564,1.1399089214392006,4.560405725613236,4.671436708420515,3.528941177763045,1.0078109400346875,3.065861106850207,1.7567295948974788,5.1565384801942855,5.178103509359062,0.5120112451259047,2.5872720156330615,2.8697338020429015,2.7793590754736215,3.8037234109360725,2.0752083202823997,3.0569853419438004,5.047276236116886,2.2764396709389985,3.843491085106507,2.690624119248241,5.1446748927701265,4.258648344082758,1.8149682828225195,2.7879871213808656,2.3016618536785245,4.760486910352483,1.067752638598904,0.8177189396228641,4.524022822268307,3.775489828083664,1.503542171092704,1.0420617712661624,3.6071276776492596,1.006177650531754,1.4478535584639758,3.758991278707981,0.7669134805910289,1.3972501719836146,1.2925624144263566,4.18530890205875,1.1102370657026768,1.4327566716820002,4.592320209601894,4.257247477769852,4.117305181687698,0.5026102061383426,0.9314387158956379,3.171583554474637,4.741165190469474,3.089854469988495,2.5325286930892617,4.043170734774321,0.7427807240746915,3.256535871885717,1.5210195393301547,2.2974055593367666,2.9647382902912796,4.755425849696621,0.6907117245718837,4.5896939230151474,3.5983558646403253,4.43632089602761,5.192376342136413,1.6080641706939787,2.826044625369832,5.229565174784511,4.212529068579897,5.300612659892067,4.642663531238213,5.30026749544777,4.878476272104308,5.497584306402132,4.940176568459719,3.9006675623822957,5.075320848962292,4.573363926727325,2.120189449749887,1.6004027910530567,4.823689123848453,3.611365883378312,1.5616696567740291,4.183263928396627,2.086046398151666,3.0958624749910086,0.7083108585793525,4.349818711169064,0.8505321405827999,1.3131527621299028,4.581239232327789,4.512723055202514,5.060061580268666,3.0127692380920053,2.329008418135345,1.0871364008635283,1.8715975172817707,3.8476153225637972,1.179541047429666,2.2843780666589737,4.508054519072175,0.6998025644570589,4.740594857838005,2.609257703414187,3.69019295508042,4.566157230408862,4.852489294251427,1.8711542286910117,5.139491273555905,2.3173419300001115,1.5187487001530826,3.4559476394206285,4.398115039337426,3.470590670593083,1.8169696810655296,3.3999345435295254,3.53572132717818,3.0101231737062335,0.6821970834862441,4.415638212347403,0.6348962797783315,3.6869624461978674,5.304324884898961,2.2665798089001328,4.188932460499927,4.6367547831032425,2.5952766248956323,2.019557161955163,1.017286591930315,5.325352062471211,2.427474943222478,2.848138998495415,4.261971009662375,1.1921231222804636,2.3687100429087877,4.919662122381851,4.911715799942613,3.6006837938912213,1.2961534755304456,3.0187357096001506,4.87921546632424,2.9316169787198305,0.6480127731338143,3.421727044740692,1.429764409083873,3.506049497053027,4.473858616081998,3.5897168326191604,4.453631140757352,5.099778117844835,3.9321983600966632,4.092588319443166,1.3502164483070374,4.8520614167209715,1.0649153259582818,5.127726394683123,1.475291101494804,2.6421771915629506,2.5558662503026426,2.6758475271053612,4.531268513062969,3.5168340587988496,4.518570295302197,0.5975712796207517,2.835758564295247,1.00363885355182,4.396689269458875,3.1734620484057814,3.3068593773059547,2.6462944021914154,1.721046254504472,0.9737599147483706,1.5215447435621172,2.5076709031127393,2.1182599239982665,2.3506137805525213,4.6249028814490885,3.5977378482930362,3.7832371490076184,2.2853210773319006,3.914183631539345,1.6824637779500335,4.442659696331248,1.8683479698374867,4.286848908057436,2.820575776975602,4.338578095892444,5.196447462774813,0.8841894818469882,5.332004148047417,2.0572054812218994,2.699911253992468,5.400451101129875,0.8550430340692401,1.8541707710828632,4.386032609734684,3.4135043325368315,4.470906165195629,4.290361153660342,5.3186943016480654,4.451455254573375,5.4702341423835605,2.1849558637477458,3.0785938382614404,2.7781116934493184,3.238105265889317,1.2811371539719403,1.095414696726948,3.407563680782914,3.919251311570406,1.430225393967703,5.333178276894614,3.962400925345719,3.2172757359221578,1.1996254436671734,1.7691077624913305,3.898926854133606,2.9347539094742388,4.568474548403174,2.387186288367957,2.8839598160702735,0.7934353949967772,2.9122331477701664,3.5304628959856927,5.230425470042974,3.0133937946520746,1.1066072324756533,3.501733113778755,0.8626427974086255,5.007458129664883,2.1356516524683684,4.66877516778186,1.2127055758610368,1.234036536887288,2.222095051081851,4.21106828795746,3.7208627986256033,3.3158038144465536,3.5821077700238675,1.795080945128575,4.802553310990334,4.899488443741575,4.873676311224699,4.589206251082942,1.871000815415755,4.2313313549384475,3.2695951017085463,4.453833893174306,3.189420401584357,3.5598774645477533,4.772179700201377,3.7718285464216024,4.998505798401311,5.434311350807548,1.3263493049889803,1.3619566808920354,2.6160365093965083,4.435355200665072,4.429465475957841,0.6204035279806703,3.14522623619996,3.636586780892685,1.0877297616098076,4.393582413438708,3.5401081184390932,2.7262887516990304,3.8066946093458682,1.266976528102532,2.9157953716348857,2.3537579267285764,2.200137659208849,1.4487903688568622,2.9775304994545877,1.7659010500647128,4.994498493149877,5.005645028548315,3.036666711093858,2.633026587544009,2.7688876010943204,3.1449470256920904,1.7607673346064985,5.285392882768065,2.221749712014571,5.221734743798152,2.2770037334412336,3.397777718026191,1.3322129014413804,3.8896132139489055,3.167720135068521,3.513930559391156,2.317365433089435,1.1566253118216991,3.9313517168629915,4.222344507696107,4.8917462637182325,1.8713296502828598,1.021896407008171,3.8632645511534065,3.6476722087245435,2.708025597501546,1.3343942137435079,1.36106043192558,2.883837818633765,3.857569065410644,2.083299218909815,4.233545214636251,1.465404745656997,0.6387813582550734,5.218488515354693,4.699528128374368,4.7653753538616,4.955212666653097,1.0164708488155156,2.5056865888182074,1.8323368143755943,2.4241997972130775,5.489186275051907,1.911659512668848,0.9848036426119506,2.8088850267231464,1.1721027009189129,2.3830037023872137,4.570679836440831,4.76013060612604,5.482045410433784,3.9280385193414986,3.2237772929947823,1.6596897710114717,3.8555225434247404,3.693325122119859,2.1823197435587645,4.921623967355117,2.5518536888994277,3.1896361936815083,2.7940417961217463,2.4913607998751104,1.1639324722345918,2.5003062952309847,1.9638511964585632,0.811519259121269,0.5270004919730127,2.6913939446676522,5.076767530525103,5.293180924607441,3.960944116814062,1.0633841874077916,2.952526403358206,0.8502904670313001,2.060424364870414,4.291158538078889,2.0745335700921714,0.8890333499293774,4.3201507239136845,1.750927522778511,2.8550054104998708,3.1392241148278117,1.4976349771022797,3.5923125823028386,3.267899588216096,4.832094677956775,0.8008382057305425,1.3960563375148922,3.4696440580300987,3.425138098653406,3.2993184060323983,2.6691200556233525,5.285495228134096,1.7610984838102013,1.670088390354067,3.3368631459306926,3.2218613610602915,1.4622644959017634,4.666187065420672,3.3151003608945757,2.8137243173550814,4.983542225789279,1.081857132492587,4.512148432666436,2.502359079197049,5.05666147172451,2.4767484022304416,2.274690868332982,3.949465724406764,2.5653784333262593,1.630916295805946,4.978241440374404,4.401366542559117,2.8113196797203273,4.0614668764173985,2.138198031578213,0.870379809755832,2.6809120930265635,4.048532965360209,1.8216410239692777,1.128517409786582,4.080215204274282,4.700719747459516,1.1897083460353315,4.9927520561032,0.6970116409938782,2.655661714496091,1.6332586070057005,4.029999586753547,3.0265494850464165,2.8886540927924216,5.452348945662379,2.955461802892387,3.5850170576013625,4.866974919103086,1.463605559663847,0.5954589806497097,0.7804645523428917,3.512473357375711],"expected":[-0.22403212180405474,-0.000333289114675809,-0.0011020917947680649,-1.3278579710602627,-0.00030968267560858615,-0.7929325907644372,-0.15426154641105605,-4.202667808093246,-0.024236724652277913,-0.13320349112026875,-0.010071429670742923,-0.0064495651801029395,-1.7996903931764825,-0.0013381700738102878,-0.00044617393885987354,-0.0018644499482516823,-4.575893538854304e-7,-0.017834658146535717,-0.009259937663335504,-0.7727596944631593,-0.502173501969176,-0.10754953066916216,-0.1021087092124301,-0.000004949371355866193,-0.001743902348192041,-0.033101376989564925,-0.016754333759627784,-1.0004150667336904,-0.25778095741448687,-0.15361663230659722,-0.04744811880248554,-1.689718463031414,-0.35652387567048416,-5.429807406405335,-0.006920837303959626,-0.004454207915672637,-0.00026287221275548075,-1.9216392750146603,-0.3760559966365578,-0.006236649241971104,-0.0011734196607005008,-0.0205989678053239,-0.0051424331603336145,-6.825533817536415,-3.0944346913906866,-0.1843371769147552,-0.06738327127941747,-0.10239169933805235,-4.705675523012306,-0.00005024149307850089,-0.0005292212671631616,-0.28774464431466656,-0.7906573101344957,-0.687996635379707,-0.11354628478119068,-0.8011251205640022,-0.03342929320838998,-0.32094616903241935,-1.4211362511884478,-3.664811151821268,-0.04060463977183884,-0.04950762379200704,-0.17141750084617183,-0.7748164640936469,-0.5199959758905001,-1.228409846100543,-0.23222769088887038,-1.5749904466595972,-7.964235458215157,-0.11030317536323977,-2.8811396524219317,-0.00040882896945158094,-0.2328806490171041,-0.3351331724540072,-0.06897930666680019,-1.735948854100128,-0.0005361326394857451,-6.108921214752805e-7,-0.10253037552948001,-0.2799413683159518,-0.55795228154902,-0.8200539790291801,-0.07055327552809607,-0.0803167615592665,-0.0551355588592214,-0.4097990755542149,-0.4916076731347771,-0.7062052963202784,-0.050317484703568595,-5.568130849109662,-0.32735936456089987,-0.037210720887252295,-0.00025456066382481047,-0.30884688620031897,-0.008467909985898229,-0.18676063081803257,-0.23919664978739238,-0.046381211203995486,-0.0811511324099812,-0.0005253516783639587,-0.0019519160812366198,-0.00005014722225537961,-0.11196204268826704,-0.4316719854271179,-0.43850794962759926,-0.7645125300937715,-0.0000038755427643654804,-1.8824934477688358,-0.07692247625101804,-0.004339612917078046,-0.2068437524189459,-0.35812053795764737,-0.052304412180378915,-0.17771811630724513,-1.550490642684243,-9.595646978740579,-0.0417940687180648,-0.051740462262323074,-0.6992238732022676,-6.737501917158436,-0.045738485233828514,-0.0705950544611122,-0.012254732418359938,-0.9595129508683589,-5.5816645069119515,-0.030038190758898686,-0.041007821318078744,-1.2465017770960585,-0.0001888754998451552,-0.0000021612395692313078,-0.08365227826666131,-0.030956863238682936,-0.17367023064685372,-1.0004109640682204,-0.06423147242973586,-0.4509102170926195,-0.39454790681612634,-0.010028995456896388,-0.19367746709766134,-0.731877683617431,-0.3728089064743104,-0.02682294135442013,-0.4195534815490134,-0.008650520543547926,-0.37545299594684206,-0.00967505478989579,-0.07669450733886374,-5.4268044563991,-0.0017420323319416286,-0.018402068605635955,-0.004597804642062903,-0.000058176398991898514,-0.25323432671735785,-0.0002596827473807218,-0.023775169185662966,-0.00997725844740012,-0.04417572949392216,-0.23682964705393278,-0.301021479982257,-0.0004240886346356194,-0.1849493596525716,-4.288269065873074,-0.03442932910340523,-0.06637539257822991,-0.03882062676099761,-0.16426509534781342,-0.0010703820941151455,-0.0001604943563119773,-0.0000013353929182080627,-0.01953347811725757,-0.12899622991197982,-6.751533768848819,-0.04667563048623331,-0.09470927614643354,-2.27910372797462,-1.6618202565013769,-0.43673483527847645,-0.4867413894921576,-0.8357894407805873,-0.001635600982589776,-0.6796391357109476,-0.029355797944730356,-0.0018081559653806028,-0.000026683147789097266,-1.4090764891834984,-1.6361123442980336,-0.5930530704758534,-3.934170768903029e-7,-0.19693045423670122,-0.3048458209923695,-0.12254644451546355,-0.0025595001111089854,-2.1036091273040842,-4.677609704350085,-0.20704394877564875,-0.00009492815540786622,-0.024804694271926005,-0.04930834952922773,-0.1414447710083355,-0.028725946581680168,-0.17891300982144268,-0.6864005912683149,-4.421107270124348,-0.0019428561170601276,-0.610825937520542,-0.4465656437357025,-0.23447451140083433,-0.9407752446107619,-14.48766190091961,-0.18153705366413792,-0.20331750588801004,-0.000007823355161431187,-3.4231114853546174,-0.1470911042620182,-0.05432541507180882,-0.70243908032174,-0.031845512014115944,-0.15010954472879517,-1.244008113071757,-0.000014629863018681314,-0.08581038804704402,-4.400766456065593,-2.954233432995397,-0.041175687460949614,-0.02683994113475339,-0.0051658146822019,-0.05386918271902506,-0.012355064980985053,-0.9057351087103473,-0.778895952155589,-0.0042050568285762055,-0.10501328496451762,-3.518404365189279,-0.4922488281226207,-2.2739121413905035,-0.7972684449067989,-0.3482139674120499,-0.03179827942037405,-0.25755093670171875,-0.0029999728922672384,-9.145453609357915,-0.002171881352775085,-0.00006265518139959581,-0.432528569683958,-0.000025114150379052035,-1.659413822276096,-0.07251903693956722,-0.05726897928217726,-0.04252172557809776,-0.0000067622625358576825,-0.027401540547222835,-0.015173030605986543,-0.4421176861232665,-6.24531629482188,-0.2722881044358704,-0.028738764720859733,-1.024134100449718,-0.07009372239844436,-7.352253613261118,-2.120254283517365,-0.34604470733923043,-0.9630225826084312,-0.06504018504702262,-0.0031665380009467353,-6.8830494946148475,-0.011472566147193507,-0.21269772655976327,-0.036152032363717404,-0.9102287109951905,-6.46058521686028,-0.015965194801864403,-0.0008060602811739481,-0.1709294905140513,-0.0043531123384734395,-0.04427584203462474,-0.0000031417554695140557,-0.13694774172845087,-0.22712485592792814,-0.03443375410685603,-0.027477800453820627,-5.335511199979854,-1.5875406767626243,-1.5183812979575908,-0.41980386752729154,-0.07842243343763133,-0.9857891305691052,-0.010544026855595627,-0.3018869658945426,-0.00897177659867643,-5.715242262176037,-0.0051803641073218405,-0.0054503965076060775,-0.15037438086982718,-0.15548110626719444,-0.792111446603401,-0.0528504353788763,-0.5932198596138151,-0.0024356799982333754,-1.7545999700591455,-1.4143334435771897,-0.79318541301578,-1.2132000127415594,-0.005928365435845787,-0.5116639263628645,-0.025670048613602777,-1.1182787009298918,-0.027937065702692738,-1.9828422895028648,-0.4099958248497807,-0.7452257868105922,-0.00022122212210212431,-0.6005145116498747,-0.018991240671994328,-0.002356256055190529,-0.002026253191095952,-0.05181067199321174,-0.0006009532313765629,-0.01181007363772104,-2.020640733633572,-0.11611752728362862,-0.24221341523282586,-0.13892424730748076,-0.4784042147330633,-0.4567618175418411,-5.232573973600476,-0.2644921668335203,-0.041955654204986044,-0.0010376329786320495,-0.11674557448146702,-0.05733262233879937,-0.003235729757691219,-0.0001382132253647525,-0.01820694878219502,-0.21862382275739134,-0.0007574131892375947,-0.023739442182475617,-0.03696690465134211,-0.16483446241331579,-0.27189535968452405,-6.294130566162414,-0.062156644908256745,-0.39413480496175124,-0.02642018249896734,-0.0006740144485035471,-0.024112298737470488,-0.9127193790628152,-3.1916039762052875,-0.589874238091957,-0.6949748689118181,-0.2536144742662069,-0.02470822011028319,-0.02907779299422895,-0.014496657659513862,-0.0031008176393468243,-0.5901908812268882,-0.3423245639243202,-0.173662948950155,-0.001168702235457529,-0.00007049767039124549,-0.943099358191817,-0.07009130052114194,-0.0133595603601437,-0.0021853552167963816,-0.022336414978118873,-2.0539615727586664,-0.003508455528970483,-0.07555076462276442,-0.2122872792746778,-0.16223687421054664,-0.4468223699547622,-0.049430486265600336,-0.05294410704430985,-0.13242172327844456,-0.006486693879348924,-0.026632031642892438,-0.26389441021446525,-0.9520624871470693,-0.5403829652286911,-0.36258534370480416,-0.30670917826377936,-1.6874679577707217,-0.038603319550683586,-0.032034444789702146,-0.000006843187415996053,-0.015097971717905502,-0.06687686594533399,-0.6947705500939275,-2.620042918604398,-0.05947765801486127,-0.000013869147291607109,-0.22609555594092992,-0.18503021270560882,-0.035160514829700444,-0.07578983142622699,-0.013456152593514188,-0.0664829827616711,-0.000029573312023255225,-0.2330633226121126,-0.03134876144916505,-0.18903109382270547,-1.3343123495412423,-6.812596566652685,-0.5883689052947687,-0.00975334487125267,-0.030531947364715796,-0.0000012299356670514068,-12.858430698379195,-0.24676277851515965,-0.12407103480584973,-0.02942619590393217,-0.046395237963823,-0.5162704698230471,-0.004665573975443375,-0.026601150148582272,-0.7561060238400441,-0.0010926127228799,-0.0009941825107967434,-0.08359377469833708,-0.05290977638042984,-0.004189968182544312,-0.1878684791519968,-0.004339477710165148,-0.03930402778786146,-1.534053064074895,-0.022633668115586453,-0.00545844153093331,-4.588557681054113,-0.0031298962666844697,-0.008808382712070947,-0.016161209573865788,-0.23068031814938644,-6.56109416687733,-0.15979960517950942,-0.5095909803340181,-3.8894115712871176,-0.20735862616410705,-1.7249617587219,-0.13585727420000107,-0.7450706127014621,-0.10326990762739467,-0.0005734759848457287,-0.17357702307661585,-0.00952914691910775,-0.1741384289596466,-0.8197632421464449,-0.1648615193559768,-1.5627204705600812,-0.12891943307697404,-0.16672355547469017,-0.2652022122712719,-0.001722802833753802,-0.08845593483422824,-0.021005523463547948,-0.0029696619805049886,-0.23348610586480018,-0.02615013952345562,-3.0365076830790203,-0.03751755241844528,-0.4751407258237891,-0.0009979722224759586,-0.003127663324315572,-0.29959599805964654,-0.004228171676729344,-0.02019416721825576,-0.26958971482758515,-1.0239381957788818,-0.05376452940870254,-0.0002509992539568992,-0.2926209200330506,-0.0715999523323796,-0.10966642357720927,-0.28749155400215876,-0.06723417034629381,-0.010202857631964796,-0.0018089425026720071,-0.062022856261650966,-0.18508361655214345,-0.08652104578347394,-0.0002697717210655459,-0.39114611647946884,-0.12887147304098465,-0.22799145071300467,-0.051515544163630356,-0.057344385101273106,-0.006517882092334362,-0.0025115570957687334,-0.000845066398991972,-0.7999517085840684,-0.14154609514582414,-1.7437516286949327e-7,-0.011358389017815397,-0.1412906865195829,-7.045916278494138,-0.06926368908877735,-0.2886905730778699,-0.18070132001767525,-0.19232577395482262,-0.35708088218776163,-0.3808246689358913,-3.0277111650895794,-0.12154450919070967,-1.3898491292520234,-0.2332766979027832,-0.0005972023762858783,-0.011809585128795538,-0.04510735052673652,-0.042449828713851744,-0.5009818606966576,-0.009987908220249012,-0.289136631070387,-0.3953261834831591,-3.699966782890402,-4.106936362097962,-0.004700275749850373,-2.700139795630566,-0.052246389129674484,-0.1204643467751604,-0.02644330251834852,-1.2698572025507189,-0.5499874984528254,-0.09026839446297615,-1.261005848616112,-1.8039656771803905,-0.0005574873195945935,-0.5514474903217351,-0.079087614397785,-0.04460956467421189,-0.1600909852325394,-0.931601798111854,-0.18161924625557857,-0.001258317205026575,-5.535227399723423,-0.049089201821511,-13.240390808785637,-0.09657568816317816,-0.031827656056351336,-0.0021263469956119964,-0.00016739294643915707,-0.41950606039503047,-0.0005716422260139091,-0.35662673315777593,-2.4321109664980556,-0.00003838349369615885,-0.1432871040345974,-0.2825550818523087,-0.4582357657703868,-0.9937129842599959,-0.47637123877128296,-0.003704115155043065,-0.1362009829010105,-0.024469334853335432,-0.18688303319278418,-0.3455427386483684,-0.2460503409845866,-3.9153867637263207,-0.2239182445162709,-0.13333479862613534,-0.45884372341583557,-0.04158896369073618,-0.09455897954593107,-0.00035447920859063017,-0.5382036034619893,-0.02938130906572444,-0.7950657826832458,-0.2636040206287518,-3.5058971689429748,-0.018183998774705577,-0.3715541174927217,-0.6936763651198887,-0.40724202346101873,-0.02413042095105987,-0.15265484692704745,-0.25060300505323774,-4.238204423324102,-3.566393471767457,-0.38501125817647214,-0.29438175180541676,-0.7724613715683084,-0.11241413041567035,-13.740670084630104,-0.13936511080771757,-0.046128582181268585,-0.24422995496001124,-0.05723825289009926,-0.5156059712818246,-0.2633147043231667,-1.8109134197268066,-0.011987034810742475,-0.1439308551965883,-0.4609265057195503,-0.00011304585241649126,-1.3636404333685828,-0.0012128441600011651,-0.19749370862498114,-2.8169668297159927,-1.7791462785309635,-4.169060332099359,-0.0012109444776184407,-0.564724719978235,-1.0641876174820921,-4.609029203835227,-0.005438312486122992,-0.052551997641415306,-0.10072787368483442,-0.6814606830193337,-9.319129040390449,-2.566289534897925,-0.6959583976239623,-0.0034571391158525295,-0.003737887296258491,-0.3891693535837576,-0.16070763946100144,-0.16170123825004523,-1.0906677256228756,-0.000039592902170030375,-0.5318245991232806,-0.28060360368145504,-0.32364997056757744,-0.0053674172930854025,-0.17248889144158686,-0.21174603782262416,-4.851479342709724,-0.47019700639895873,-0.12546447268309863,-5.988720222638029,-0.3406451269648725,-0.19080372677611185,-0.3407789457262362,-5.151256633175426,-0.27331962897351225,-0.09086748972720152,-0.000013320838299956622,-0.046617045522086675,-7.184448535247805,-0.45669986406354174,-0.4308143021151253,-0.0220419908274262,-0.011503369642072086,-0.00022003167564230627,-1.0126355488034808,-0.0035846458146870817,-0.20236423486393174,-5.959825065281823,-0.6122835114949228,-0.014565098585154309,-0.02446701259945834,-0.00014201245045743278,-0.34891534212963066,-0.000018299289342949443,-0.03540771448545177,-4.936767557384124,-0.0009962589193332188,-0.045728686872139615,-0.01078001550565654,-0.006978915826325574,-0.012408172053467652,-0.00014956069100473062,-0.00009014704252754445,-0.0005067133652907179,-0.00008419786300990953,-0.17421055795681056,-0.00001296391074757288,-0.39778395560470087,-0.06895113718922583,-0.002766361358005837,-0.872707956013278,-0.05193623471091462,-0.7994446798138706,-0.006287782737443912,-0.027628527925605058,-4.979259301029915,-0.8738610699762565,-3.4247860414401283,-0.5490054492822805,-0.011626786841091101,-0.31166329956547634,-0.02413279415992567,-0.021159135814411426,-0.010005145543496559,-8.07438306809022,-3.9640193814007714,-1.1337972974212587,-0.2896992957749135,-0.2585935466939174,-0.012792165841621695,-0.45458699481384623,-0.017302984690284393,-0.015420076924960294,-0.29962617387450613,-2.1269592896303466,-0.0005119902058276187,-0.053276675407584365,-0.3129699045936243,-0.7029716804775492,-0.1583180660056352,-0.000043956020463875546,-0.019464887541392223,-0.017943399667522057,-4.9012568870197795,-0.0007142321431009957,-0.07799422084687788,-0.12897215026127914,-0.7295883412541273,-0.0590143437163058,-0.001171808071799294,-0.24435319414802492,-0.013501392869783704,-0.9914780531530971,-0.3250329186052333,-0.00008204146941794327,-0.4393796544237246,-0.0416747825433688,-0.0007713222036924624,-1.1470819872334037,-0.20036501422887573,-0.33520975937824443,-0.09983825160482919,-0.244383033849618,-3.9826831829860754,-0.00006545542469059602,-0.9620104901133574,-0.10151038219582537,-0.007493013595661552,-0.0752143735433514,-0.3934242134880959,-0.13259626495032123,-0.01074295836035955,-0.0019020915674996808,-0.4438248491223643,-0.9103049227191735,-0.4619654958358755,-0.09280898100548932,-0.0012546010499873976,-0.27080381592230207,-0.40555793395239387,-2.0566614817499356,-0.000006933587609090863,-5.124566775906513,-0.0013770050935432265,-0.5025361099087815,-0.2531920825376572,-0.29083399840545554,-0.00013638619802854571,-0.4779377928332097,-0.09872791205432614,-0.021779134864043745,-0.004565835003177043,-0.0010391145457425768,-0.002690095547405092,-0.34660428172709906,-1.0047563115656284,-0.027369196324602534,-0.3221840056507691,-0.04837656549126973,-0.01215051517377987,-0.014425374361445621,-0.04710459268217869,-0.2140922122755574,-2.666626539123424,-0.6922212589679596,-0.0007144257614362142,-0.3644289138618683,-0.015100599667641655,-0.9319992414824635,-0.0013013751478587092,-4.521074929081987,-0.06585412581096918,-2.0621312149659152,-3.2128027868680786,-0.04092959158453875,-0.14277219253583576,-0.024890688587953437,-0.4992553044748783,-0.0029422123517553224,-0.0024007899961650927,-0.28127778228566225,-1.7845319607036916,-0.8288958476961328,-1.4188449462579262,-0.005861187995676905,-0.22634327212540448,-0.26948756025690596,-0.0007189031693772119,-0.026132625523501235,-0.0000017572218289192993,-1.1846844527533562,-0.016803153423035195,-4.190046443093678,-0.000031679331980291435,-0.06524326991050375,-0.06403451191614543,-0.06531811502602017,-1.4232858377217923,-0.16260379865851995,-1.1461661675170731,-0.05585582701727176,-0.008461647286303015,-0.12442106368867942,-1.0123345058524187,-4.480183133111524,-0.013715932194590977,-0.23960615701309756,-0.17662947985492894,-0.001955590121872247,-0.03540164205287393,-0.0069246487714882425,-0.054631365145389806,-0.02553897002685563,-0.5492808488719355,-0.4156103884637766,-0.029070797500081593,-0.0007570268659934426,-0.17236932309154868,-0.18007028365529731,-0.011305238093315819,-0.24884179464660078,-0.008521188134176554,-0.037457061145974524,-0.0013100129483151269,-0.20924492342329093,-1.0536330883796003,-0.0022109814707186627,-3.8972756659442527,-0.0003282390090152454,-0.25183086769320173,-0.00005317710431249525,-1.0362130392381035,-0.036268315960297635,-0.003970511588546919,-0.045220003256514416,-0.0026243666891197213,-0.06630819506487538,-0.021727493675351213,-0.021369828238572593,-6.8188102168485045,-0.40663616114219914,-6.179521758754084,-6.782919858066964,-0.0035943185032682725,-0.00014172778817772845,-0.0054373247279689485,-0.32075456181903483,-0.037022895242130205,-0.5881726273033372,-0.00000719520132922002,-2.194201901816587,-0.754920518562708,-0.03836024836905786,-0.0013505215353490445,-0.05585090131600395,-0.0022590885361048374,-0.0018738561800480415,-0.20497848783696043,-13.362263675044208,-3.5831386539239136,-0.05657393222882532,-0.026029859670706302,-0.03601921458545254,-0.04457394126878293,-0.9033120370262688,-1.0470374668698181,-0.008272342822878673,-0.000002865543545707408,-0.00574716018116141,-0.045456692908269015,-4.169800990039665,-0.0031462584871716514,-0.4080987226596065,-0.000006138394837225131,-0.020327412484089858,-0.002117400189760892,-0.19239082909325225,-4.299204641767703,-4.571677332315526,-5.841231048896868,-0.002126227623714101,-0.2698473860594218,-3.580847506806401,-1.1387518118149886,-0.22708645093924076,-0.0002173047257848036,-0.01443967856757625,-0.3284355949349936,-5.859126829405473,-0.01182962692067088,-0.17115735173440547,-0.4851110492004176,-0.13912623213492104,-0.5990113638241454,-0.10308128481484566,-0.08545426710504779,-0.48152273977388177,-0.0010006436180732257,-0.6090734405132893,-0.41285932698733546,-0.000001916826512275085,-0.27001703075227845,-0.4305521925609049,-0.0005775610033127826,-0.26082502865746765,-2.014830957088316,-0.13998284028871427,-0.28821234896407,-0.21429211460845102,-6.041939852713297,-3.430135573395985,-0.5344858145176703,-0.5250254595339039,-0.055046880885321545,-0.0016986427092908262,-0.01745424431103642,-0.01128073986299074,-0.3120443846490258,-0.007239897771028088,-0.025772428164313917,-0.00007003326624770936,-0.8207651947393473,-0.6739384934744702,-0.00005408301576692643,-1.8951253558853984,-0.0013886080217523531,-0.14308713452683663,-0.0662586374806604,-0.29535613734983823,-1.498354726689604,-0.09359307757807114,-0.7087087436065368,-0.4529616446654688,-0.0012231181560254287,-0.07591992300886638,-0.054524806805012906,-0.8697543318484231,-0.22211099663309433,-1.0042073808070118,-0.3346292798023307,-4.773917574883746,-0.006429578081398228,-0.1582968798714344,-0.5911281676506956,-9.013491575140893,-0.14719875755871537,-0.43000463343132816,-0.010275188985558363,-0.11103470120731546,-0.000029523789843238846,-0.09934437410063955,-0.000034875580938041495,-0.07232552183194316,-0.24379267651930833,-0.004936340226020504,-0.01800367374841131,-0.0062384036025611884,-0.7620419719567728,-0.0036982378467920137,-0.191907241781891,-2.1344043460292053,-0.11034690315492654,-2.8193459951783573,-0.2782893256611627,-0.00005956766754491902,-0.10802464850370377,-0.00025002882952682745,-0.0031366983448545397,-1.019084130954628,-1.5292107197980298,-0.001387204368406556,-2.935834664050009,-0.19221649923358103,-1.5881599558164885,-0.008295469991221608,-0.04587414103693823,-0.8127637792608188,-0.5007603684030703,-0.025708227587221286,-0.10755952649000501,-0.0007593705608769222,-0.006408566395277739,-0.5583026226985697,-0.10626541928795498,-12.564910719725194,-0.6760186245685808,-0.23826839257194138,-1.280872296408379,-7.654655683713306,-1.0371514902893908,-0.010856890952326668,-0.5685153653743573,-5.140094187633266,-0.02751927013722982,-0.0028950453167869133,-4.003703259390728,-0.0004876912640142787,-0.22018705227701882,-0.14510583726137874,-0.00873835465449039,-0.20821173151814193,-0.16211616224047423,-0.26487903977888927,-0.34770426325927983,-0.21323168269824666]} diff --git a/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/test/fixtures/julia/runner.jl b/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/test/fixtures/julia/runner.jl new file mode 100644 index 000000000000..588644a6d22b --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/test/fixtures/julia/runner.jl @@ -0,0 +1,77 @@ +#!/usr/bin/env julia +# +# @license Apache-2.0 +# +# Copyright (c) 2026 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import Distributions: logcdf, LogLogistic +import JSON + +""" + gen( x, alpha, beta, name ) + +Generate fixture data and write to file. + +# Arguments + +* `x`: input value +* `alpha`: scale parameter +* `beta`: shape parameter +* `name::AbstractString`: output filename + +# Examples + +``` julia +julia> x = rand( 1000 ) .* 15.0; +julia> alpha = rand( 1000 ) .* 5.0 .+ 0.5; +julia> beta = rand( 1000 ) .* 5.0 .+ 0.5; +julia> gen( x, alpha, beta, "data.json" ); +``` +""" +function gen( x, alpha, beta, name ) + z = Array{Float64}( undef, length(x) ); + for i in eachindex(x) + z[ i ] = logcdf( LogLogistic( alpha[i], beta[i] ), x[i] ); + end + + # Store data to be written to file as a collection: + data = Dict([ + ("x", x), + ("alpha", alpha), + ("beta", beta), + ("expected", z) + ]); + + # Based on the script directory, create an output filepath: + filepath = joinpath( dir, name ); + + # Write the data to the output filepath as JSON: + outfile = open( filepath, "w" ); + write( outfile, JSON.json(data) ); + write( outfile, "\n" ); + close( outfile ); +end + +# Get the filename: +file = @__FILE__; + +# Extract the directory in which this file resides: +dir = dirname( file ); + +# Generate fixture data: +x = rand( 1000 ) .* 15.0; +alpha = ( rand( 1000 ) .* 5.0 ) .+ 0.5; +beta = ( rand( 1000 ) .* 5.0 ) .+ 0.5; +gen( x, alpha, beta, "data.json" ); diff --git a/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/test/test.factory.js b/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/test/test.factory.js new file mode 100644 index 000000000000..cf1f1e932166 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/test/test.factory.js @@ -0,0 +1,158 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var NINF = require( '@stdlib/constants/float64/ninf' ); +var isAlmostSameValue = require( '@stdlib/assert/is-almost-same-value' ); +var factory = require( './../lib/factory.js' ); + + +// FIXTURES // + +var data = require( './fixtures/julia/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 logcdf = factory( 1.0, 1.0 ); + t.strictEqual( typeof logcdf, 'function', 'returns expected value' ); + t.end(); +}); + +tape( 'if provided `NaN` for any parameter, the returned function always returns `NaN`', function test( t ) { + var logcdf; + + logcdf = factory( NaN, 1.0 ); + t.strictEqual( isnan( logcdf( 1.0 ) ), true, 'returns expected value' ); + + logcdf = factory( 1.0, NaN ); + t.strictEqual( isnan( logcdf( 1.0 ) ), true, 'returns expected value' ); + + logcdf = factory( NaN, NaN ); + t.strictEqual( isnan( logcdf( 1.0 ) ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if provided a non-positive `alpha`, the returned function always returns `NaN`', function test( t ) { + var logcdf; + + logcdf = factory( 0.0, 1.0 ); + t.strictEqual( isnan( logcdf( 1.0 ) ), true, 'returns expected value' ); + + logcdf = factory( -1.0, 1.0 ); + t.strictEqual( isnan( logcdf( 1.0 ) ), true, 'returns expected value' ); + + logcdf = factory( NINF, 1.0 ); + t.strictEqual( isnan( logcdf( 1.0 ) ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if provided a non-positive `beta`, the returned function always returns `NaN`', function test( t ) { + var logcdf; + + logcdf = factory( 1.0, 0.0 ); + t.strictEqual( isnan( logcdf( 1.0 ) ), true, 'returns expected value' ); + + logcdf = factory( 1.0, -1.0 ); + t.strictEqual( isnan( logcdf( 1.0 ) ), true, 'returns expected value' ); + + logcdf = factory( 1.0, NINF ); + t.strictEqual( isnan( logcdf( 1.0 ) ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the returned function returns `NaN` if provided `NaN` for `x`', function test( t ) { + var logcdf; + var y; + + logcdf = factory( 1.0, 1.0 ); + + y = logcdf( NaN ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the returned function returns `-Infinity` if provided `x <= 0`', function test( t ) { + var logcdf; + var y; + + logcdf = factory( 1.0, 1.0 ); + + y = logcdf( 0.0 ); + t.strictEqual( y, NINF, 'returns expected value' ); + + y = logcdf( -1.0 ); + t.strictEqual( y, NINF, 'returns expected value' ); + + y = logcdf( NINF ); + t.strictEqual( y, NINF, 'returns expected value' ); + + t.end(); +}); + +tape( 'the returned function does not overflow for large `x` (approaching zero)', function test( t ) { + var logcdf; + var y; + + logcdf = factory( 1.0, 60.0 ); + y = logcdf( 1.0e6 ); + t.strictEqual( y, 0.0, 'returns expected value' ); + + logcdf = factory( 1.0, 5.0 ); + y = logcdf( 1.0e300 ); + t.strictEqual( y, 0.0, 'returns expected value' ); + + t.end(); +}); + +tape( 'the returned function evaluates the log-logistic logcdf for positive `x`, `alpha`, and `beta`', function test( t ) { + var expected; + var logcdf; + var alpha; + var beta; + var x; + var y; + var i; + + expected = data.expected; + x = data.x; + alpha = data.alpha; + beta = data.beta; + for ( i = 0; i < x.length; i++ ) { + logcdf = factory( alpha[ i ], beta[ i ] ); + y = logcdf( x[ i ] ); + t.strictEqual( isAlmostSameValue( y, expected[ i ], 2 ), true, 'x: '+x[ i ]+', alpha: '+alpha[ i ]+', beta: '+beta[ i ]+', y: '+y+', expected: '+expected[ i ] ); + } + t.end(); +}); diff --git a/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/test/test.js b/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/test/test.js new file mode 100644 index 000000000000..b45719a84984 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/test/test.js @@ -0,0 +1,38 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var logcdf = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof logcdf, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'attached to the main export is a factory method for generating `logcdf` functions', function test( t ) { + t.strictEqual( typeof logcdf.factory, 'function', 'exports a factory method' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/test/test.logcdf.js b/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/test/test.logcdf.js new file mode 100644 index 000000000000..3afe09285e7d --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/test/test.logcdf.js @@ -0,0 +1,138 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var NINF = require( '@stdlib/constants/float64/ninf' ); +var isAlmostSameValue = require( '@stdlib/assert/is-almost-same-value' ); +var logcdf = require( './../lib' ); + + +// FIXTURES // + +var data = require( './fixtures/julia/data.json' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof logcdf, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'if provided `NaN` for any parameter, the function returns `NaN`', function test( t ) { + var y; + + y = logcdf( NaN, 1.0, 1.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = logcdf( 0.5, NaN, 1.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = logcdf( 0.5, 1.0, NaN ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = logcdf( NaN, NaN, NaN ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if provided a non-positive `alpha`, the function returns `NaN`', function test( t ) { + var y; + + y = logcdf( 1.0, 0.0, 1.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = logcdf( 1.0, -1.0, 1.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = logcdf( 1.0, NINF, 1.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if provided a non-positive `beta`, the function returns `NaN`', function test( t ) { + var y; + + y = logcdf( 1.0, 1.0, 0.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = logcdf( 1.0, 1.0, -1.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = logcdf( 1.0, 1.0, NINF ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if provided `x <= 0`, the function returns `-Infinity`', function test( t ) { + var y; + + y = logcdf( 0.0, 1.0, 1.0 ); + t.strictEqual( y, NINF, 'returns expected value' ); + + y = logcdf( -1.0, 1.0, 1.0 ); + t.strictEqual( y, NINF, 'returns expected value' ); + + y = logcdf( -10.0, 2.0, 3.0 ); + t.strictEqual( y, NINF, 'returns expected value' ); + + y = logcdf( NINF, 1.0, 1.0 ); + t.strictEqual( y, NINF, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function does not overflow for large `x` (approaching zero)', function test( t ) { + var y; + + y = logcdf( 1.0e6, 1.0, 60.0 ); + t.strictEqual( y, 0.0, 'returns expected value' ); + + y = logcdf( 1.0e300, 1.0, 5.0 ); + t.strictEqual( y, 0.0, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function evaluates the log-logistic logcdf for positive `x`, `alpha`, and `beta`', function test( t ) { + var expected; + var alpha; + var beta; + var x; + var y; + var i; + + expected = data.expected; + x = data.x; + alpha = data.alpha; + beta = data.beta; + for ( i = 0; i < x.length; i++ ) { + y = logcdf( x[ i ], alpha[ i ], beta[ i ] ); + t.strictEqual( isAlmostSameValue( y, expected[ i ], 2 ), true, 'x: '+x[ i ]+', alpha: '+alpha[ i ]+', beta: '+beta[ i ]+', y: '+y+', expected: '+expected[ i ] ); + } + t.end(); +}); diff --git a/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/test/test.native.js b/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/test/test.native.js new file mode 100644 index 000000000000..e4045cb359ac --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/log-logistic/logcdf/test/test.native.js @@ -0,0 +1,135 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var tape = require( 'tape' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var NINF = require( '@stdlib/constants/float64/ninf' ); +var isAlmostSameValue = require( '@stdlib/assert/is-almost-same-value' ); + + +// VARIABLES // + +var logcdf = tryRequire( resolve( __dirname, './../lib/native.js' ) ); +var opts = { + 'skip': ( logcdf instanceof Error ) +}; + + +// FIXTURES // + +var data = require( './fixtures/julia/data.json' ); + + +// TESTS // + +tape( 'main export is a function', opts, function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof logcdf, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'if provided `NaN` for any parameter, the function returns `NaN`', opts, function test( t ) { + var y; + + y = logcdf( NaN, 1.0, 1.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = logcdf( 0.5, NaN, 1.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = logcdf( 0.5, 1.0, NaN ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = logcdf( NaN, NaN, NaN ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if provided a non-positive `alpha`, the function returns `NaN`', opts, function test( t ) { + var y; + + y = logcdf( 1.0, 0.0, 1.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = logcdf( 1.0, -1.0, 1.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = logcdf( 1.0, NINF, 1.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if provided a non-positive `beta`, the function returns `NaN`', opts, function test( t ) { + var y; + + y = logcdf( 1.0, 1.0, 0.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = logcdf( 1.0, 1.0, -1.0 ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + y = logcdf( 1.0, 1.0, NINF ); + t.strictEqual( isnan( y ), true, 'returns expected value' ); + + t.end(); +}); + +tape( 'if provided `x <= 0`, the function returns `-Infinity`', opts, function test( t ) { + var y; + + y = logcdf( 0.0, 1.0, 1.0 ); + t.strictEqual( y, NINF, 'returns expected value' ); + + y = logcdf( -1.0, 1.0, 1.0 ); + t.strictEqual( y, NINF, 'returns expected value' ); + + y = logcdf( -10.0, 2.0, 3.0 ); + t.strictEqual( y, NINF, 'returns expected value' ); + + y = logcdf( NINF, 1.0, 1.0 ); + t.strictEqual( y, NINF, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function evaluates the log-logistic logcdf for positive `x`, `alpha`, and `beta`', opts, function test( t ) { + var expected; + var alpha; + var beta; + var x; + var y; + var i; + + expected = data.expected; + x = data.x; + alpha = data.alpha; + beta = data.beta; + for ( i = 0; i < x.length; i++ ) { + y = logcdf( x[ i ], alpha[ i ], beta[ i ] ); + t.strictEqual( isAlmostSameValue( y, expected[ i ], 2 ), true, 'x: '+x[ i ]+', alpha: '+alpha[ i ]+', beta: '+beta[ i ]+', y: '+y+', expected: '+expected[ i ] ); + } + t.end(); +});