@stdlib/stats-base-dists-frechet-median 0.0.7 → 0.1.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/CITATION.cff ADDED
@@ -0,0 +1,30 @@
1
+ cff-version: 1.2.0
2
+ title: stdlib
3
+ message: >-
4
+ If you use this software, please cite it using the
5
+ metadata from this file.
6
+
7
+ type: software
8
+
9
+ authors:
10
+ - name: The Stdlib Authors
11
+ url: https://github.com/stdlib-js/stdlib/graphs/contributors
12
+
13
+ repository-code: https://github.com/stdlib-js/stdlib
14
+ url: https://stdlib.io
15
+
16
+ abstract: |
17
+ Standard library for JavaScript and Node.js.
18
+
19
+ keywords:
20
+ - JavaScript
21
+ - Node.js
22
+ - TypeScript
23
+ - standard library
24
+ - scientific computing
25
+ - numerical computing
26
+ - statistical computing
27
+
28
+ license: Apache-2.0 AND BSL-1.0
29
+
30
+ date-released: 2016
package/NOTICE CHANGED
@@ -1 +1 @@
1
- Copyright (c) 2016-2022 The Stdlib Authors.
1
+ Copyright (c) 2016-2023 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
  # Median
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] -->
@@ -197,7 +208,7 @@ See [LICENSE][stdlib-license].
197
208
 
198
209
  ## Copyright
199
210
 
200
- Copyright &copy; 2016-2022. The Stdlib [Authors][stdlib-authors].
211
+ Copyright &copy; 2016-2023. The Stdlib [Authors][stdlib-authors].
201
212
 
202
213
  </section>
203
214
 
@@ -210,8 +221,8 @@ Copyright &copy; 2016-2022. The Stdlib [Authors][stdlib-authors].
210
221
  [npm-image]: http://img.shields.io/npm/v/@stdlib/stats-base-dists-frechet-median.svg
211
222
  [npm-url]: https://npmjs.org/package/@stdlib/stats-base-dists-frechet-median
212
223
 
213
- [test-image]: https://github.com/stdlib-js/stats-base-dists-frechet-median/actions/workflows/test.yml/badge.svg?branch=v0.0.7
214
- [test-url]: https://github.com/stdlib-js/stats-base-dists-frechet-median/actions/workflows/test.yml?query=branch:v0.0.7
224
+ [test-image]: https://github.com/stdlib-js/stats-base-dists-frechet-median/actions/workflows/test.yml/badge.svg?branch=v0.1.0
225
+ [test-url]: https://github.com/stdlib-js/stats-base-dists-frechet-median/actions/workflows/test.yml?query=branch:v0.1.0
215
226
 
216
227
  [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/stats-base-dists-frechet-median/main.svg
217
228
  [coverage-url]: https://codecov.io/github/stdlib-js/stats-base-dists-frechet-median?branch=main
@@ -224,7 +235,7 @@ Copyright &copy; 2016-2022. The Stdlib [Authors][stdlib-authors].
224
235
  -->
225
236
 
226
237
  [chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg
227
- [chat-url]: https://gitter.im/stdlib-js/stdlib/
238
+ [chat-url]: https://app.gitter.im/#/room/#stdlib-js_stdlib:gitter.im
228
239
 
229
240
  [stdlib]: https://github.com/stdlib-js/stdlib
230
241
 
@@ -0,0 +1,3 @@
1
+ /// <reference path="../docs/types/index.d.ts" />
2
+ import median from '../docs/types/index';
3
+ export = median;
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 n=s(function(N,u){
2
+ var i=require('@stdlib/math-base-assert-is-nan/dist'),a=require('@stdlib/math-base-special-pow/dist'),o=require('@stdlib/constants-float64-ln-two/dist');function q(e,r,t){return i(e)||i(r)||i(t)||e<=0||r<=0?NaN:t+r*a(o,-1/e)}u.exports=q
3
+ });var v=n();module.exports=v;
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' );\nvar LN2 = require( '@stdlib/constants-float64-ln-two' );\n\n\n// MAIN //\n\n/**\n* Returns the median for a Fr\u00E9chet distribution with shape `alpha`, scale `s`, and location `m`.\n*\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} s - scale parameter\n* @param {number} m - location parameter\n* @returns {number} median\n*\n* @example\n* var y = median( 5.0, 2.0, 0.0 );\n* // returns ~2.152\n*\n* @example\n* var y = median( 5.0, 2.0, -5.0 );\n* // returns ~-2.848\n*\n* @example\n* var y = median( 1.0, 1.0, 0.0 );\n* // returns ~1.443\n*\n* @example\n* var y = median( NaN, 1.0, 0.0 );\n* // returns NaN\n*\n* @example\n* var y = median( 1.0, NaN, 0.0 );\n* // returns NaN\n*\n* @example\n* var y = median( 1.0, 1.0, NaN );\n* // returns NaN\n*/\nfunction median( alpha, s, m ) {\n\tif (\n\t\tisnan( alpha ) ||\n\t\tisnan( s ) ||\n\t\tisnan( m ) ||\n\t\talpha <= 0.0 ||\n\t\ts <= 0.0\n\t) {\n\t\treturn NaN;\n\t}\n\treturn m + ( s * pow( LN2, -1.0/alpha ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = median;\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* Fr\u00E9chet distribution median.\n*\n* @module @stdlib/stats-base-dists-frechet-median\n*\n* @example\n* var median = require( '@stdlib/stats-base-dists-frechet-median' );\n*\n* var y = median( 4.0, 2.0, 0.0 );\n* // returns ~2.192\n*\n* y = median( 1.0, 1.0, -3.0 );\n* // returns ~-1.557\n*/\n\n// MODULES //\n\nvar median = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = median;\n"],
5
+ "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAQ,QAAS,iCAAkC,EACnDC,EAAM,QAAS,+BAAgC,EAC/CC,EAAM,QAAS,kCAAmC,EAqCtD,SAASC,EAAQC,EAAOC,EAAGC,EAAI,CAC9B,OACCN,EAAOI,CAAM,GACbJ,EAAOK,CAAE,GACTL,EAAOM,CAAE,GACTF,GAAS,GACTC,GAAK,EAEE,IAEDC,EAAMD,EAAIJ,EAAKC,EAAK,GAAKE,CAAM,CACvC,CAKAL,EAAO,QAAUI,ICxCjB,IAAII,EAAS,IAKb,OAAO,QAAUA",
6
+ "names": ["require_main", "__commonJSMin", "exports", "module", "isnan", "pow", "LN2", "median", "alpha", "s", "m", "median"]
7
+ }
@@ -16,7 +16,7 @@
16
16
  * limitations under the License.
17
17
  */
18
18
 
19
- // TypeScript Version: 2.0
19
+ // TypeScript Version: 4.1
20
20
 
21
21
  /**
22
22
  * Returns the median for a Fréchet distribution with shape `alpha`, scale `s`, and location `m`.
package/lib/index.js CHANGED
@@ -35,7 +35,7 @@
35
35
 
36
36
  // MODULES //
37
37
 
38
- var median = require( './median.js' );
38
+ var median = require( './main.js' );
39
39
 
40
40
 
41
41
  // EXPORTS //
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stdlib/stats-base-dists-frechet-median",
3
- "version": "0.0.7",
3
+ "version": "0.1.0",
4
4
  "description": "Fréchet distribution median.",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -37,20 +37,20 @@
37
37
  "url": "https://github.com/stdlib-js/stdlib/issues"
38
38
  },
39
39
  "dependencies": {
40
- "@stdlib/constants-float64-ln-two": "^0.0.x",
41
- "@stdlib/math-base-assert-is-nan": "^0.0.x",
42
- "@stdlib/math-base-special-pow": "^0.0.x"
40
+ "@stdlib/constants-float64-ln-two": "^0.1.0",
41
+ "@stdlib/math-base-assert-is-nan": "^0.1.0",
42
+ "@stdlib/math-base-special-pow": "^0.1.0"
43
43
  },
44
44
  "devDependencies": {
45
- "@stdlib/bench": "^0.0.x",
46
- "@stdlib/constants-float64-eps": "^0.0.x",
47
- "@stdlib/constants-float64-ninf": "^0.0.x",
48
- "@stdlib/constants-float64-pinf": "^0.0.x",
49
- "@stdlib/math-base-special-abs": "^0.0.x",
50
- "@stdlib/random-base-randu": "^0.0.x",
45
+ "@stdlib/bench": "^0.1.0",
46
+ "@stdlib/constants-float64-eps": "^0.1.0",
47
+ "@stdlib/constants-float64-ninf": "^0.1.0",
48
+ "@stdlib/constants-float64-pinf": "^0.1.0",
49
+ "@stdlib/math-base-special-abs": "^0.1.0",
50
+ "@stdlib/random-base-randu": "^0.0.8",
51
51
  "tape": "git+https://github.com/kgryte/tape.git#fix/globby",
52
52
  "istanbul": "^0.4.1",
53
- "tap-spec": "5.x.x"
53
+ "tap-min": "git+https://github.com/Planeshifter/tap-min.git"
54
54
  },
55
55
  "engines": {
56
56
  "node": ">=0.10.0",
@@ -86,7 +86,7 @@
86
86
  "univariate"
87
87
  ],
88
88
  "funding": {
89
- "type": "patreon",
90
- "url": "https://www.patreon.com/athan"
89
+ "type": "opencollective",
90
+ "url": "https://opencollective.com/stdlib"
91
91
  }
92
92
  }
package/docs/repl.txt DELETED
@@ -1,43 +0,0 @@
1
-
2
- {{alias}}( α, s, m )
3
- Returns the median of a Fréchet distribution with shape parameter
4
- `α`, scale parameter `s`, and location `m`.
5
-
6
- If provided `NaN` as any argument, the function returns `NaN`.
7
-
8
- If provided `α <= 0` or `s <= 0`, the function returns `NaN`.
9
-
10
- Parameters
11
- ----------
12
- α: number
13
- Shape parameter.
14
-
15
- s: number
16
- Scale parameter.
17
-
18
- m: number
19
- Location parameter.
20
-
21
- Returns
22
- -------
23
- out: number
24
- Median.
25
-
26
- Examples
27
- --------
28
- > var y = {{alias}}( 4.0, 2.0, 1.0 )
29
- ~3.192
30
- > var y = {{alias}}( 4.0, 2.0, -3.0 )
31
- ~-0.808
32
- > y = {{alias}}( 0.5, 2.0, 1.0 )
33
- ~5.163
34
- > y = {{alias}}( NaN, 1.0, 0.0 )
35
- NaN
36
- > y = {{alias}}( 1.0, NaN, 0.0 )
37
- NaN
38
- > y = {{alias}}( 1.0, 1.0, NaN )
39
- NaN
40
-
41
- See Also
42
- --------
43
-
@@ -1,58 +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 median = require( './index' );
20
-
21
-
22
- // TESTS //
23
-
24
- // The function returns a number...
25
- {
26
- median( 1, 1, 1 ); // $ExpectType number
27
- }
28
-
29
- // The function does not compile if provided values other than three numbers...
30
- {
31
- median( true, 2, 2 ); // $ExpectError
32
- median( false, 2, 1.5 ); // $ExpectError
33
- median( '5', 0.5, 0.5 ); // $ExpectError
34
- median( [], 0.5, 0.5 ); // $ExpectError
35
- median( {}, 2, 1 ); // $ExpectError
36
- median( ( x: number ): number => x, 2, 1 ); // $ExpectError
37
-
38
- median( 9, true, 12 ); // $ExpectError
39
- median( 9, false, 12 ); // $ExpectError
40
- median( 5, '5', 8 ); // $ExpectError
41
- median( 8, [], 10 ); // $ExpectError
42
- median( 9, {}, 12 ); // $ExpectError
43
- median( 8, ( x: number ): number => x, 12 ); // $ExpectError
44
-
45
- median( 9, 4, true ); // $ExpectError
46
- median( 9, 4, false ); // $ExpectError
47
- median( 5, 10, '5' ); // $ExpectError
48
- median( 8, 8, [] ); // $ExpectError
49
- median( 9, 18, {} ); // $ExpectError
50
- median( 8, 4, ( x: number ): number => x ); // $ExpectError
51
- }
52
-
53
- // The function does not compile if provided insufficient arguments...
54
- {
55
- median(); // $ExpectError
56
- median( 3 ); // $ExpectError
57
- median( 3, 6 ); // $ExpectError
58
- }
File without changes