@stdlib/stats-base-dists-kumaraswamy-mode 0.0.7 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +1 -1
- package/README.md +18 -4
- package/SECURITY.md +5 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +7 -0
- package/docs/types/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/package.json +13 -12
- package/docs/repl.txt +0 -33
- package/docs/types/test.ts +0 -56
- /package/lib/{mode.js → main.js} +0 -0
package/NOTICE
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Copyright (c) 2016-
|
|
1
|
+
Copyright (c) 2016-2024 The Stdlib Authors.
|
package/README.md
CHANGED
|
@@ -18,6 +18,17 @@ limitations under the License.
|
|
|
18
18
|
|
|
19
19
|
-->
|
|
20
20
|
|
|
21
|
+
|
|
22
|
+
<details>
|
|
23
|
+
<summary>
|
|
24
|
+
About stdlib...
|
|
25
|
+
</summary>
|
|
26
|
+
<p>We believe in a future in which the web is a preferred environment for numerical computation. To help realize this future, we've built stdlib. stdlib is a standard library, with an emphasis on numerical and scientific computation, written in JavaScript (and C) for execution in browsers and in Node.js.</p>
|
|
27
|
+
<p>The library is fully decomposable, being architected in such a way that you can swap out and mix and match APIs and functionality to cater to your exact preferences and use cases.</p>
|
|
28
|
+
<p>When you use stdlib, you can be absolutely certain that you are using the most thorough, rigorous, well-written, studied, documented, tested, measured, and high-quality code out there.</p>
|
|
29
|
+
<p>To join us in bringing numerical computing to the web, get started by checking us out on <a href="https://github.com/stdlib-js/stdlib">GitHub</a>, and please consider <a href="https://opencollective.com/stdlib">financially supporting stdlib</a>. We greatly appreciate your continued support!</p>
|
|
30
|
+
</details>
|
|
31
|
+
|
|
21
32
|
# Mode
|
|
22
33
|
|
|
23
34
|
[![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url] <!-- [![dependencies][dependencies-image]][dependencies-url] -->
|
|
@@ -200,7 +211,7 @@ See [LICENSE][stdlib-license].
|
|
|
200
211
|
|
|
201
212
|
## Copyright
|
|
202
213
|
|
|
203
|
-
Copyright © 2016-
|
|
214
|
+
Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors].
|
|
204
215
|
|
|
205
216
|
</section>
|
|
206
217
|
|
|
@@ -213,8 +224,8 @@ Copyright © 2016-2022. The Stdlib [Authors][stdlib-authors].
|
|
|
213
224
|
[npm-image]: http://img.shields.io/npm/v/@stdlib/stats-base-dists-kumaraswamy-mode.svg
|
|
214
225
|
[npm-url]: https://npmjs.org/package/@stdlib/stats-base-dists-kumaraswamy-mode
|
|
215
226
|
|
|
216
|
-
[test-image]: https://github.com/stdlib-js/stats-base-dists-kumaraswamy-mode/actions/workflows/test.yml/badge.svg?branch=v0.0
|
|
217
|
-
[test-url]: https://github.com/stdlib-js/stats-base-dists-kumaraswamy-mode/actions/workflows/test.yml?query=branch:v0.0
|
|
227
|
+
[test-image]: https://github.com/stdlib-js/stats-base-dists-kumaraswamy-mode/actions/workflows/test.yml/badge.svg?branch=v0.2.0
|
|
228
|
+
[test-url]: https://github.com/stdlib-js/stats-base-dists-kumaraswamy-mode/actions/workflows/test.yml?query=branch:v0.2.0
|
|
218
229
|
|
|
219
230
|
[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/stats-base-dists-kumaraswamy-mode/main.svg
|
|
220
231
|
[coverage-url]: https://codecov.io/github/stdlib-js/stats-base-dists-kumaraswamy-mode?branch=main
|
|
@@ -227,7 +238,7 @@ Copyright © 2016-2022. The Stdlib [Authors][stdlib-authors].
|
|
|
227
238
|
-->
|
|
228
239
|
|
|
229
240
|
[chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg
|
|
230
|
-
[chat-url]: https://gitter.im
|
|
241
|
+
[chat-url]: https://app.gitter.im/#/room/#stdlib-js_stdlib:gitter.im
|
|
231
242
|
|
|
232
243
|
[stdlib]: https://github.com/stdlib-js/stdlib
|
|
233
244
|
|
|
@@ -237,8 +248,11 @@ Copyright © 2016-2022. The Stdlib [Authors][stdlib-authors].
|
|
|
237
248
|
[es-module]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
|
|
238
249
|
|
|
239
250
|
[deno-url]: https://github.com/stdlib-js/stats-base-dists-kumaraswamy-mode/tree/deno
|
|
251
|
+
[deno-readme]: https://github.com/stdlib-js/stats-base-dists-kumaraswamy-mode/blob/deno/README.md
|
|
240
252
|
[umd-url]: https://github.com/stdlib-js/stats-base-dists-kumaraswamy-mode/tree/umd
|
|
253
|
+
[umd-readme]: https://github.com/stdlib-js/stats-base-dists-kumaraswamy-mode/blob/umd/README.md
|
|
241
254
|
[esm-url]: https://github.com/stdlib-js/stats-base-dists-kumaraswamy-mode/tree/esm
|
|
255
|
+
[esm-readme]: https://github.com/stdlib-js/stats-base-dists-kumaraswamy-mode/blob/esm/README.md
|
|
242
256
|
[branches-url]: https://github.com/stdlib-js/stats-base-dists-kumaraswamy-mode/blob/main/branches.md
|
|
243
257
|
|
|
244
258
|
[stdlib-license]: https://raw.githubusercontent.com/stdlib-js/stats-base-dists-kumaraswamy-mode/main/LICENSE
|
package/SECURITY.md
ADDED
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";var s=function(e,r){return function(){return r||e((r={exports:{}}).exports,r),r.exports}};var u=s(function(q,i){
|
|
2
|
+
var t=require('@stdlib/math-base-assert-is-nan/dist'),n=require('@stdlib/math-base-special-pow/dist');function o(e,r){return t(e)||e<1||t(r)||r<1||e===1&&r===1?NaN:n((e-1)/(e*r-1),1/e)}i.exports=o
|
|
3
|
+
});var c=u();module.exports=c;
|
|
4
|
+
/** @license Apache-2.0 */
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../lib/main.js", "../lib/index.js"],
|
|
4
|
+
"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' );\nvar pow = require( '@stdlib/math-base-special-pow' );\n\n\n// MAIN //\n\n/**\n* Returns the mode of a Kumaraswamy's double bounded distribution.\n*\n* @param {PositiveNumber} a - first shape parameter\n* @param {PositiveNumber} b - second shape parameter\n* @returns {PositiveNumber} mode\n*\n* @example\n* var v = mode( 1.5, 1.5 );\n* // returns ~0.543\n*\n* @example\n* var v = mode( 4.0, 12.0 );\n* // returns ~0.503\n*\n* @example\n* var v = mode( 12.0, 2.0 );\n* // returns ~0.94\n*\n* @example\n* var v = mode( 1.0, 1.0 );\n* // returns NaN\n*\n* @example\n* var v = mode( 1.5, -0.1 );\n* // returns NaN\n*\n* @example\n* var v = mode( -0.1, 1.5 );\n* // returns NaN\n*\n* @example\n* var v = mode( 2.0, NaN );\n* // returns NaN\n*\n* @example\n* var v = mode( NaN, 2.0 );\n* // returns NaN\n*/\nfunction mode( a, b ) {\n\tif (\n\t\tisnan( a ) ||\n\t\ta < 1.0 ||\n\t\tisnan( b ) ||\n\t\tb < 1.0 ||\n\t\t( a === 1.0 && b === 1.0 )\n\t) {\n\t\treturn NaN;\n\t}\n\treturn pow( ( a-1.0 ) / ( (a*b) - 1.0 ), 1.0/a );\n}\n\n\n// EXPORTS //\n\nmodule.exports = mode;\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* Kumaraswamy's double bounded distribution mode.\n*\n* @module @stdlib/stats-base-dists-kumaraswamy-mode\n*\n* @example\n* var mode = require( '@stdlib/stats-base-dists-kumaraswamy-mode' );\n*\n* var v = mode( 2.0, 1.5 );\n* // returns ~0.707\n*\n* v = mode( 4.0, 12.0 );\n* // returns ~0.503\n*\n* v = mode( 16.0, 8.0 );\n* // returns ~0.875\n*/\n\n// MODULES //\n\nvar mode = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = mode;\n"],
|
|
5
|
+
"mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAQ,QAAS,iCAAkC,EACnDC,EAAM,QAAS,+BAAgC,EA4CnD,SAASC,EAAMC,EAAGC,EAAI,CACrB,OACCJ,EAAOG,CAAE,GACTA,EAAI,GACJH,EAAOI,CAAE,GACTA,EAAI,GACFD,IAAM,GAAOC,IAAM,EAEd,IAEDH,GAAOE,EAAE,IAAWA,EAAEC,EAAK,GAAO,EAAID,CAAE,CAChD,CAKAJ,EAAO,QAAUG,IC3CjB,IAAIG,EAAO,IAKX,OAAO,QAAUA",
|
|
6
|
+
"names": ["require_main", "__commonJSMin", "exports", "module", "isnan", "pow", "mode", "a", "b", "mode"]
|
|
7
|
+
}
|
package/docs/types/index.d.ts
CHANGED
package/lib/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stdlib/stats-base-dists-kumaraswamy-mode",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Kumaraswamy's double bounded distribution mode.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": {
|
|
@@ -37,19 +37,20 @@
|
|
|
37
37
|
"url": "https://github.com/stdlib-js/stdlib/issues"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@stdlib/math-base-assert-is-nan": "^0.0
|
|
41
|
-
"@stdlib/math-base-special-pow": "^0.0
|
|
40
|
+
"@stdlib/math-base-assert-is-nan": "^0.2.0",
|
|
41
|
+
"@stdlib/math-base-special-pow": "^0.2.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@stdlib/assert-is-number": "^0.
|
|
45
|
-
"@stdlib/
|
|
46
|
-
"@stdlib/constants-float64-
|
|
47
|
-
"@stdlib/constants-float64-
|
|
48
|
-
"@stdlib/
|
|
49
|
-
"@stdlib/random-base-randu": "^0.0.x",
|
|
44
|
+
"@stdlib/assert-is-number": "^0.1.1",
|
|
45
|
+
"@stdlib/constants-float64-eps": "^0.1.1",
|
|
46
|
+
"@stdlib/constants-float64-ninf": "^0.1.1",
|
|
47
|
+
"@stdlib/constants-float64-pinf": "^0.1.1",
|
|
48
|
+
"@stdlib/random-base-randu": "^0.1.0",
|
|
50
49
|
"tape": "git+https://github.com/kgryte/tape.git#fix/globby",
|
|
51
50
|
"istanbul": "^0.4.1",
|
|
52
|
-
"tap-
|
|
51
|
+
"tap-min": "git+https://github.com/Planeshifter/tap-min.git",
|
|
52
|
+
"@stdlib/bench-harness": "^0.2.0",
|
|
53
|
+
"@stdlib/bench": "^0.3.1"
|
|
53
54
|
},
|
|
54
55
|
"engines": {
|
|
55
56
|
"node": ">=0.10.0",
|
|
@@ -84,7 +85,7 @@
|
|
|
84
85
|
"univariate"
|
|
85
86
|
],
|
|
86
87
|
"funding": {
|
|
87
|
-
"type": "
|
|
88
|
-
"url": "https://
|
|
88
|
+
"type": "opencollective",
|
|
89
|
+
"url": "https://opencollective.com/stdlib"
|
|
89
90
|
}
|
|
90
91
|
}
|
package/docs/repl.txt
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
{{alias}}( a, b )
|
|
3
|
-
Returns the mode of a Kumaraswamy's double bounded distribution.
|
|
4
|
-
|
|
5
|
-
If provided `NaN` as any argument, the function returns `NaN`.
|
|
6
|
-
|
|
7
|
-
If `a < 1`, `b < 1`, or `a = b = 1`, the function returns `NaN`.
|
|
8
|
-
|
|
9
|
-
Parameters
|
|
10
|
-
----------
|
|
11
|
-
a: number
|
|
12
|
-
First shape parameter.
|
|
13
|
-
|
|
14
|
-
b: number
|
|
15
|
-
Second shape parameter.
|
|
16
|
-
|
|
17
|
-
Returns
|
|
18
|
-
-------
|
|
19
|
-
out: number
|
|
20
|
-
Mode.
|
|
21
|
-
|
|
22
|
-
Examples
|
|
23
|
-
--------
|
|
24
|
-
> var v = {{alias}}( 1.5, 1.5 )
|
|
25
|
-
~0.543
|
|
26
|
-
> v = {{alias}}( 4.0, 12.0 )
|
|
27
|
-
~0.503
|
|
28
|
-
> v = {{alias}}( 16.0, 8.0 )
|
|
29
|
-
~0.875
|
|
30
|
-
|
|
31
|
-
See Also
|
|
32
|
-
--------
|
|
33
|
-
|
package/docs/types/test.ts
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @license Apache-2.0
|
|
3
|
-
*
|
|
4
|
-
* Copyright (c) 2019 The Stdlib Authors.
|
|
5
|
-
*
|
|
6
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
-
* you may not use this file except in compliance with the License.
|
|
8
|
-
* You may obtain a copy of the License at
|
|
9
|
-
*
|
|
10
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
*
|
|
12
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
-
* See the License for the specific language governing permissions and
|
|
16
|
-
* limitations under the License.
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
import mode = require( './index' );
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
// TESTS //
|
|
23
|
-
|
|
24
|
-
// The function returns a number...
|
|
25
|
-
{
|
|
26
|
-
mode( 8, 2 ); // $ExpectType number
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// The function does not compile if provided values other than two numbers...
|
|
30
|
-
{
|
|
31
|
-
mode( true, 3 ); // $ExpectError
|
|
32
|
-
mode( false, 2 ); // $ExpectError
|
|
33
|
-
mode( '5', 1 ); // $ExpectError
|
|
34
|
-
mode( [], 1 ); // $ExpectError
|
|
35
|
-
mode( {}, 2 ); // $ExpectError
|
|
36
|
-
mode( ( x: number ): number => x, 2 ); // $ExpectError
|
|
37
|
-
|
|
38
|
-
mode( 9, true ); // $ExpectError
|
|
39
|
-
mode( 9, false ); // $ExpectError
|
|
40
|
-
mode( 5, '5' ); // $ExpectError
|
|
41
|
-
mode( 8, [] ); // $ExpectError
|
|
42
|
-
mode( 9, {} ); // $ExpectError
|
|
43
|
-
mode( 8, ( x: number ): number => x ); // $ExpectError
|
|
44
|
-
|
|
45
|
-
mode( [], true ); // $ExpectError
|
|
46
|
-
mode( {}, false ); // $ExpectError
|
|
47
|
-
mode( false, '5' ); // $ExpectError
|
|
48
|
-
mode( {}, [] ); // $ExpectError
|
|
49
|
-
mode( '5', ( x: number ): number => x ); // $ExpectError
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
// The function does not compile if provided insufficient arguments...
|
|
53
|
-
{
|
|
54
|
-
mode(); // $ExpectError
|
|
55
|
-
mode( 3 ); // $ExpectError
|
|
56
|
-
}
|
/package/lib/{mode.js → main.js}
RENAMED
|
File without changes
|