@stdlib/stats-padjust 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/LICENSE CHANGED
@@ -175,307 +175,3 @@
175
175
  of your accepting any such warranty or additional liability.
176
176
 
177
177
  END OF TERMS AND CONDITIONS
178
-
179
-
180
-
181
- Boost Software License - Version 1.0 - August 17th, 2003
182
-
183
- Permission is hereby granted, free of charge, to any person or organization
184
- obtaining a copy of the software and accompanying documentation covered by this
185
- license (the "Software") to use, reproduce, display, distribute, execute, and
186
- transmit the Software, and to prepare derivative works of the Software, and to
187
- permit third-parties to whom the Software is furnished to do so, all subject to
188
- the following:
189
-
190
- The copyright notices in the Software and this entire statement, including the
191
- above license grant, this restriction and the following disclaimer, must be
192
- included in all copies of the Software, in whole or in part, and all derivative
193
- works of the Software, unless such copies or derivative works are solely in the
194
- form of machine-executable object code generated by a source language processor.
195
-
196
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
197
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
198
- FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
199
- COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES
200
- OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
201
- OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
202
-
203
-
204
-
205
-
206
- DEPENDENCIES
207
-
208
- The library links against the following external libraries, which have their own
209
- licenses:
210
-
211
- * OpenBLAS <https://raw.githubusercontent.com/xianyi/OpenBLAS/
212
- def146efed8d5908ea04e22668feeab7099599a0/LICENSE>
213
-
214
- Copyright (c) 2011-2014, The OpenBLAS Project
215
- All rights reserved.
216
-
217
- Redistribution and use in source and binary forms, with or without
218
- modification, are permitted provided that the following conditions are
219
- met:
220
-
221
- 1. Redistributions of source code must retain the above copyright
222
- notice, this list of conditions and the following disclaimer.
223
-
224
- 2. Redistributions in binary form must reproduce the above copyright
225
- notice, this list of conditions and the following disclaimer in
226
- the documentation and/or other materials provided with the
227
- distribution.
228
-
229
- 3. Neither the name of the OpenBLAS project nor the names of
230
- its contributors may be used to endorse or promote products
231
- derived from this software without specific prior written
232
- permission.
233
-
234
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
235
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
236
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
237
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
238
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
239
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
240
- GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
241
- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
242
- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
243
- THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
244
-
245
-
246
- * Electron <https://raw.githubusercontent.com/electron/electron/
247
- c4cfb3e7110266b9d7ad80e1ae097c4db564501c/LICENSE>
248
-
249
- Copyright (c) 2013-2017 GitHub Inc.
250
-
251
- Permission is hereby granted, free of charge, to any person obtaining
252
- a copy of this software and associated documentation files (the
253
- "Software"), to deal in the Software without restriction, including
254
- without limitation the rights to use, copy, modify, merge, publish,
255
- distribute, sublicense, and/or sell copies of the Software, and to
256
- permit persons to whom the Software is furnished to do so, subject to
257
- the following conditions:
258
-
259
- The above copyright notice and this permission notice shall be
260
- included in all copies or substantial portions of the Software.
261
-
262
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
263
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
264
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
265
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
266
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
267
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
268
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
269
-
270
-
271
- * Boost <http://www.boost.org/LICENSE_1_0.txt>
272
-
273
- Boost Software License - Version 1.0 - August 17th, 2003
274
-
275
- Permission is hereby granted, free of charge, to any person or organization
276
- obtaining a copy of the software and accompanying documentation covered by
277
- this license (the "Software") to use, reproduce, display, distribute,
278
- execute, and transmit the Software, and to prepare derivative works of the
279
- Software, and to permit third-parties to whom the Software is furnished to
280
- do so, all subject to the following:
281
-
282
- The copyright notices in the Software and this entire statement, including
283
- the above license grant, this restriction and the following disclaimer,
284
- must be included in all copies of the Software, in whole or in part, and
285
- all derivative works of the Software, unless such copies or derivative
286
- works are solely in the form of machine-executable object code generated by
287
- a source language processor.
288
-
289
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
290
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
291
- FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
292
- SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
293
- FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
294
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
295
- DEALINGS IN THE SOFTWARE.
296
-
297
-
298
- * Cephes <http://www.netlib.org/cephes/readme>
299
-
300
- Copyright (c) 1984-2000 Stephen L. Moshier
301
-
302
- Some software in this archive may be from the book _Methods and Programs for
303
- Mathematical Functions_ (Prentice-Hall or Simon & Schuster International, 1989)
304
- or from the Cephes Mathematical Library, a commercial product. In either event,
305
- it is copyrighted by the author. What you see here may be used freely but it
306
- comes with no support or guarantee.
307
-
308
- Stephen L. Moshier
309
- moshier@na-net.ornl.gov
310
-
311
-
312
-
313
- ATTRIBUTION
314
-
315
- The library contains implementations from the following external libraries,
316
- which have their own licenses:
317
-
318
- * FreeBSD <https://svnweb.freebsd.org/>
319
-
320
- Copyright (C) 1993-2004 by Sun Microsystems, Inc. All rights reserved.
321
-
322
- Developed at SunPro, a Sun Microsystems, Inc. business.
323
- Permission to use, copy, modify, and distribute this
324
- software is freely granted, provided that this notice
325
- is preserved.
326
-
327
-
328
- * FDLIBM <http://www.netlib.org/fdlibm/>
329
-
330
- Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved.
331
-
332
- Developed at SunPro, a Sun Microsystems, Inc. business.
333
- Permission to use, copy, modify, and distribute this
334
- software is freely granted, provided that this notice
335
- is preserved.
336
-
337
-
338
- * Go <https://raw.githubusercontent.com/golang/go/master/LICENSE>
339
-
340
- Copyright (c) 2009 The Go Authors. All rights reserved.
341
-
342
- Redistribution and use in source and binary forms, with or without
343
- modification, are permitted provided that the following conditions are
344
- met:
345
-
346
- * Redistributions of source code must retain the above copyright
347
- notice, this list of conditions and the following disclaimer.
348
- * Redistributions in binary form must reproduce the above
349
- copyright notice, this list of conditions and the following disclaimer
350
- in the documentation and/or other materials provided with the
351
- distribution.
352
- * Neither the name of Google Inc. nor the names of its
353
- contributors may be used to endorse or promote products derived from
354
- this software without specific prior written permission.
355
-
356
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
357
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
358
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
359
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
360
- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
361
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
362
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
363
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
364
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
365
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
366
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
367
-
368
-
369
- * SLATEC Common Mathematical Library <http://www.netlib.no/netlib/slatec/>
370
-
371
- Public domain.
372
-
373
-
374
- * ESLint <https://raw.githubusercontent.com/eslint/eslint/master/LICENSE>
375
-
376
- Copyright JS Foundation and other contributors, https://js.foundation
377
-
378
- Permission is hereby granted, free of charge, to any person obtaining a copy
379
- of this software and associated documentation files (the "Software"), to deal
380
- in the Software without restriction, including without limitation the rights
381
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
382
- copies of the Software, and to permit persons to whom the Software is
383
- furnished to do so, subject to the following conditions:
384
-
385
- The above copyright notice and this permission notice shall be included in
386
- all copies or substantial portions of the Software.
387
-
388
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
389
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
390
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
391
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
392
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
393
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
394
- THE SOFTWARE.
395
-
396
-
397
- * StatsFuns.jl <https://raw.githubusercontent.com/JuliaStats/StatsFuns.jl/
398
- e66dd973650c375bc1739c820e5b96bb5bd000a8/LICENSE.md>
399
-
400
- Copyright (c) 2015: Dahua Lin.
401
-
402
- Permission is hereby granted, free of charge, to any person obtaining
403
- a copy of this software and associated documentation files (the
404
- "Software"), to deal in the Software without restriction, including
405
- without limitation the rights to use, copy, modify, merge, publish,
406
- distribute, sublicense, and/or sell copies of the Software, and to
407
- permit persons to whom the Software is furnished to do so, subject to
408
- the following conditions:
409
-
410
- The above copyright notice and this permission notice shall be
411
- included in all copies or substantial portions of the Software.
412
-
413
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
414
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
415
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
416
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
417
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
418
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
419
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
420
-
421
-
422
- * SpecialFunctions.jl <https://raw.githubusercontent.com/JuliaMath/
423
- SpecialFunctions.jl/02a173fbe24a61c4b392aec17a9764ac5727feb1/LICENSE>
424
-
425
- The MIT License (MIT)
426
-
427
- Copyright (c) 2017 Jeff Bezanson, Stefan Karpinski, Viral B. Shah, and others:
428
-
429
- https://github.com/JuliaMath/SpecialFunctions.jl/graphs/contributors
430
-
431
- Permission is hereby granted, free of charge, to any person obtaining a copy
432
- of this software and associated documentation files (the "Software"), to deal
433
- in the Software without restriction, including without limitation the rights
434
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
435
- copies of the Software, and to permit persons to whom the Software is
436
- furnished to do so, subject to the following conditions:
437
-
438
- The above copyright notice and this permission notice shall be included in all
439
- copies or substantial portions of the Software.
440
-
441
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
442
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
443
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
444
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
445
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
446
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
447
- SOFTWARE.
448
-
449
-
450
- * MT19937 <http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/CODES/
451
- mt19937ar.c>
452
-
453
- Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
454
- All rights reserved.
455
-
456
- Redistribution and use in source and binary forms, with or without
457
- modification, are permitted provided that the following conditions
458
- are met:
459
-
460
- 1. Redistributions of source code must retain the above copyright
461
- notice, this list of conditions and the following disclaimer.
462
-
463
- 2. Redistributions in binary form must reproduce the above copyright
464
- notice, this list of conditions and the following disclaimer in the
465
- documentation and/or other materials provided with the distribution.
466
-
467
- 3. The names of its contributors may not be used to endorse or promote
468
- products derived from this software without specific prior written
469
- permission.
470
-
471
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
472
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
473
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
474
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
475
- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
476
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
477
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
478
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
479
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
480
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
481
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package/NOTICE CHANGED
@@ -1 +1 @@
1
- Copyright (c) 2016-2022 The Stdlib Authors.
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
  # padjust
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] -->
@@ -156,7 +167,7 @@ See [LICENSE][stdlib-license].
156
167
 
157
168
  ## Copyright
158
169
 
159
- Copyright &copy; 2016-2022. The Stdlib [Authors][stdlib-authors].
170
+ Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].
160
171
 
161
172
  </section>
162
173
 
@@ -169,8 +180,8 @@ Copyright &copy; 2016-2022. The Stdlib [Authors][stdlib-authors].
169
180
  [npm-image]: http://img.shields.io/npm/v/@stdlib/stats-padjust.svg
170
181
  [npm-url]: https://npmjs.org/package/@stdlib/stats-padjust
171
182
 
172
- [test-image]: https://github.com/stdlib-js/stats-padjust/actions/workflows/test.yml/badge.svg
173
- [test-url]: https://github.com/stdlib-js/stats-padjust/actions/workflows/test.yml
183
+ [test-image]: https://github.com/stdlib-js/stats-padjust/actions/workflows/test.yml/badge.svg?branch=v0.2.0
184
+ [test-url]: https://github.com/stdlib-js/stats-padjust/actions/workflows/test.yml?query=branch:v0.2.0
174
185
 
175
186
  [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/stats-padjust/main.svg
176
187
  [coverage-url]: https://codecov.io/github/stdlib-js/stats-padjust?branch=main
@@ -182,19 +193,23 @@ Copyright &copy; 2016-2022. The Stdlib [Authors][stdlib-authors].
182
193
 
183
194
  -->
184
195
 
196
+ [chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg
197
+ [chat-url]: https://app.gitter.im/#/room/#stdlib-js_stdlib:gitter.im
198
+
199
+ [stdlib]: https://github.com/stdlib-js/stdlib
200
+
201
+ [stdlib-authors]: https://github.com/stdlib-js/stdlib/graphs/contributors
202
+
185
203
  [umd]: https://github.com/umdjs/umd
186
204
  [es-module]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
187
205
 
188
206
  [deno-url]: https://github.com/stdlib-js/stats-padjust/tree/deno
207
+ [deno-readme]: https://github.com/stdlib-js/stats-padjust/blob/deno/README.md
189
208
  [umd-url]: https://github.com/stdlib-js/stats-padjust/tree/umd
209
+ [umd-readme]: https://github.com/stdlib-js/stats-padjust/blob/umd/README.md
190
210
  [esm-url]: https://github.com/stdlib-js/stats-padjust/tree/esm
191
-
192
- [chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg
193
- [chat-url]: https://gitter.im/stdlib-js/stdlib/
194
-
195
- [stdlib]: https://github.com/stdlib-js/stdlib
196
-
197
- [stdlib-authors]: https://github.com/stdlib-js/stdlib/graphs/contributors
211
+ [esm-readme]: https://github.com/stdlib-js/stats-padjust/blob/esm/README.md
212
+ [branches-url]: https://github.com/stdlib-js/stats-padjust/blob/main/branches.md
198
213
 
199
214
  [stdlib-license]: https://raw.githubusercontent.com/stdlib-js/stats-padjust/main/LICENSE
200
215
 
package/SECURITY.md ADDED
@@ -0,0 +1,5 @@
1
+ # Security
2
+
3
+ > Policy for reporting security vulnerabilities.
4
+
5
+ See the security policy [in the main project repository](https://github.com/stdlib-js/stdlib/security).
@@ -0,0 +1,3 @@
1
+ /// <reference path="../docs/types/index.d.ts" />
2
+ import padjust from '../docs/types/index';
3
+ export = padjust;
package/dist/index.js ADDED
@@ -0,0 +1,17 @@
1
+ "use strict";var g=function(r,t){return function(){return t||r((t={exports:{}}).exports,t),t.exports}};var c=g(function(br,m){
2
+ function N(r,t){var i,n;for(n=0;n<r.length;n++)i=r[n],r[n]=t*i>1?1:t*i;return r}m.exports=N
3
+ });var l=g(function(yr,A){
4
+ var O=require('@stdlib/array-int32/dist');function R(r,t){return r<t?-1:r>t?1:0}function z(r,t){return r<t?1:r>t?-1:0}function B(r,t){var i,n,u;for(i=t?z:R,n=new O(r.length),u=0;u<r.length;u++)n[u]=u;return n.sort(f);function f(e,v){return i(r[e],r[v])}}A.exports=B
5
+ });var j=g(function(mr,T){
6
+ var C=require('@stdlib/math-base-special-min/dist'),x=require('@stdlib/math-base-special-max/dist'),E=require('@stdlib/array-float64/dist'),F=require('@stdlib/constants-float64-pinf/dist'),G=l(),J=Array.prototype.slice;function K(r,t){var i,n,u,f,e,v,b,y,a,o,h,d,q;if(e=r.length,n=t-e,n>0)for(r=J.call(r);n>0;)r.push(1),n-=1;for(i=G(r),y=F,a=0;a<t;a++)q=t*r[a]/(a+1),q<y&&(y=q);for(d=new E(t),u=new E(t),a=t-1;a>1;a--){for(b=F,h=t-a+1;h<=t;h++)q=a*r[i[h]]/(2+h-t+a-1),q<b&&(b=q);for(o=0;o<t-a+1;o++)d[o]=C(a*r[i[o]],b);for(h=t-a+1;h<=t;h++)d[h]=d[t-a];for(o=0;o<u.length;o++)u[o]=x(d[o],u[o])}for(v=new Array(e),a=0;a<e;a++)f=i[a],q=x(u[a],r[f]),v[f]=q;return v}T.exports=K
7
+ });var P=g(function(cr,V){
8
+ var L=require('@stdlib/math-base-special-min/dist'),Q=require('@stdlib/stats-base-cumax/dist'),U=require('@stdlib/array-float64/dist'),W=l();function X(r,t){var i,n,u,f,e;for(u=r.length,i=W(r),n=new U(u),e=0;e<u;e++)n[e]=(t-e)*r[i[e]];for(n=Q(u,n,1,n,1),f=new Array(u),e=0;e<u;e++)f[i[e]]=L(n[e],1);return f}V.exports=X
9
+ });var I=g(function(Ar,S){
10
+ var Y=require('@stdlib/math-base-special-min/dist'),Z=require('@stdlib/stats-base-cumin/dist'),_=require('@stdlib/array-float64/dist'),$=l();function s(r,t){var i,n,u,f,e;for(u=r.length,i=$(r,!0),n=new _(u),e=0;e<u;e++)n[e]=t/(u-e)*r[i[e]];for(n=Z(u,n,1,n,1),f=new Array(u),e=0;e<u;e++)f[i[e]]=Y(n[e],1);return f}S.exports=s
11
+ });var D=g(function(xr,k){
12
+ var p=require('@stdlib/math-base-special-min/dist'),rr=require('@stdlib/stats-base-cumin/dist'),er=require('@stdlib/array-float64/dist'),tr=l();function ir(r,t){var i,n,u,f,e,v;for(u=r.length,i=tr(r,!0),v=0,e=0;e<t;e++)v+=1/(1+e);for(n=new er(u),e=0;e<u;e++)n[e]=v*t/(u-e)*r[i[e]];for(n=rr(u,n,1,n,1),f=new Array(u),e=0;e<u;e++)f[i[e]]=p(n[e],1);return f}k.exports=ir
13
+ });var M=g(function(Er,H){
14
+ var nr=require('@stdlib/assert-is-probability-array/dist'),ur=require('@stdlib/assert-is-integer/dist').isPrimitive,ar=require('@stdlib/assert-is-string/dist').isPrimitive,w=require('@stdlib/error-tools-fmtprodmsg/dist'),fr=c(),or=j(),vr=P(),hr=I(),qr=D(),gr=["bh","bonferroni","by","holm","hommel"];function dr(r,t,i){if(!nr(r))throw new TypeError(w('1Ll9x',r));if(!ar(t))throw new TypeError(w('1Ll39',t));if(arguments.length>2){if(!ur(i))throw new TypeError(w('1Ll2z',i));if(i<r.length)throw new RangeError(w('1LlDP',i))}switch(i=i||r.length,t){case"bonferroni":return fr(r,i);case"by":return qr(r,i);case"bh":return hr(r,i);case"holm":return vr(r,i);case"hommel":return or(r,i);default:throw new Error(w('1LlDQ',gr.join('", "'),t))}}H.exports=dr
15
+ });var lr=M();module.exports=lr;
16
+ /** @license Apache-2.0 */
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../lib/bonferroni.js", "../lib/order.js", "../lib/hommel.js", "../lib/holm.js", "../lib/bh.js", "../lib/by.js", "../lib/main.js", "../lib/index.js"],
4
+ "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 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* Adjusts the p-values via the Bonferroni method.\n*\n* @private\n* @param {ProbabilityArray} pvalues - p-values to be adjusted\n* @param {PositiveInteger} comparisons - number of comparisons\n* @returns {ProbabilityArray} adjusted p-values\n*/\nfunction bonferroni( pvalues, comparisons ) {\n\tvar pval;\n\tvar i;\n\tfor ( i = 0; i < pvalues.length; i++ ) {\n\t\tpval = pvalues[ i ];\n\t\tpvalues[ i ] = ( comparisons * pval > 1 ) ? 1 : comparisons * pval;\n\t}\n\treturn pvalues;\n}\n\n\n// EXPORTS //\n\nmodule.exports = bonferroni;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 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 Int32Array = require( '@stdlib/array-int32' );\n\n\n// FUNCTIONS //\n\n/**\n* Returns a comparison result. If `-1`, `a` comes before `b`. If `1`, `b` comes before `a`. If `0`, the order stays the same.\n*\n* @private\n* @param {number} a - first number\n* @param {number} b - second number\n* @returns {boolean} comparison result\n*/\nfunction ascending( a, b ) {\n\tif ( a < b ) {\n\t\treturn -1;\n\t}\n\tif ( a > b ) {\n\t\treturn 1;\n\t}\n\treturn 0;\n}\n\n/**\n* Returns a comparison result. If `-1`, `a` comes before `b`. If `1`, `b` comes before `a`. If `0`, the order stays the same.\n*\n* @private\n* @param {number} a - first number\n* @param {number} b - second number\n* @returns {boolean} comparison result\n*/\nfunction descending( a, b ) {\n\tif ( a < b ) {\n\t\treturn 1;\n\t}\n\tif ( a > b ) {\n\t\treturn -1;\n\t}\n\treturn 0;\n}\n\n\n// MAIN //\n\n/**\n* Returns a permutation which rearranges input array.\n*\n* @private\n* @param {ArrayLike} x - input array-like object\n* @param {boolean} invert - controls whether to permutation that sorts input array in descending order\n* @returns {Array} permutation array\n*/\nfunction order( x, invert ) {\n\tvar comparator;\n\tvar arr;\n\tvar i;\n\n\tcomparator = ( invert ) ? descending : ascending;\n\tarr = new Int32Array( x.length );\n\tfor ( i = 0; i < x.length; i++ ) {\n\t\tarr[ i ] = i;\n\t}\n\treturn arr.sort( compare );\n\n\t/**\n\t* Compare the elements of the input array.\n\t*\n\t* @private\n\t* @param {number} a - first number\n\t* @param {number} b - second number\n\t* @returns {boolean} comparison result\n\t*/\n\tfunction compare( a, b ) {\n\t\treturn comparator( x[a], x[b] );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = order;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 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 min = require( '@stdlib/math-base-special-min' );\nvar max = require( '@stdlib/math-base-special-max' );\nvar Float64Array = require( '@stdlib/array-float64' );\nvar PINF = require( '@stdlib/constants-float64-pinf' );\nvar order = require( './order.js' );\n\n\n// VARIABLES //\n\nvar slice = Array.prototype.slice;\n\n\n// MAIN //\n\n/**\n* Adjusts the p-values via Hommel's method.\n*\n* @private\n* @param {ProbabilityArray} pvalues - p-values to be adjusted\n* @param {PositiveInteger} comparisons - number of comparisons\n* @returns {ProbabilityArray} adjusted p-values\n*/\nfunction hommel( pvalues, comparisons ) {\n\tvar indices;\n\tvar diff;\n\tvar adj;\n\tvar idx;\n\tvar len;\n\tvar out;\n\tvar mq;\n\tvar m;\n\tvar i;\n\tvar j;\n\tvar k;\n\tvar q;\n\tvar v;\n\n\tlen = pvalues.length;\n\tdiff = comparisons - len;\n\tif ( diff > 0 ) {\n\t\tpvalues = slice.call( pvalues );\n\t\twhile ( diff > 0 ) {\n\t\t\tpvalues.push( 1.0 );\n\t\t\tdiff -= 1;\n\t\t}\n\t}\n\tindices = order( pvalues );\n\tm = PINF;\n\tfor ( i = 0; i < comparisons; i++ ) {\n\t\tv = comparisons * pvalues[ i ] / ( i+1 );\n\t\tif ( v < m ) {\n\t\t\tm = v;\n\t\t}\n\t}\n\tq = new Float64Array( comparisons );\n\tadj = new Float64Array( comparisons );\n\tfor ( i = comparisons - 1; i > 1; i-- ) {\n\t\tmq = PINF;\n\t\tfor ( k = comparisons - i + 1; k <= comparisons; k++ ) {\n\t\t\tv = i * pvalues[ indices[ k ] ] / ( 2 + k - comparisons + i - 1 );\n\t\t\tif ( v < mq ) {\n\t\t\t\tmq = v;\n\t\t\t}\n\t\t}\n\t\tfor ( j = 0; j < comparisons - i + 1; j++ ) {\n\t\t\tq[ j ] = min( i * pvalues[ indices[ j ] ], mq );\n\t\t}\n\t\tfor ( k = comparisons - i + 1; k <= comparisons; k++ ) {\n\t\t\tq[ k ] = q[ comparisons - i ];\n\t\t}\n\t\tfor ( j = 0; j < adj.length; j++ ) {\n\t\t\tadj[ j ] = max( q[ j ], adj[ j ] );\n\t\t}\n\t}\n\tout = new Array( len );\n\tfor ( i = 0; i < len; i++ ) {\n\t\tidx = indices[ i ];\n\t\tv = max( adj[ i ], pvalues[ idx ] );\n\t\tout[ idx ] = v;\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = hommel;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 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 min = require( '@stdlib/math-base-special-min' );\nvar cumax = require( '@stdlib/stats-base-cumax' );\nvar Float64Array = require( '@stdlib/array-float64' );\nvar order = require( './order.js' );\n\n\n// MAIN //\n\n/**\n* Adjusts the p-values via the Bonferroni\u2013Holm method.\n*\n* @private\n* @param {ProbabilityArray} pvalues - p-values to be adjusted\n* @param {PositiveInteger} comparisons - number of comparisons\n* @returns {ProbabilityArray} adjusted p-values\n*/\nfunction holm( pvalues, comparisons ) {\n\tvar indices;\n\tvar sorted;\n\tvar len;\n\tvar out;\n\tvar i;\n\n\tlen = pvalues.length;\n\tindices = order( pvalues );\n\tsorted = new Float64Array( len );\n\tfor ( i = 0; i < len; i++ ) {\n\t\tsorted[ i ] = ( comparisons - i ) * pvalues[ indices[ i ] ];\n\t}\n\tsorted = cumax( len, sorted, 1, sorted, 1 );\n\tout = new Array( len );\n\tfor ( i = 0; i < len; i++ ) {\n\t\tout[ indices[ i ] ] = min( sorted[ i ], 1.0 );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = holm;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 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 min = require( '@stdlib/math-base-special-min' );\nvar cumin = require( '@stdlib/stats-base-cumin' );\nvar Float64Array = require( '@stdlib/array-float64' );\nvar order = require( './order.js' );\n\n\n// MAIN //\n\n/**\n* Adjusts the p-values via the Benjamini-Hochberg procedure.\n*\n* @private\n* @param {ProbabilityArray} pvalues - p-values to be adjusted\n* @param {PositiveInteger} comparisons - number of comparisons\n* @returns {ProbabilityArray} adjusted p-values\n*/\nfunction bh( pvalues, comparisons ) {\n\tvar indices;\n\tvar sorted;\n\tvar len;\n\tvar out;\n\tvar i;\n\n\tlen = pvalues.length;\n\tindices = order( pvalues, true );\n\tsorted = new Float64Array( len );\n\tfor ( i = 0; i < len; i++ ) {\n\t\tsorted[ i ] = comparisons / ( len - i ) * pvalues[ indices[ i ] ];\n\t}\n\tsorted = cumin( len, sorted, 1, sorted, 1 );\n\tout = new Array( len );\n\tfor ( i = 0; i < len; i++ ) {\n\t\tout[ indices[ i ] ] = min( sorted[ i ], 1.0 );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = bh;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 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 min = require( '@stdlib/math-base-special-min' );\nvar cumin = require( '@stdlib/stats-base-cumin' );\nvar Float64Array = require( '@stdlib/array-float64' );\nvar order = require( './order.js' );\n\n\n// MAIN //\n\n/**\n* Adjusts the p-values via the Benjamini & Yekutieli method.\n*\n* @private\n* @param {ProbabilityArray} pvalues - p-values to be adjusted\n* @param {PositiveInteger} comparisons - number of comparisons\n* @returns {ProbabilityArray} adjusted p-values\n*/\nfunction by( pvalues, comparisons ) {\n\tvar indices;\n\tvar sorted;\n\tvar len;\n\tvar out;\n\tvar i;\n\tvar q;\n\n\tlen = pvalues.length;\n\tindices = order( pvalues, true );\n\tq = 0;\n\tfor ( i = 0; i < comparisons; i++ ) {\n\t\tq += 1 / ( 1 + i );\n\t}\n\tsorted = new Float64Array( len );\n\tfor ( i = 0; i < len; i++ ) {\n\t\tsorted[ i ] = q * comparisons / ( len - i ) * pvalues[ indices[ i ] ];\n\t}\n\tsorted = cumin( len, sorted, 1, sorted, 1 );\n\tout = new Array( len );\n\tfor ( i = 0; i < len; i++ ) {\n\t\tout[ indices[ i ] ] = min( sorted[ i ], 1.0 );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = by;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 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 isProbabilityArray = require( '@stdlib/assert-is-probability-array' );\nvar isInteger = require( '@stdlib/assert-is-integer' ).isPrimitive;\nvar isString = require( '@stdlib/assert-is-string' ).isPrimitive;\nvar format = require( '@stdlib/string-format' );\nvar bonferroni = require( './bonferroni.js' );\nvar hommel = require( './hommel.js' );\nvar holm = require( './holm.js' );\nvar bh = require( './bh.js' );\nvar by = require( './by.js' );\n\n\n// VARIABLES //\n\nvar METHODS = [ 'bh', 'bonferroni', 'by', 'holm', 'hommel' ];\n\n\n// MAIN //\n\n/**\n* Adjusts supplied p-values for multiple comparisons via a specified method.\n*\n* @param {ProbabilityArray} pvals - p-values to be adjusted\n* @param {string} method - correction method\n* @param {PositiveInteger} [comparisons=pvals.length] - number of comparisons\n* @throws {TypeError} first argument has to be an array-like object\n* @throws {TypeError} second argument must be a string\n* @throws {Error} second argument must be `bh`, `bonferroni`, `by`, `holm`, or `hommel`\n* @throws {RangeError} comparisons must be greater or equal to the number of p-values to be adjusted\n* @returns {ProbabilityArray} array containing the corrected p-values\n*\n* @example\n* var pvalues = [ 0.008, 0.03, 0.123, 0.6, 0.2 ];\n* var out = padjust( pvalues, 'bonferroni' );\n* // returns [ 0.04, 0.15, ..., 1, 1 ]\n*\n* @example\n* var pvalues = [ 0.008, 0.03, 0.123, 0.6, 0.2 ];\n* var out = padjust( pvalues, 'by' );\n* // returns [ ~0.091, ~0.171, ..., 1, ~0.571 ]\n*\n* @example\n* var pvalues = [ 0.008, 0.03, 0.123, 0.6, 0.2 ];\n* var out = padjust( pvalues, 'bh' );\n* // returns [ 0.04, 0.075, ..., 0.6, 0.25 ]\n*\n* @example\n* var pvalues = [ 0.008, 0.03, 0.123, 0.6, 0.2 ];\n* var out = padjust( pvalues, 'holm' );\n* // returns [ 0.04, 0.12, ..., 0.6, 0.4 ]\n*\n* @example\n* var pvalues = [ 0.008, 0.03, 0.123, 0.6, 0.2 ];\n* var out = padjust( pvalues, 'hommel' );\n* // returns [ 0.032, 0.12, ..., 0.6, 0.4 ]\n*/\nfunction padjust( pvals, method, comparisons ) {\n\tif ( !isProbabilityArray( pvals ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an array of probabilities. Value: `%s`.', pvals ) );\n\t}\n\tif ( !isString( method ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a string. Value: `%s`.', method ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isInteger( comparisons ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Third argument must be an integer. Value: `%s`.', comparisons ) );\n\t\t}\n\t\tif ( comparisons < pvals.length ) {\n\t\t\tthrow new RangeError( format( 'invalid argument. The number of comparisons must be greater or equal to the number of p-values to be adjusted. Value: `%u`.', comparisons ) );\n\t\t}\n\t}\n\tcomparisons = comparisons || pvals.length;\n\tswitch ( method ) {\n\tcase 'bonferroni':\n\t\treturn bonferroni( pvals, comparisons );\n\tcase 'by':\n\t\treturn by( pvals, comparisons );\n\tcase 'bh':\n\t\treturn bh( pvals, comparisons );\n\tcase 'holm':\n\t\treturn holm( pvals, comparisons );\n\tcase 'hommel':\n\t\treturn hommel( pvals, comparisons );\n\tdefault:\n\t\tthrow new Error( format( 'invalid argument. Second argument must be one of the following: \"%s\". Value: `%s`.', METHODS.join( '\", \"' ), method ) );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = padjust;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 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* Adjust supplied p-values for multiple comparisons via a specified method.\n*\n* @module @stdlib/stats-padjust\n*\n* @example\n* var padjust = require( '@stdlib/stats-padjust' );\n*\n* var pvalues = [ 0.008, 0.03, 0.123, 0.6, 0.2 ];\n* var out = padjust( pvalues, 'bh' );\n* // returns [ 0.04, 0.075, ~0.205, 0.6, 0.25 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"],
5
+ "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,GAAAC,EAAA,cA8BA,SAASC,EAAYC,EAASC,EAAc,CAC3C,IAAIC,EACAC,EACJ,IAAMA,EAAI,EAAGA,EAAIH,EAAQ,OA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AE,EAE3G,GAAK,UAAU,OAAS,EAAI,CAC3B,GAAK,CAACX,GAAWY,CAAY,EAC5B,MAAM,IAAI,UAAWV,EAAQ,oEAAqEU,CAAY,CAAE,EAEjH,GAAKA,EAAcF,EAAM,OACxB,MAAM,IAAI,WAAYR,EAAQ,8HAA+HU,CAAY,CAAE,CAE7K,CAEA,OADAA,EAAcA,GAAeF,EAAM,OAC1BC,EAAS,CAClB,IAAK,aACJ,OAAOR,GAAYO,EAAOE,CAAY,EACvC,IAAK,KACJ,OAAOL,GAAIG,EAAOE,CAAY,EAC/B,IAAK,KACJ,OAAON,GAAII,EAAOE,CAAY,EAC/B,IAAK,OACJ,OAAOP,GAAMK,EAAOE,CAAY,EACjC,IAAK,SACJ,OAAOR,GAAQM,EAAOE,CAAY,EACnC,QACC,MAAM,IAAI,MAAOV,EAAQ,qFAAsFM,GAAQ,KAAM,MAAO,EAAGG,CAAO,CAAE,CACjJ,CACD,CAKAb,EAAO,QAAUW,KC7EjB,IAAII,GAAO,IAKX,OAAO,QAAUA",
6
+ "names": ["require_bonferroni", "__commonJSMin", "exports", "module", "bonferroni", "pvalues", "comparisons", "pval", "i", "require_order", "__commonJSMin", "exports", "module", "Int32Array", "ascending", "a", "b", "descending", "order", "x", "invert", "comparator", "arr", "i", "compare", "require_hommel", "__commonJSMin", "exports", "module", "min", "max", "Float64Array", "PINF", "order", "slice", "hommel", "pvalues", "comparisons", "indices", "diff", "adj", "idx", "len", "out", "mq", "m", "i", "j", "k", "q", "v", "require_holm", "__commonJSMin", "exports", "module", "min", "cumax", "Float64Array", "order", "holm", "pvalues", "comparisons", "indices", "sorted", "len", "out", "i", "require_bh", "__commonJSMin", "exports", "module", "min", "cumin", "Float64Array", "order", "bh", "pvalues", "comparisons", "indices", "sorted", "len", "out", "i", "require_by", "__commonJSMin", "exports", "module", "min", "cumin", "Float64Array", "order", "by", "pvalues", "comparisons", "indices", "sorted", "len", "out", "i", "q", "require_main", "__commonJSMin", "exports", "module", "isProbabilityArray", "isInteger", "isString", "format", "bonferroni", "hommel", "holm", "bh", "by", "METHODS", "padjust", "pvals", "method", "comparisons", "main"]
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
  * Correction method.
@@ -69,7 +69,7 @@ type Method = 'bh' | 'bonferroni' | 'by' | 'holm' | 'hommel';
69
69
  * var out = padjust( pvalues, 'hommel' );
70
70
  * // returns [ 0.032, 0.12, ..., 0.6, 0.4 ]
71
71
  */
72
- declare function padjust( x: Array<number>, method: Method, comparisons?: number ): Array<number>; // tslint-disable-line max-line-length
72
+ declare function padjust( x: Array<number>, method: Method, comparisons?: number ): Array<number>;
73
73
 
74
74
 
75
75
  // EXPORTS //
package/lib/index.js CHANGED
@@ -33,9 +33,9 @@
33
33
 
34
34
  // MODULES //
35
35
 
36
- var padjust = require( './main.js' );
36
+ var main = require( './main.js' );
37
37
 
38
38
 
39
39
  // EXPORTS //
40
40
 
41
- module.exports = padjust;
41
+ module.exports = main;
package/lib/main.js CHANGED
@@ -23,6 +23,7 @@
23
23
  var isProbabilityArray = require( '@stdlib/assert-is-probability-array' );
24
24
  var isInteger = require( '@stdlib/assert-is-integer' ).isPrimitive;
25
25
  var isString = require( '@stdlib/assert-is-string' ).isPrimitive;
26
+ var format = require( '@stdlib/string-format' );
26
27
  var bonferroni = require( './bonferroni.js' );
27
28
  var hommel = require( './hommel.js' );
28
29
  var holm = require( './holm.js' );
@@ -44,9 +45,9 @@ var METHODS = [ 'bh', 'bonferroni', 'by', 'holm', 'hommel' ];
44
45
  * @param {string} method - correction method
45
46
  * @param {PositiveInteger} [comparisons=pvals.length] - number of comparisons
46
47
  * @throws {TypeError} first argument has to be an array-like object
47
- * @throws {TypeError} second argument must be a string primitive
48
+ * @throws {TypeError} second argument must be a string
48
49
  * @throws {Error} second argument must be `bh`, `bonferroni`, `by`, `holm`, or `hommel`
49
- * @throws {RangeError} comparisons must be greater or equal to the number of elements in `pvals`
50
+ * @throws {RangeError} comparisons must be greater or equal to the number of p-values to be adjusted
50
51
  * @returns {ProbabilityArray} array containing the corrected p-values
51
52
  *
52
53
  * @example
@@ -76,17 +77,17 @@ var METHODS = [ 'bh', 'bonferroni', 'by', 'holm', 'hommel' ];
76
77
  */
77
78
  function padjust( pvals, method, comparisons ) {
78
79
  if ( !isProbabilityArray( pvals ) ) {
79
- throw new TypeError( 'invalid argument. First argument must be an array of probabilities. Value: `' + pvals + '`.' );
80
+ throw new TypeError( format( 'invalid argument. First argument must be an array of probabilities. Value: `%s`.', pvals ) );
80
81
  }
81
82
  if ( !isString( method ) ) {
82
- throw new TypeError( 'invalid argument. Second argument must be a string primitive. Value: `' + method + '`.' );
83
+ throw new TypeError( format( 'invalid argument. Second argument must be a string. Value: `%s`.', method ) );
83
84
  }
84
85
  if ( arguments.length > 2 ) {
85
86
  if ( !isInteger( comparisons ) ) {
86
- throw new TypeError( 'invalid argument. `comparisons` must be an integer. Value: `' + comparisons + '`.' );
87
+ throw new TypeError( format( 'invalid argument. Third argument must be an integer. Value: `%s`.', comparisons ) );
87
88
  }
88
89
  if ( comparisons < pvals.length ) {
89
- throw new RangeError( 'invalid argument. When specified, `comparisons` arguments must have at least a length of '+pvals.length+'. Value: `' + comparisons + '`.' );
90
+ throw new RangeError( format( 'invalid argument. The number of comparisons must be greater or equal to the number of p-values to be adjusted. Value: `%u`.', comparisons ) );
90
91
  }
91
92
  }
92
93
  comparisons = comparisons || pvals.length;
@@ -102,7 +103,7 @@ function padjust( pvals, method, comparisons ) {
102
103
  case 'hommel':
103
104
  return hommel( pvals, comparisons );
104
105
  default:
105
- throw new Error( 'invalid argument. Second argument must be one of '+METHODS.join( ', ' )+' Value: `' + method + '`.' );
106
+ throw new Error( format( 'invalid argument. Second argument must be one of the following: "%s". Value: `%s`.', METHODS.join( '", "' ), method ) );
106
107
  }
107
108
  }
108
109
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stdlib/stats-padjust",
3
- "version": "0.0.7",
3
+ "version": "0.2.0",
4
4
  "description": "Adjust supplied p-values for multiple comparisons via a specified method.",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -37,26 +37,28 @@
37
37
  "url": "https://github.com/stdlib-js/stdlib/issues"
38
38
  },
39
39
  "dependencies": {
40
- "@stdlib/array-float64": "^0.0.x",
41
- "@stdlib/array-int32": "^0.0.x",
42
- "@stdlib/assert-is-integer": "^0.0.x",
43
- "@stdlib/assert-is-probability-array": "^0.0.x",
44
- "@stdlib/assert-is-string": "^0.0.x",
45
- "@stdlib/constants-float64-pinf": "^0.0.x",
46
- "@stdlib/math-base-special-max": "^0.0.x",
47
- "@stdlib/math-base-special-min": "^0.0.x",
48
- "@stdlib/stats-base-cumax": "^0.0.x",
49
- "@stdlib/stats-base-cumin": "^0.0.x"
40
+ "@stdlib/array-float64": "^0.2.0",
41
+ "@stdlib/array-int32": "^0.2.0",
42
+ "@stdlib/assert-is-integer": "^0.2.0",
43
+ "@stdlib/assert-is-probability-array": "^0.2.0",
44
+ "@stdlib/assert-is-string": "^0.2.0",
45
+ "@stdlib/constants-float64-pinf": "^0.2.0",
46
+ "@stdlib/math-base-special-max": "^0.2.0",
47
+ "@stdlib/math-base-special-min": "^0.2.0",
48
+ "@stdlib/stats-base-cumax": "^0.2.0",
49
+ "@stdlib/stats-base-cumin": "^0.2.0",
50
+ "@stdlib/string-format": "^0.2.0",
51
+ "@stdlib/error-tools-fmtprodmsg": "^0.1.1"
50
52
  },
51
53
  "devDependencies": {
52
- "@stdlib/assert-is-array": "^0.0.x",
53
- "@stdlib/bench": "^0.0.x",
54
- "@stdlib/constants-float64-eps": "^0.0.x",
55
- "@stdlib/math-base-special-abs": "^0.0.x",
56
- "@stdlib/random-base-randu": "^0.0.x",
54
+ "@stdlib/constants-float64-eps": "^0.1.1",
55
+ "@stdlib/math-base-special-abs": "^0.1.1",
56
+ "@stdlib/random-base-randu": "^0.1.0",
57
57
  "tape": "git+https://github.com/kgryte/tape.git#fix/globby",
58
58
  "istanbul": "^0.4.1",
59
- "tap-spec": "5.x.x"
59
+ "tap-min": "git+https://github.com/Planeshifter/tap-min.git",
60
+ "@stdlib/bench-harness": "^0.1.2",
61
+ "@stdlib/bench": "^0.3.1"
60
62
  },
61
63
  "engines": {
62
64
  "node": ">=0.10.0",
@@ -94,7 +96,7 @@
94
96
  "yekutieli"
95
97
  ],
96
98
  "funding": {
97
- "type": "patreon",
98
- "url": "https://www.patreon.com/athan"
99
+ "type": "opencollective",
100
+ "url": "https://opencollective.com/stdlib"
99
101
  }
100
102
  }
package/docs/repl.txt DELETED
@@ -1,63 +0,0 @@
1
-
2
- {{alias}}( pvals, method[, comparisons] )
3
- Adjusts supplied p-values for multiple comparisons via a specified method.
4
-
5
- The `method` parameter can be one of the following values:
6
-
7
- - **bh**: Benjamini-Hochberg procedure controlling the False Discovery
8
- Rate (FDR).
9
- - **bonferroni**: Bonferroni correction fixing the family-wise error rate
10
- by multiplying the p-values with the number of comparisons. The Bonferroni
11
- correction is usually a too conservative adjustment compared to the others.
12
- - **by**: Procedure by Benjamini & Yekutieli for controlling the False
13
- Discovery Rate (FDR) under dependence.
14
- - **holm**: Hommel's method controlling family-wise error rate. It is
15
- uniformly more powerful than the Bonferroni correction.
16
- - **hommel**: Hommel's method, which is valid when hypothesis tests are
17
- independent. It is more expensive to compute than the other methods.
18
-
19
- By default, the number of comparisons for which the p-values should be
20
- corrected is equal to the number of provided p-values. Alternatively, it is
21
- possible to set `comparisons` to a number greater than the length of
22
- `pvals`. In that case, the methods assume `comparisons - pvals.length`
23
- unobserved p-values that are greater than all observed p-values (for Holm's
24
- method and the Bonferroni correction) or equal to `1` for the remaining
25
- methods.
26
-
27
- Parameters
28
- ----------
29
- pvals: Array<number>
30
- P-values to be adjusted.
31
-
32
- method: string
33
- Correction method.
34
-
35
- comparisons: integer (optional)
36
- Number of comparisons. Default value: `pvals.length`.
37
-
38
- Returns
39
- -------
40
- out: Array<number>
41
- Array containing the corrected p-values.
42
-
43
- Examples
44
- --------
45
- > var pvalues = [ 0.008, 0.03, 0.123, 0.6, 0.2 ];
46
- > var out = {{alias}}( pvalues, 'bh' )
47
- [ 0.04, 0.075, ~0.205, 0.6, 0.25 ]
48
-
49
- > out = {{alias}}( pvalues, 'bonferroni' )
50
- [ 0.04, 0.15, 0.615, 1.0, 1.0 ]
51
-
52
- > out = {{alias}}( pvalues, 'by' )
53
- [ ~0.457, ~0.856, 1.0, 1.0, 1.0 ]
54
-
55
- > out = {{alias}}( pvalues, 'holm' )
56
- [ 0.2, 0.6, 1.0, 1.0, 1.0 ]
57
-
58
- > out = {{alias}}( pvalues, 'hommel' )
59
- [ 0.16, 0.6, 1.0, 1.0, 1.0 ]
60
-
61
- See Also
62
- --------
63
-
@@ -1,74 +0,0 @@
1
- /*
2
- * @license Apache-2.0
3
- *
4
- * Copyright (c) 2021 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 padjust = require( './index' );
20
-
21
-
22
- // TESTS //
23
-
24
- // The function returns an array of numbers...
25
- {
26
- const pvalues = [ 0.008, 0.03, 0.123, 0.6, 0.2 ];
27
- padjust( pvalues, 'holm' ); // $ExpectType number[]
28
- padjust( pvalues, 'hommel', 8 ); // $ExpectType number[]
29
- }
30
-
31
- // The function does not compile if provided a value other than an array of numbers...
32
- {
33
- padjust( 'abc', 'bh' ); // $ExpectError
34
- padjust( true, 'bh' ); // $ExpectError
35
- padjust( false, 'bh' ); // $ExpectError
36
- padjust( null, 'bh' ); // $ExpectError
37
- padjust( undefined, 'bh' ); // $ExpectError
38
- padjust( 5, 'bh' ); // $ExpectError
39
- padjust( {}, 'bh' ); // $ExpectError
40
- padjust( ( x: number ): number => x, 'bh' ); // $ExpectError
41
- }
42
-
43
- // The compiler throws an error if the function is provided a second argument which is not a recognized method...
44
- {
45
- const pvalues = [ 0.008, 0.03, 0.123, 0.6, 0.2 ];
46
- padjust( pvalues, 123 ); // $ExpectError
47
- padjust( pvalues, 'abc' ); // $ExpectError
48
- padjust( pvalues, true ); // $ExpectError
49
- padjust( pvalues, false ); // $ExpectError
50
- padjust( pvalues, null ); // $ExpectError
51
- padjust( pvalues, [] ); // $ExpectError
52
- padjust( pvalues, {} ); // $ExpectError
53
- padjust( pvalues, ( x: number ): number => x ); // $ExpectError
54
- }
55
-
56
- // The compiler throws an error if the function is provided a third argument which is not a number...
57
- {
58
- const pvalues = [ 0.008, 0.03, 0.123, 0.6, 0.2 ];
59
- padjust( pvalues, 'bh', 'abc' ); // $ExpectError
60
- padjust( pvalues, 'bh', true ); // $ExpectError
61
- padjust( pvalues, 'bh', false ); // $ExpectError
62
- padjust( pvalues, 'bh', null ); // $ExpectError
63
- padjust( pvalues, 'bh', [] ); // $ExpectError
64
- padjust( pvalues, 'bh', {} ); // $ExpectError
65
- padjust( pvalues, 'bh', ( x: number ): number => x ); // $ExpectError
66
- }
67
-
68
- // The function does not compile if provided an invalid number of arguments...
69
- {
70
- const pvalues = [ 0.008, 0.03, 0.123, 0.6, 0.2 ];
71
- padjust(); // $ExpectError
72
- padjust( pvalues ); // $ExpectError
73
- padjust( pvalues, 'bonferroni', 5, {} ); // $ExpectError
74
- }