diff --git a/.gitattributes b/.gitattributes index 10a16e6..1c88e69 100644 --- a/.gitattributes +++ b/.gitattributes @@ -40,10 +40,27 @@ *.mov binary # Override what is considered "vendored" by GitHub's linguist: -/deps/** linguist-vendored=false -/lib/node_modules/** linguist-vendored=false linguist-generated=false -test/fixtures/** linguist-vendored=false -tools/** linguist-vendored=false +/lib/node_modules/** -linguist-vendored -linguist-generated -# Override what is considered "documentation" by GitHub's linguist: -examples/** linguist-documentation=false +# Configure directories which should *not* be included in GitHub language statistics: +/deps/** linguist-vendored +/dist/** linguist-generated +/workshops/** linguist-vendored + +benchmark/** linguist-vendored +docs/* linguist-documentation +etc/** linguist-vendored +examples/** linguist-documentation +scripts/** linguist-vendored +test/** linguist-vendored +tools/** linguist-vendored + +# Configure files which should *not* be included in GitHub language statistics: +Makefile linguist-vendored +*.mk linguist-vendored +*.jl linguist-vendored +*.py linguist-vendored +*.R linguist-vendored + +# Configure files which should be included in GitHub language statistics: +docs/types/*.d.ts -linguist-documentation diff --git a/.github/workflows/productionize.yml b/.github/workflows/productionize.yml index ec90164..f92a6c5 100644 --- a/.github/workflows/productionize.yml +++ b/.github/workflows/productionize.yml @@ -344,7 +344,6 @@ jobs: uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2 with: status: ${{ job.status }} - steps: ${{ toJson(steps) }} channel: '#npm-ci' if: failure() @@ -518,7 +517,6 @@ jobs: uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2 with: status: ${{ job.status }} - steps: ${{ toJson(steps) }} channel: '#npm-ci' if: failure() @@ -698,7 +696,6 @@ jobs: uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2 with: status: ${{ job.status }} - steps: ${{ toJson(steps) }} channel: '#npm-ci' if: failure() diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 3eec50e..ad3a3e0 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -218,7 +218,6 @@ jobs: uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2 with: status: ${{ job.status }} - steps: ${{ toJson(steps) }} channel: '#npm-ci' if: failure() diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9babded..0a0519a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -95,6 +95,5 @@ jobs: uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2 with: status: ${{ job.status }} - steps: ${{ toJson(steps) }} channel: '#npm-ci' if: failure() diff --git a/.github/workflows/test_bundles.yml b/.github/workflows/test_bundles.yml index 6d77abd..5b5879a 100644 --- a/.github/workflows/test_bundles.yml +++ b/.github/workflows/test_bundles.yml @@ -94,7 +94,6 @@ jobs: uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2 with: status: ${{ job.status }} - steps: ${{ toJson(steps) }} channel: '#npm-ci' if: failure() @@ -139,7 +138,6 @@ jobs: uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2 with: status: ${{ job.status }} - steps: ${{ toJson(steps) }} channel: '#npm-ci' if: failure() @@ -184,6 +182,5 @@ jobs: uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2 with: status: ${{ job.status }} - steps: ${{ toJson(steps) }} channel: '#npm-ci' if: failure() diff --git a/.github/workflows/test_coverage.yml b/.github/workflows/test_coverage.yml index f4eda1e..2bcf0cd 100644 --- a/.github/workflows/test_coverage.yml +++ b/.github/workflows/test_coverage.yml @@ -119,7 +119,6 @@ jobs: uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2 with: status: ${{ job.status }} - steps: ${{ toJson(steps) }} channel: '#npm-ci' if: failure() diff --git a/.github/workflows/test_install.yml b/.github/workflows/test_install.yml index 940ebbd..56c0901 100644 --- a/.github/workflows/test_install.yml +++ b/.github/workflows/test_install.yml @@ -81,6 +81,5 @@ jobs: uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2 with: status: ${{ job.status }} - steps: ${{ toJson(steps) }} channel: '#npm-ci' if: failure() diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 4500383..67abc19 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -5,6 +5,7 @@ Adarsh Palaskar Aditya Sapra AgPriyanshu18 <113460573+AgPriyanshu18@users.noreply.github.com> +Aleksandr <112382387+alextes90@users.noreply.github.com> Ali Salesi Aman Bhansali Amit Jimiwal @@ -18,6 +19,7 @@ Chinmay Joshi <86140365+JawHawk@users.noreply.github.com> Christopher Dambamuromo Dan Rose Daniel Killenberger +Daniel Yu <40680511+Daniel777y@users.noreply.github.com> Dominik Moritz Dorrin Sotoudeh EuniceSim142 <77243938+EuniceSim142@users.noreply.github.com> @@ -69,8 +71,11 @@ Seyyed Parsa Neshaei Shashank Shekhar Singh Shivam <11shivam00@gmail.com> Shraddheya Shendre +Shubh Mehta <93862397+Shubh942@users.noreply.github.com> Shubham Mishra +Sivam Das <100067002+Sivam2313@users.noreply.github.com> Snehil Shah <130062020+Snehil-Shah@users.noreply.github.com> +Soumajit Chatterjee <121816890+soumajit23@users.noreply.github.com> Spandan Barve Stephannie Jiménez Gacha Suraj kumar <125961509+kumarsuraj212003@users.noreply.github.com> @@ -79,8 +84,10 @@ Tudor Pagu <104032457+tudor-pagu@users.noreply.github.com> Utkarsh Utkarsh Raj Varad Gupta +Xiaochuan Ye Yernar Yergaziyev naveen nishant-s7 <97207366+nishant-s7@users.noreply.github.com> orimiles5 <97595296+orimiles5@users.noreply.github.com> +rainn <88160429+AmCodesLame@users.noreply.github.com> rei2hu diff --git a/dist/index.js.map b/dist/index.js.map index f301052..30487bb 100644 --- a/dist/index.js.map +++ b/dist/index.js.map @@ -1,7 +1,7 @@ { "version": 3, "sources": ["../lib/validate.js", "../lib/defaults.js", "../lib/main.js", "../lib/index.js"], - "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasOwnProp = require( '@stdlib/assert-has-own-property' );\nvar isObject = require( '@stdlib/assert-is-plain-object' );\nvar isNumber = require( '@stdlib/assert-is-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert-is-string' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert-is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string-format' );\nvar isnan = require( '@stdlib/assert-is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination for validated options\n* @param {Options} options - function options\n* @param {number} [options.alpha] - significance level\n* @param {string} [options.alternative] - alternative hypothesis\n* @param {NonNegativeInteger} [options.init] - number of data points used to compute initial statistics\n* @returns {(null|Error)} null or an error\n*\n* @example\n* var opts = {};\n*\n* var options = {\n* 'alpha': 0.05,\n* 'alernative': 'two-sided',\n* 'init': 100\n* };\n*\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'alpha' ) ) {\n\t\topts.alpha = options.alpha;\n\t\tif ( !isNumber( opts.alpha ) || isnan( opts.alpha ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a number. Option: `%s`.', 'alpha', opts.alpha ) );\n\t\t}\n\t\tif ( opts.alpha < 0.0 || opts.alpha > 1.0 ) {\n\t\t\treturn new RangeError( format( 'invalid option. `%s` option must be a number on the interval: [0, 1]. Option: `%f`.', 'alpha', opts.alpha ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'alternative' ) ) {\n\t\topts.alternative = options.alternative;\n\t\tif ( !isString( opts.alternative ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'alternative', opts.alternative ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'init' ) ) {\n\t\topts.init = options.init;\n\t\tif ( !isNonNegativeInteger( opts.init ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'init', opts.init ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns default options.\n*\n* @private\n* @returns {Object} default options\n*\n* @example\n* var o = defaults();\n* // returns {...}\n*/\nfunction defaults() {\n\treturn {\n\t\t'init': 100,\n\t\t'alpha': 0.05,\n\t\t'alternative': 'two-sided',\n\t\t'digits': 4,\n\t\t'decision': true\n\t};\n}\n\n\n// EXPORTS //\n\nmodule.exports = defaults;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasOwnProp = require( '@stdlib/assert-has-own-property' );\nvar isObject = require( '@stdlib/assert-is-plain-object' );\nvar isPositiveInteger = require( '@stdlib/assert-is-positive-integer' ).isPrimitive;\nvar isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;\nvar incrminmax = require( '@stdlib/stats-incr-minmax' );\nvar incrmeanstdev = require( '@stdlib/stats-incr-meanstdev' );\nvar setReadOnly = require( '@stdlib/utils-define-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils-define-read-only-accessor' );\nvar max = require( '@stdlib/math-base-special-max' );\nvar sqrt = require( '@stdlib/math-base-special-sqrt' );\nvar roundn = require( '@stdlib/math-base-special-roundn' );\nvar tQuantile = require( '@stdlib/stats-base-dists-t-quantile' );\nvar format = require( '@stdlib/string-format' );\nvar validate = require( './validate.js' );\nvar defaults = require( './defaults.js' );\n\n\n// MAIN //\n\n/**\n* Returns an accumulator function which incrementally performs Grubbs' test for detecting outliers.\n*\n* @param {Options} [options] - function options\n* @param {number} [options.alpha=0.05] - significance level\n* @param {string} [options.alternative='two-sided'] - alternative hypothesis ('two-sided', 'min', 'max')\n* @param {NonNegativeInteger} [options.init=100] - number of data points used to compute initial statistics\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {RangeError} `alpha` option must be on the interval `[0,1]`\n* @returns {Function} accumulator function\n*\n* @example\n* var rnorm = require( '@stdlib/random-base-normal' );\n*\n* var accumulator;\n* var opts;\n* var res;\n* var i;\n*\n* opts = {\n* 'init': 100\n* };\n*\n* accumulator = incrgrubbs( opts );\n*\n* for ( i = 0; i < 200; i++ ) {\n* res = accumulator( rnorm( 10.0, 5.0 ) );\n* }\n*/\nfunction incrgrubbs() {\n\tvar meanstdev;\n\tvar results;\n\tvar minmax;\n\tvar opts;\n\tvar err;\n\tvar mm;\n\tvar ms;\n\tvar gc;\n\tvar df;\n\tvar N;\n\tvar G;\n\n\topts = defaults();\n\tif ( arguments.length ) {\n\t\terr = validate( opts, arguments[ 0 ] );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Initialize the results object:\n\tresults = {};\n\tsetReadOnlyAccessor( results, 'rejected', getRejected );\n\tsetReadOnly( results, 'alpha', opts.alpha );\n\tsetReadOnlyAccessor( results, 'criticalValue', getCriticalValue );\n\tsetReadOnlyAccessor( results, 'statistic', getStatistic );\n\tsetReadOnlyAccessor( results, 'df', getDOF );\n\tsetReadOnlyAccessor( results, 'mean', getMean );\n\tsetReadOnlyAccessor( results, 'sd', getStDev );\n\tsetReadOnlyAccessor( results, 'min', getMin );\n\tsetReadOnlyAccessor( results, 'max', getMax );\n\tsetReadOnly( results, 'alt', opts.alternative );\n\tsetReadOnly( results, 'method', 'Grubbs\\' Test' );\n\tsetReadOnly( results, 'print', print );\n\n\tN = 0;\n\tdf = 0;\n\tG = 0.0;\n\tgc = 0.0;\n\n\t// Initialize statistics accumulators:\n\tmm = [ 0.0, 0.0 ];\n\tminmax = incrminmax( mm );\n\n\tms = [ 0.0, 0.0 ];\n\tmeanstdev = incrmeanstdev( ms );\n\n\treturn accumulator;\n\n\t/**\n\t* If provided a value, the accumulator function returns updated Grubbs' test results. If not provided a value, the accumulator function returns the current Grubbs' test results.\n\t*\n\t* @private\n\t* @param {number} [x] - new value\n\t* @returns {(Object|null)} test results or null\n\t*/\n\tfunction accumulator( x ) {\n\t\tvar sig;\n\t\tvar md;\n\t\tvar tc;\n\t\tif ( arguments.length === 0 ) {\n\t\t\tif ( N < opts.init || df <= 0 ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn results;\n\t\t}\n\t\tN += 1;\n\n\t\t// Update model statistics:\n\t\tmeanstdev( x );\n\t\tminmax( x );\n\n\t\t// Compute the degrees of freedom:\n\t\tdf = N - 2;\n\n\t\tif ( N < opts.init || df <= 0 ) {\n\t\t\treturn null;\n\t\t}\n\t\t// Compute the test statistic and significance level...\n\t\tif ( opts.alternative === 'min' ) {\n\t\t\tG = ( ms[0]-mm[0] ) / ms[ 1 ];\n\t\t\tsig = opts.alpha / N;\n\t\t} else if ( opts.alternative === 'max' ) {\n\t\t\tG = ( mm[1]-ms[0] ) / ms[ 1 ];\n\t\t\tsig = opts.alpha / N;\n\t\t} else { // two-sided\n\t\t\tmd = max( ms[0]-mm[0], mm[1]-ms[0] ); // maximum absolute deviation\n\t\t\tG = md / ms[ 1 ];\n\t\t\tsig = opts.alpha / (2*N);\n\t\t}\n\t\t// Compute the critical values:\n\t\ttc = tQuantile( 1.0-sig, df );\n\t\tgc = (N-1)*tc / sqrt( N*(df+(tc*tc)) );\n\n\t\treturn results;\n\t}\n\n\t/**\n\t* Returns a `boolean` indicating whether the null hypothesis should be rejected.\n\t*\n\t* @private\n\t* @returns {boolean} boolean indicating whether the null hypothesis should be rejected\n\t*/\n\tfunction getRejected() {\n\t\treturn ( G > gc );\n\t}\n\n\t/**\n\t* Returns the critical value.\n\t*\n\t* @private\n\t* @returns {number} critical value\n\t*/\n\tfunction getCriticalValue() {\n\t\treturn gc;\n\t}\n\n\t/**\n\t* Returns the test statistic.\n\t*\n\t* @private\n\t* @returns {number} test statistic\n\t*/\n\tfunction getStatistic() {\n\t\treturn G;\n\t}\n\n\t/**\n\t* Returns the degrees of freedom (DOF).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} degrees of freedom\n\t*/\n\tfunction getDOF() {\n\t\treturn df;\n\t}\n\n\t/**\n\t* Returns the sample mean.\n\t*\n\t* @private\n\t* @returns {number} sample mean\n\t*/\n\tfunction getMean() {\n\t\treturn ms[ 0 ];\n\t}\n\n\t/**\n\t* Returns the corrected sample standard deviation.\n\t*\n\t* @private\n\t* @returns {number} corrected sample standard deviation\n\t*/\n\tfunction getStDev() {\n\t\treturn ms[ 1 ];\n\t}\n\n\t/**\n\t* Returns the sample minimum.\n\t*\n\t* @private\n\t* @returns {number} sample minimum\n\t*/\n\tfunction getMin() {\n\t\treturn mm[ 0 ];\n\t}\n\n\t/**\n\t* Returns the sample maximum.\n\t*\n\t* @private\n\t* @returns {number} sample maximum\n\t*/\n\tfunction getMax() {\n\t\treturn mm[ 1 ];\n\t}\n\n\t/**\n\t* Pretty-print test results.\n\t*\n\t* @private\n\t* @param {Object} [options] - options object\n\t* @param {PositiveInteger} [options.digits=4] - number of digits after the decimal point\n\t* @param {boolean} [options.decision=true] - boolean indicating whether to print the test decision\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {string} formatted output\n\t*/\n\tfunction print( options ) {\n\t\tvar decision;\n\t\tvar digits;\n\t\tvar str;\n\n\t\tdigits = opts.digits;\n\t\tdecision = opts.decision;\n\t\tif ( arguments.length > 0 ) {\n\t\t\tif ( !isObject( options ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide an object. Value: `%s`.', options ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( options, 'digits' ) ) {\n\t\t\t\tif ( !isPositiveInteger( options.digits ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'digits', options.digits ) );\n\t\t\t\t}\n\t\t\t\tdigits = options.digits;\n\t\t\t}\n\t\t\tif ( hasOwnProp( options, 'decision' ) ) {\n\t\t\t\tif ( !isBoolean( options.decision ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'decision', options.decision ) );\n\t\t\t\t}\n\t\t\t\tdecision = options.decision;\n\t\t\t}\n\t\t}\n\t\tstr = '';\n\t\tstr += results.method;\n\t\tstr += '\\n\\n';\n\t\tstr += 'Alternative hypothesis: ';\n\t\tif ( opts.alternative === 'max' ) {\n\t\t\tstr += 'The maximum value (' + mm[ 1 ] + ') is an outlier';\n\t\t} else if ( opts.alternative === 'min' ) {\n\t\t\tstr += 'The minimum value (' + mm[ 0 ] + ') is an outlier';\n\t\t} else { // two-sided\n\t\t\tstr += 'The ';\n\t\t\tif ( ms[0]-mm[0] > mm[1]-ms[0] ) {\n\t\t\t\tstr += 'minimum value (' + mm[ 0 ] + ')';\n\t\t\t} else {\n\t\t\t\tstr += 'maximum value (' + mm[ 1 ] + ')';\n\t\t\t}\n\t\t\tstr += ' is an outlier';\n\t\t}\n\t\tstr += '\\n\\n';\n\t\tstr += ' criticalValue: ' + roundn( gc, -digits ) + '\\n';\n\t\tstr += ' statistic: ' + roundn( G, -digits ) + '\\n';\n\t\tstr += ' df: ' + df + '\\n';\n\t\tstr += '\\n';\n\t\tif ( decision ) {\n\t\t\tstr += 'Test Decision: ';\n\t\t\tif ( G > gc ) {\n\t\t\t\tstr += 'Reject null in favor of alternative at ' + (opts.alpha*100.0) + '% significance level';\n\t\t\t} else {\n\t\t\t\tstr += 'Fail to reject null in favor of alternative at ' + (opts.alpha*100.0) + '% significance level';\n\t\t\t}\n\t\t\tstr += '\\n';\n\t\t}\n\t\treturn str;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = incrgrubbs;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Grubbs' test for outliers.\n*\n* @module @stdlib/stats-incr-grubbs\n*\n* @example\n* var rnorm = require( '@stdlib/random-base-normal' );\n* var incrgrubbs = require( '@stdlib/stats-incr-grubbs' );\n*\n* var accumulator;\n* var opts;\n* var res;\n* var i;\n*\n* opts = {\n* 'init': 100\n* };\n*\n* accumulator = incrgrubbs( opts );\n*\n* for ( i = 0; i < 200; i++ ) {\n* res = accumulator( rnorm( 10.0, 5.0 ) );\n* }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], + "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasOwnProp = require( '@stdlib/assert-has-own-property' );\nvar isObject = require( '@stdlib/assert-is-plain-object' );\nvar isNumber = require( '@stdlib/assert-is-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert-is-string' ).isPrimitive;\nvar isNonNegativeInteger = require( '@stdlib/assert-is-nonnegative-integer' ).isPrimitive;\nvar format = require( '@stdlib/string-format' );\nvar isnan = require( '@stdlib/assert-is-nan' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination for validated options\n* @param {Options} options - function options\n* @param {number} [options.alpha] - significance level\n* @param {string} [options.alternative] - alternative hypothesis\n* @param {NonNegativeInteger} [options.init] - number of data points used to compute initial statistics\n* @returns {(null|Error)} null or an error\n*\n* @example\n* var opts = {};\n*\n* var options = {\n* 'alpha': 0.05,\n* 'alternative': 'two-sided',\n* 'init': 100\n* };\n*\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'alpha' ) ) {\n\t\topts.alpha = options.alpha;\n\t\tif ( !isNumber( opts.alpha ) || isnan( opts.alpha ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a number. Option: `%s`.', 'alpha', opts.alpha ) );\n\t\t}\n\t\tif ( opts.alpha < 0.0 || opts.alpha > 1.0 ) {\n\t\t\treturn new RangeError( format( 'invalid option. `%s` option must be a number on the interval: [0, 1]. Option: `%f`.', 'alpha', opts.alpha ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'alternative' ) ) {\n\t\topts.alternative = options.alternative;\n\t\tif ( !isString( opts.alternative ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'alternative', opts.alternative ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'init' ) ) {\n\t\topts.init = options.init;\n\t\tif ( !isNonNegativeInteger( opts.init ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative integer. Option: `%s`.', 'init', opts.init ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns default options.\n*\n* @private\n* @returns {Object} default options\n*\n* @example\n* var o = defaults();\n* // returns {...}\n*/\nfunction defaults() {\n\treturn {\n\t\t'init': 100,\n\t\t'alpha': 0.05,\n\t\t'alternative': 'two-sided',\n\t\t'digits': 4,\n\t\t'decision': true\n\t};\n}\n\n\n// EXPORTS //\n\nmodule.exports = defaults;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasOwnProp = require( '@stdlib/assert-has-own-property' );\nvar isObject = require( '@stdlib/assert-is-plain-object' );\nvar isPositiveInteger = require( '@stdlib/assert-is-positive-integer' ).isPrimitive;\nvar isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;\nvar incrminmax = require( '@stdlib/stats-incr-minmax' );\nvar incrmeanstdev = require( '@stdlib/stats-incr-meanstdev' );\nvar setReadOnly = require( '@stdlib/utils-define-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils-define-read-only-accessor' );\nvar max = require( '@stdlib/math-base-special-max' );\nvar sqrt = require( '@stdlib/math-base-special-sqrt' );\nvar roundn = require( '@stdlib/math-base-special-roundn' );\nvar tQuantile = require( '@stdlib/stats-base-dists-t-quantile' );\nvar format = require( '@stdlib/string-format' );\nvar validate = require( './validate.js' );\nvar defaults = require( './defaults.js' );\n\n\n// MAIN //\n\n/**\n* Returns an accumulator function which incrementally performs Grubbs' test for detecting outliers.\n*\n* @param {Options} [options] - function options\n* @param {number} [options.alpha=0.05] - significance level\n* @param {string} [options.alternative='two-sided'] - alternative hypothesis ('two-sided', 'min', 'max')\n* @param {NonNegativeInteger} [options.init=100] - number of data points used to compute initial statistics\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {RangeError} `alpha` option must be on the interval `[0,1]`\n* @returns {Function} accumulator function\n*\n* @example\n* var rnorm = require( '@stdlib/random-base-normal' );\n*\n* var accumulator;\n* var opts;\n* var res;\n* var i;\n*\n* opts = {\n* 'init': 100\n* };\n*\n* accumulator = incrgrubbs( opts );\n*\n* for ( i = 0; i < 200; i++ ) {\n* res = accumulator( rnorm( 10.0, 5.0 ) );\n* }\n*/\nfunction incrgrubbs() {\n\tvar meanstdev;\n\tvar results;\n\tvar minmax;\n\tvar opts;\n\tvar err;\n\tvar mm;\n\tvar ms;\n\tvar gc;\n\tvar df;\n\tvar N;\n\tvar G;\n\n\topts = defaults();\n\tif ( arguments.length ) {\n\t\terr = validate( opts, arguments[ 0 ] );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\t// Initialize the results object:\n\tresults = {};\n\tsetReadOnlyAccessor( results, 'rejected', getRejected );\n\tsetReadOnly( results, 'alpha', opts.alpha );\n\tsetReadOnlyAccessor( results, 'criticalValue', getCriticalValue );\n\tsetReadOnlyAccessor( results, 'statistic', getStatistic );\n\tsetReadOnlyAccessor( results, 'df', getDOF );\n\tsetReadOnlyAccessor( results, 'mean', getMean );\n\tsetReadOnlyAccessor( results, 'sd', getStDev );\n\tsetReadOnlyAccessor( results, 'min', getMin );\n\tsetReadOnlyAccessor( results, 'max', getMax );\n\tsetReadOnly( results, 'alt', opts.alternative );\n\tsetReadOnly( results, 'method', 'Grubbs\\' Test' );\n\tsetReadOnly( results, 'print', print );\n\n\tN = 0;\n\tdf = 0;\n\tG = 0.0;\n\tgc = 0.0;\n\n\t// Initialize statistics accumulators:\n\tmm = [ 0.0, 0.0 ];\n\tminmax = incrminmax( mm );\n\n\tms = [ 0.0, 0.0 ];\n\tmeanstdev = incrmeanstdev( ms );\n\n\treturn accumulator;\n\n\t/**\n\t* If provided a value, the accumulator function returns updated Grubbs' test results. If not provided a value, the accumulator function returns the current Grubbs' test results.\n\t*\n\t* @private\n\t* @param {number} [x] - new value\n\t* @returns {(Object|null)} test results or null\n\t*/\n\tfunction accumulator( x ) {\n\t\tvar sig;\n\t\tvar md;\n\t\tvar tc;\n\t\tif ( arguments.length === 0 ) {\n\t\t\tif ( N < opts.init || df <= 0 ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn results;\n\t\t}\n\t\tN += 1;\n\n\t\t// Update model statistics:\n\t\tmeanstdev( x );\n\t\tminmax( x );\n\n\t\t// Compute the degrees of freedom:\n\t\tdf = N - 2;\n\n\t\tif ( N < opts.init || df <= 0 ) {\n\t\t\treturn null;\n\t\t}\n\t\t// Compute the test statistic and significance level...\n\t\tif ( opts.alternative === 'min' ) {\n\t\t\tG = ( ms[0]-mm[0] ) / ms[ 1 ];\n\t\t\tsig = opts.alpha / N;\n\t\t} else if ( opts.alternative === 'max' ) {\n\t\t\tG = ( mm[1]-ms[0] ) / ms[ 1 ];\n\t\t\tsig = opts.alpha / N;\n\t\t} else { // two-sided\n\t\t\tmd = max( ms[0]-mm[0], mm[1]-ms[0] ); // maximum absolute deviation\n\t\t\tG = md / ms[ 1 ];\n\t\t\tsig = opts.alpha / (2*N);\n\t\t}\n\t\t// Compute the critical values:\n\t\ttc = tQuantile( 1.0-sig, df );\n\t\tgc = (N-1)*tc / sqrt( N*(df+(tc*tc)) );\n\n\t\treturn results;\n\t}\n\n\t/**\n\t* Returns a `boolean` indicating whether the null hypothesis should be rejected.\n\t*\n\t* @private\n\t* @returns {boolean} boolean indicating whether the null hypothesis should be rejected\n\t*/\n\tfunction getRejected() {\n\t\treturn ( G > gc );\n\t}\n\n\t/**\n\t* Returns the critical value.\n\t*\n\t* @private\n\t* @returns {number} critical value\n\t*/\n\tfunction getCriticalValue() {\n\t\treturn gc;\n\t}\n\n\t/**\n\t* Returns the test statistic.\n\t*\n\t* @private\n\t* @returns {number} test statistic\n\t*/\n\tfunction getStatistic() {\n\t\treturn G;\n\t}\n\n\t/**\n\t* Returns the degrees of freedom (DOF).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} degrees of freedom\n\t*/\n\tfunction getDOF() {\n\t\treturn df;\n\t}\n\n\t/**\n\t* Returns the sample mean.\n\t*\n\t* @private\n\t* @returns {number} sample mean\n\t*/\n\tfunction getMean() {\n\t\treturn ms[ 0 ];\n\t}\n\n\t/**\n\t* Returns the corrected sample standard deviation.\n\t*\n\t* @private\n\t* @returns {number} corrected sample standard deviation\n\t*/\n\tfunction getStDev() {\n\t\treturn ms[ 1 ];\n\t}\n\n\t/**\n\t* Returns the sample minimum.\n\t*\n\t* @private\n\t* @returns {number} sample minimum\n\t*/\n\tfunction getMin() {\n\t\treturn mm[ 0 ];\n\t}\n\n\t/**\n\t* Returns the sample maximum.\n\t*\n\t* @private\n\t* @returns {number} sample maximum\n\t*/\n\tfunction getMax() {\n\t\treturn mm[ 1 ];\n\t}\n\n\t/**\n\t* Pretty-print test results.\n\t*\n\t* @private\n\t* @param {Object} [options] - options object\n\t* @param {PositiveInteger} [options.digits=4] - number of digits after the decimal point\n\t* @param {boolean} [options.decision=true] - boolean indicating whether to print the test decision\n\t* @throws {TypeError} options argument must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {string} formatted output\n\t*/\n\tfunction print( options ) {\n\t\tvar decision;\n\t\tvar digits;\n\t\tvar str;\n\n\t\tdigits = opts.digits;\n\t\tdecision = opts.decision;\n\t\tif ( arguments.length > 0 ) {\n\t\t\tif ( !isObject( options ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide an object. Value: `%s`.', options ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( options, 'digits' ) ) {\n\t\t\t\tif ( !isPositiveInteger( options.digits ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'digits', options.digits ) );\n\t\t\t\t}\n\t\t\t\tdigits = options.digits;\n\t\t\t}\n\t\t\tif ( hasOwnProp( options, 'decision' ) ) {\n\t\t\t\tif ( !isBoolean( options.decision ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'decision', options.decision ) );\n\t\t\t\t}\n\t\t\t\tdecision = options.decision;\n\t\t\t}\n\t\t}\n\t\tstr = '';\n\t\tstr += results.method;\n\t\tstr += '\\n\\n';\n\t\tstr += 'Alternative hypothesis: ';\n\t\tif ( opts.alternative === 'max' ) {\n\t\t\tstr += 'The maximum value (' + mm[ 1 ] + ') is an outlier';\n\t\t} else if ( opts.alternative === 'min' ) {\n\t\t\tstr += 'The minimum value (' + mm[ 0 ] + ') is an outlier';\n\t\t} else { // two-sided\n\t\t\tstr += 'The ';\n\t\t\tif ( ms[0]-mm[0] > mm[1]-ms[0] ) {\n\t\t\t\tstr += 'minimum value (' + mm[ 0 ] + ')';\n\t\t\t} else {\n\t\t\t\tstr += 'maximum value (' + mm[ 1 ] + ')';\n\t\t\t}\n\t\t\tstr += ' is an outlier';\n\t\t}\n\t\tstr += '\\n\\n';\n\t\tstr += ' criticalValue: ' + roundn( gc, -digits ) + '\\n';\n\t\tstr += ' statistic: ' + roundn( G, -digits ) + '\\n';\n\t\tstr += ' df: ' + df + '\\n';\n\t\tstr += '\\n';\n\t\tif ( decision ) {\n\t\t\tstr += 'Test Decision: ';\n\t\t\tif ( G > gc ) {\n\t\t\t\tstr += 'Reject null in favor of alternative at ' + (opts.alpha*100.0) + '% significance level';\n\t\t\t} else {\n\t\t\t\tstr += 'Fail to reject null in favor of alternative at ' + (opts.alpha*100.0) + '% significance level';\n\t\t\t}\n\t\t\tstr += '\\n';\n\t\t}\n\t\treturn str;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = incrgrubbs;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Grubbs' test for outliers.\n*\n* @module @stdlib/stats-incr-grubbs\n*\n* @example\n* var rnorm = require( '@stdlib/random-base-normal' );\n* var incrgrubbs = require( '@stdlib/stats-incr-grubbs' );\n*\n* var accumulator;\n* var opts;\n* var res;\n* var i;\n*\n* opts = {\n* 'init': 100\n* };\n*\n* accumulator = incrgrubbs( opts );\n*\n* for ( i = 0; i < 200; i++ ) {\n* res = accumulator( rnorm( 10.0, 5.0 ) );\n* }\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,GAAAC,EAAA,cAsBA,IAAIC,EAAa,QAAS,iCAAkC,EACxDC,EAAW,QAAS,gCAAiC,EACrDC,EAAW,QAAS,0BAA2B,EAAE,YACjDC,EAAW,QAAS,0BAA2B,EAAE,YACjDC,EAAuB,QAAS,uCAAwC,EAAE,YAC1EC,EAAS,QAAS,uBAAwB,EAC1CC,EAAQ,QAAS,uBAAwB,EA8B7C,SAASC,EAAUC,EAAMC,EAAU,CAClC,GAAK,CAACR,EAAUQ,CAAQ,EACvB,OAAO,IAAI,UAAWJ,EAAQ,qEAAsEI,CAAQ,CAAE,EAE/G,GAAKT,EAAYS,EAAS,OAAQ,EAAI,CAErC,GADAD,EAAK,MAAQC,EAAQ,MAChB,CAACP,EAAUM,EAAK,KAAM,GAAKF,EAAOE,EAAK,KAAM,EACjD,OAAO,IAAI,UAAWH,EAAQ,8DAA+D,QAASG,EAAK,KAAM,CAAE,EAEpH,GAAKA,EAAK,MAAQ,GAAOA,EAAK,MAAQ,EACrC,OAAO,IAAI,WAAYH,EAAQ,sFAAuF,QAASG,EAAK,KAAM,CAAE,CAE9I,CACA,OAAKR,EAAYS,EAAS,aAAc,IACvCD,EAAK,YAAcC,EA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AIA,EAAG,CAAC,EAAEC,EAAG,CAAC,EAC5BsB,GAAO,kBAAoBvB,EAAI,CAAE,EAAI,IAErCuB,GAAO,kBAAoBvB,EAAI,CAAE,EAAI,IAEtCuB,GAAO,kBAERA,GAAO,OACPA,GAAO,sBAAwBlC,EAAQa,EAAI,CAACoB,CAAO,EAAI,KACvDC,GAAO,kBAAoBlC,EAAQgB,EAAG,CAACiB,CAAO,EAAI,KAClDC,GAAO,WAAapB,EAAK,KACzBoB,GAAO,KACFF,IACJE,GAAO,kBACFlB,EAAIH,EACRqB,GAAO,0CAA6CzB,EAAK,MAAM,IAAS,uBAExEyB,GAAO,kDAAqDzB,EAAK,MAAM,IAAS,uBAEjFyB,GAAO,MAEDA,CACR,CACD,CAKA7C,EAAO,QAAUgB,KClRjB,IAAI8B,GAAO,IAKX,OAAO,QAAUA", "names": ["require_validate", "__commonJSMin", "exports", "module", "hasOwnProp", "isObject", "isNumber", "isString", "isNonNegativeInteger", "format", "isnan", "validate", "opts", "options", "require_defaults", "__commonJSMin", "exports", "module", "defaults", "require_main", "__commonJSMin", "exports", "module", "hasOwnProp", "isObject", "isPositiveInteger", "isBoolean", "incrminmax", "incrmeanstdev", "setReadOnly", "setReadOnlyAccessor", "max", "sqrt", "roundn", "tQuantile", "format", "validate", "defaults", "incrgrubbs", "meanstdev", "results", "minmax", "opts", "err", "mm", "ms", "gc", "df", "N", "G", "getRejected", "getCriticalValue", "getStatistic", "getDOF", "getMean", "getStDev", "getMin", "getMax", "print", "accumulator", "x", "sig", "md", "tc", "options", "decision", "digits", "str", "main"] } diff --git a/lib/validate.js b/lib/validate.js index a578c05..3b24f25 100644 --- a/lib/validate.js +++ b/lib/validate.js @@ -47,7 +47,7 @@ var isnan = require( '@stdlib/assert-is-nan' ); * * var options = { * 'alpha': 0.05, -* 'alernative': 'two-sided', +* 'alternative': 'two-sided', * 'init': 100 * }; *