diff --git a/.github/.keepalive b/.github/.keepalive deleted file mode 100644 index cde1007..0000000 --- a/.github/.keepalive +++ /dev/null @@ -1 +0,0 @@ -2023-08-01T01:42:31.764Z diff --git a/.github/workflows/productionize.yml b/.github/workflows/productionize.yml index 334eb59..91f2b93 100644 --- a/.github/workflows/productionize.yml +++ b/.github/workflows/productionize.yml @@ -82,21 +82,6 @@ jobs: id: transform-error-messages uses: stdlib-js/transform-errors-action@main - # Format error messages: - - name: 'Replace double quotes with single quotes in rewritten format string error messages' - run: | - find . -name "*.js" -exec sed -E -i "s/Error\( format\( \"([a-zA-Z0-9]+)\"/Error\( format\( '\1'/g" {} \; - - # Format string literal error messages: - - name: 'Replace double quotes with single quotes in rewritten string literal error messages' - run: | - find . -name "*.js" -exec sed -E -i "s/Error\( format\(\"([a-zA-Z0-9]+)\"\)/Error\( format\( '\1' \)/g" {} \; - - # Format code: - - name: 'Replace double quotes with single quotes in inserted `require` calls' - run: | - find . -name "*.js" -exec sed -E -i "s/require\( ?\"@stdlib\/error-tools-fmtprodmsg\" ?\);/require\( '@stdlib\/error-tools-fmtprodmsg' \);/g" {} \; - # Change `@stdlib/string-format` to `@stdlib/error-tools-fmtprodmsg` in package.json if the former is a dependency, otherwise insert it as a dependency: - name: 'Update dependencies in package.json' run: | diff --git a/dist/index.d.ts b/dist/index.d.ts new file mode 100644 index 0000000..366b352 --- /dev/null +++ b/dist/index.d.ts @@ -0,0 +1,3 @@ +/// +import incrkurtosis from '../docs/types/index'; +export = incrkurtosis; \ No newline at end of file diff --git a/dist/index.js b/dist/index.js new file mode 100644 index 0000000..4b7f8cb --- /dev/null +++ b/dist/index.js @@ -0,0 +1,5 @@ +"use strict";var g=function(n,a){return function(){return a||n((a={exports:{}}).exports,a),a.exports}};var o=g(function(x,m){ +var N=require('@stdlib/math-base-assert-is-nan/dist');function p(){var n,a,v,i,l,e,s,t,c,u,r;return n=0,a=0,v=0,i=0,l=0,t=0,c=0,u=0,r=0,f;function f(d){return arguments.length===0?r<4?N(u)?NaN:null:(s=r*u/(t*t)-3,(r-1)/((r-2)*(r-3))*((r+1)*s+6)):(r+=1,v=d-l,a=v/r,n=a*a,i=v*a*(r-1),e=i*n*(r*r-3*r+3),e+=6*n*t,e-=4*a*c,u+=e,e=i*a*(r-2),e-=3*a*t,c+=e,t+=i,l+=a,r<4?N(u)?NaN:null:(s=r*u/(t*t)-3,(r-1)/((r-2)*(r-3))*((r+1)*s+6)))}}m.exports=p +});var M=o();module.exports=M; +/** @license Apache-2.0 */ +//# sourceMappingURL=index.js.map diff --git a/dist/index.js.map b/dist/index.js.map new file mode 100644 index 0000000..b3d9a0a --- /dev/null +++ b/dist/index.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../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 isnan = require( '@stdlib/math-base-assert-is-nan' );\n\n\n// MAIN //\n\n/**\n* Returns an accumulator function which incrementally computes a corrected sample excess kurtosis.\n*\n* ## Method\n*\n* The algorithm computes the sample excess kurtosis using the formula for `G_2` in [Joanes and Gill 1998][@joanes:1998]. In contrast to alternatives for calculating a sample kurtosis, `G_2` is an unbiased estimator under normality.\n*\n* ## References\n*\n* - Joanes, D. N., and C. A. Gill. 1998. \"Comparing measures of sample skewness and kurtosis.\" _Journal of the Royal Statistical Society: Series D (The Statistician)_ 47 (1). Blackwell Publishers Ltd: 183\u201389. doi:[10.1111/1467-9884.00122][@joanes:1998].\n*\n* [@joanes:1998]: http://dx.doi.org/10.1111/1467-9884.00122\n*\n* @returns {Function} accumulator function\n*\n* @example\n* var accumulator = incrkurtosis();\n*\n* var kurtosis = accumulator();\n* // returns null\n*\n* kurtosis = accumulator( 2.0 );\n* // returns null\n*\n* kurtosis = accumulator( 2.0 );\n* // returns null\n*\n* kurtosis = accumulator( -4.0 );\n* // returns null\n*\n* kurtosis = accumulator( -4.0 );\n* // returns -6.0\n*/\nfunction incrkurtosis() {\n\tvar deltaN2;\n\tvar deltaN;\n\tvar delta;\n\tvar term1;\n\tvar mean;\n\tvar tmp;\n\tvar g2;\n\tvar M2;\n\tvar M3;\n\tvar M4;\n\tvar N;\n\n\tdeltaN2 = 0.0;\n\tdeltaN = 0.0;\n\tdelta = 0.0;\n\tterm1 = 0.0;\n\tmean = 0.0;\n\tM2 = 0.0;\n\tM3 = 0.0;\n\tM4 = 0.0;\n\tN = 0;\n\n\treturn accumulator;\n\n\t/**\n\t* If provided a value, the accumulator function returns an updated corrected sample excess kurtosis. If not provided a value, the accumulator function returns the current corrected sample excess kurtosis.\n\t*\n\t* @private\n\t* @param {number} [x] - new value\n\t* @returns {(number|null)} corrected sample excess kurtosis\n\t*/\n\tfunction accumulator( x ) {\n\t\tif ( arguments.length === 0 ) {\n\t\t\tif ( N < 4 ) {\n\t\t\t\treturn ( isnan( M4 ) ) ? NaN : null;\n\t\t\t}\n\t\t\t// Calculate the population excess kurtosis:\n\t\t\tg2 = (( N*M4 ) / ( M2*M2 )) - 3.0;\n\n\t\t\t// Return the corrected sample excess kurtosis:\n\t\t\treturn (N-1) / ( (N-2)*(N-3) ) * ( ((N+1)*g2) + 6.0 );\n\t\t}\n\t\tN += 1;\n\t\tdelta = x - mean;\n\t\tdeltaN = delta / N;\n\t\tdeltaN2 = deltaN * deltaN;\n\n\t\tterm1 = delta * deltaN * (N-1);\n\n\t\ttmp = term1 * deltaN2 * ((N*N) - (3*N) + 3);\n\t\ttmp += 6.0 * deltaN2 * M2;\n\t\ttmp -= 4.0 * deltaN * M3;\n\t\tM4 += tmp;\n\n\t\ttmp = term1 * deltaN * (N-2);\n\t\ttmp -= 3.0 * deltaN * M2;\n\t\tM3 += tmp;\n\n\t\tM2 += term1;\n\t\tmean += deltaN;\n\t\tif ( N < 4 ) {\n\t\t\treturn ( isnan( M4 ) ) ? NaN : null;\n\t\t}\n\t\t// Calculate the population excess kurtosis:\n\t\tg2 = (N*M4 / ( M2*M2 )) - 3.0;\n\n\t\t// Return the corrected sample excess kurtosis:\n\t\treturn (N-1) / ( (N-2)*(N-3) ) * ( ((N+1)*g2) + 6.0 );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = incrkurtosis;\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* Compute a corrected sample excess kurtosis incrementally.\n*\n* @module @stdlib/stats-incr-kurtosis\n*\n* @example\n* var incrkurtosis = require( '@stdlib/stats-incr-kurtosis' );\n*\n* var accumulator = incrkurtosis();\n*\n* var kurtosis = accumulator( 2.0 );\n* // returns null\n*\n* kurtosis = accumulator( 2.0 );\n* // returns null\n*\n* kurtosis = accumulator( -4.0 );\n* // returns null\n*\n* kurtosis = accumulator( -4.0 );\n* // returns -6.0\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,EAAAC,EAAA,cAsBA,IAAIC,EAAQ,QAAS,iCAAkC,EAsCvD,SAASC,GAAe,CACvB,IAAIC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EAEJ,OAAAV,EAAU,EACVC,EAAS,EACTC,EAAQ,EACRC,EAAQ,EACRC,EAAO,EACPG,EAAK,EACLC,EAAK,EACLC,EAAK,EACLC,EAAI,EAEGC,EASP,SAASA,EAAaC,EAAI,CACzB,OAAK,UAAU,SAAW,EACpBF,EAAI,EACCZ,EAAOW,CAAG,EAAM,IAAM,MAGhCH,EAAQI,EAAED,GAASF,EAAGA,GAAQ,GAGtBG,EAAE,KAAQA,EAAE,IAAIA,EAAE,MAAWA,EAAE,GAAGJ,EAAM,KAEjDI,GAAK,EACLR,EAAQU,EAAIR,EACZH,EAASC,EAAQQ,EACjBV,EAAUC,EAASA,EAEnBE,EAAQD,EAAQD,GAAUS,EAAE,GAE5BL,EAAMF,EAAQH,GAAYU,EAAEA,EAAM,EAAEA,EAAK,GACzCL,GAAO,EAAML,EAAUO,EACvBF,GAAO,EAAMJ,EAASO,EACtBC,GAAMJ,EAENA,EAAMF,EAAQF,GAAUS,EAAE,GAC1BL,GAAO,EAAMJ,EAASM,EACtBC,GAAMH,EAENE,GAAMJ,EACNC,GAAQH,EACHS,EAAI,EACCZ,EAAOW,CAAG,EAAM,IAAM,MAGhCH,EAAMI,EAAED,GAAOF,EAAGA,GAAQ,GAGlBG,EAAE,KAAQA,EAAE,IAAIA,EAAE,MAAWA,EAAE,GAAGJ,EAAM,IACjD,CACD,CAKAT,EAAO,QAAUE,IC1FjB,IAAIc,EAAO,IAKX,OAAO,QAAUA", + "names": ["require_main", "__commonJSMin", "exports", "module", "isnan", "incrkurtosis", "deltaN2", "deltaN", "delta", "term1", "mean", "tmp", "g2", "M2", "M3", "M4", "N", "accumulator", "x", "main"] +} diff --git a/docs/types/index.d.ts b/docs/types/index.d.ts index 2af5980..50d577a 100644 --- a/docs/types/index.d.ts +++ b/docs/types/index.d.ts @@ -16,7 +16,7 @@ * limitations under the License. */ -// TypeScript Version: 2.0 +// TypeScript Version: 4.1 ///