@stdlib/random-base-invgamma 0.0.6 → 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/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-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
  # Inverse Gamma Random Numbers
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] -->
@@ -450,7 +461,7 @@ See [LICENSE][stdlib-license].
450
461
 
451
462
  ## Copyright
452
463
 
453
- Copyright &copy; 2016-2022. The Stdlib [Authors][stdlib-authors].
464
+ Copyright &copy; 2016-2023. The Stdlib [Authors][stdlib-authors].
454
465
 
455
466
  </section>
456
467
 
@@ -463,8 +474,8 @@ Copyright &copy; 2016-2022. The Stdlib [Authors][stdlib-authors].
463
474
  [npm-image]: http://img.shields.io/npm/v/@stdlib/random-base-invgamma.svg
464
475
  [npm-url]: https://npmjs.org/package/@stdlib/random-base-invgamma
465
476
 
466
- [test-image]: https://github.com/stdlib-js/random-base-invgamma/actions/workflows/test.yml/badge.svg
467
- [test-url]: https://github.com/stdlib-js/random-base-invgamma/actions/workflows/test.yml
477
+ [test-image]: https://github.com/stdlib-js/random-base-invgamma/actions/workflows/test.yml/badge.svg?branch=v0.1.0
478
+ [test-url]: https://github.com/stdlib-js/random-base-invgamma/actions/workflows/test.yml?query=branch:v0.1.0
468
479
 
469
480
  [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/random-base-invgamma/main.svg
470
481
  [coverage-url]: https://codecov.io/github/stdlib-js/random-base-invgamma?branch=main
@@ -476,19 +487,20 @@ Copyright &copy; 2016-2022. The Stdlib [Authors][stdlib-authors].
476
487
 
477
488
  -->
478
489
 
490
+ [chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg
491
+ [chat-url]: https://app.gitter.im/#/room/#stdlib-js_stdlib:gitter.im
492
+
493
+ [stdlib]: https://github.com/stdlib-js/stdlib
494
+
495
+ [stdlib-authors]: https://github.com/stdlib-js/stdlib/graphs/contributors
496
+
479
497
  [umd]: https://github.com/umdjs/umd
480
498
  [es-module]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
481
499
 
482
500
  [deno-url]: https://github.com/stdlib-js/random-base-invgamma/tree/deno
483
501
  [umd-url]: https://github.com/stdlib-js/random-base-invgamma/tree/umd
484
502
  [esm-url]: https://github.com/stdlib-js/random-base-invgamma/tree/esm
485
-
486
- [chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg
487
- [chat-url]: https://gitter.im/stdlib-js/stdlib/
488
-
489
- [stdlib]: https://github.com/stdlib-js/stdlib
490
-
491
- [stdlib-authors]: https://github.com/stdlib-js/stdlib/graphs/contributors
503
+ [branches-url]: https://github.com/stdlib-js/random-base-invgamma/blob/main/branches.md
492
504
 
493
505
  [stdlib-license]: https://raw.githubusercontent.com/stdlib-js/random-base-invgamma/main/LICENSE
494
506
 
@@ -0,0 +1,3 @@
1
+ /// <reference path="../docs/types/index.d.ts" />
2
+ import invgamma from '../docs/types/index';
3
+ export = invgamma;
package/dist/index.js ADDED
@@ -0,0 +1,9 @@
1
+ "use strict";var l=function(n,t){return function(){return t||n((t={exports:{}}).exports,t),t.exports}};var q=l(function(U,y){
2
+ var c=require('@stdlib/assert-is-positive-number/dist').isPrimitive,d=require('@stdlib/error-tools-fmtprodmsg/dist');function z(n,t){return c(n)?c(t)?null:new TypeError(d('0oV72',t)):new TypeError(d('0oV71',n));}y.exports=z
3
+ });var f=l(function(X,N){
4
+ var u=require('@stdlib/utils-define-nonenumerable-read-only-property/dist'),g=require('@stdlib/utils-define-nonenumerable-read-only-accessor/dist'),h=require('@stdlib/utils-define-nonenumerable-read-write-accessor/dist'),b=require('@stdlib/assert-is-plain-object/dist'),w=require('@stdlib/assert-is-function/dist'),O=require('@stdlib/assert-has-own-property/dist'),L=require('@stdlib/utils-constant-function/dist'),W=require('@stdlib/utils-noop/dist'),o=require('@stdlib/random-base-gamma/dist').factory,S=require('@stdlib/math-base-assert-is-nan/dist'),k=require('@stdlib/array-to-json/dist'),m=require('@stdlib/error-tools-fmtprodmsg/dist'),B=q();function C(){var n,t,s,e,i,r,v;if(arguments.length===0)n=o();else if(arguments.length===1){if(e=arguments[0],!b(e))throw new TypeError(m('0oV2V',e));if(O(e,"prng")){if(!w(e.prng))throw new TypeError(m('0oV6u',"prng",e.prng));n=o({prng:e.prng})}else n=o(e)}else{if(t=arguments[0],s=arguments[1],v=B(t,s),v)throw v;if(arguments.length>2){if(e=arguments[2],!b(e))throw new TypeError(m('0oV2V',e));if(O(e,"prng")){if(!w(e.prng))throw new TypeError(m('0oV6u',"prng",e.prng));n=o(t,s,{prng:e.prng})}else n=o(t,s,e)}else n=o(t,s)}return t===void 0?r=M:r=J,i=n.PRNG,u(r,"NAME","invgamma"),e&&e.prng?(u(r,"seed",null),u(r,"seedLength",null),h(r,"state",L(null),W),u(r,"stateLength",null),u(r,"byteLength",null),u(r,"toJSON",L(null))):(g(r,"seed",T),g(r,"seedLength",j),h(r,"state",V,F),g(r,"stateLength",x),g(r,"byteLength",A),u(r,"toJSON",G)),u(r,"PRNG",i),r;function T(){return i.seed}function j(){return i.seedLength}function x(){return i.stateLength}function A(){return i.byteLength}function V(){return i.state}function F(a){i.state=a}function G(){var a={};return a.type="PRNG",a.name=r.NAME,a.state=k(i.state),t===void 0?a.params=[]:a.params=[t,s],a}function J(){return 1/n()}function M(a,p){return S(a)||S(p)||a<=0||p<=0?NaN:1/n(a,p)}}N.exports=C
5
+ });var R=l(function(Y,E){
6
+ var D=f(),H=D();E.exports=H
7
+ });var I=require('@stdlib/utils-define-nonenumerable-read-only-property/dist'),P=R(),K=f();I(P,"factory",K);module.exports=P;
8
+ /** @license Apache-2.0 */
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../lib/validate.js", "../lib/factory.js", "../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 isPositive = require( '@stdlib/assert-is-positive-number' ).isPrimitive;\nvar format = require( '@stdlib/string-format' );\n\n\n// MAIN //\n\n/**\n* Validates parameters.\n*\n* @private\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @returns {(Error|null)} error or null\n*\n* @example\n* var err = validate( 1.0, 2.0 );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( alpha, beta ) {\n\tif ( !isPositive( alpha ) ) {\n\t\treturn new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );\n\t}\n\tif ( !isPositive( beta ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\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 setReadOnly = require( '@stdlib/utils-define-nonenumerable-read-only-property' );\nvar setReadOnlyAccessor = require( '@stdlib/utils-define-nonenumerable-read-only-accessor' );\nvar setReadWriteAccessor = require( '@stdlib/utils-define-nonenumerable-read-write-accessor' );\nvar isObject = require( '@stdlib/assert-is-plain-object' );\nvar isFunction = require( '@stdlib/assert-is-function' );\nvar hasOwnProp = require( '@stdlib/assert-has-own-property' );\nvar constantFunction = require( '@stdlib/utils-constant-function' );\nvar noop = require( '@stdlib/utils-noop' );\nvar gamma = require( '@stdlib/random-base-gamma' ).factory;\nvar isnan = require( '@stdlib/math-base-assert-is-nan' );\nvar typedarray2json = require( '@stdlib/array-to-json' );\nvar format = require( '@stdlib/string-format' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a pseudorandom number generator for generating inverse gamma distributed random numbers.\n*\n* @param {PositiveNumber} [alpha] - shape parameter\n* @param {PositiveNumber} [beta] - scale parameter\n* @param {Options} [options] - function options\n* @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers\n* @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed\n* @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state\n* @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state\n* @throws {TypeError} `alpha` must be a positive number\n* @throws {TypeError} `beta` must be a positive number\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {Error} must provide a valid state\n* @returns {PRNG} pseudorandom number generator\n*\n* @example\n* var invgamma = factory( 2.0, 1.0 );\n* var v = invgamma();\n* // returns <number>\n*\n* @example\n* var invgamma = factory( 2.0, 2.0, {\n* 'seed': 297\n* });\n* var v = invgamma();\n* // returns <number>\n*/\nfunction factory() {\n\tvar rgamma;\n\tvar alpha;\n\tvar beta;\n\tvar opts;\n\tvar rand;\n\tvar prng;\n\tvar err;\n\n\tif ( arguments.length === 0 ) {\n\t\trgamma = gamma();\n\t} else if ( arguments.length === 1 ) {\n\t\topts = arguments[ 0 ];\n\t\tif ( !isObject( opts ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t}\n\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t}\n\t\t\trgamma = gamma({\n\t\t\t\t'prng': opts.prng\n\t\t\t});\n\t\t} else {\n\t\t\trgamma = gamma( opts );\n\t\t}\n\t} else {\n\t\talpha = arguments[ 0 ];\n\t\tbeta = arguments[ 1 ];\n\t\terr = validate( alpha, beta );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t\tif ( arguments.length > 2 ) {\n\t\t\topts = arguments[ 2 ];\n\t\t\tif ( !isObject( opts ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );\n\t\t\t}\n\t\t\tif ( hasOwnProp( opts, 'prng' ) ) {\n\t\t\t\tif ( !isFunction( opts.prng ) ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );\n\t\t\t\t}\n\t\t\t\trgamma = gamma( alpha, beta, {\n\t\t\t\t\t'prng': opts.prng\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\trgamma = gamma( alpha, beta, opts );\n\t\t\t}\n\t\t} else {\n\t\t\trgamma = gamma( alpha, beta );\n\t\t}\n\t}\n\tif ( alpha === void 0 ) {\n\t\tprng = invgamma2;\n\t} else {\n\t\tprng = invgamma1;\n\t}\n\trand = rgamma.PRNG;\n\n\tsetReadOnly( prng, 'NAME', 'invgamma' );\n\n\t// If we are provided an \"external\" PRNG, we don't support getting or setting PRNG state, as we'd need to check for compatible state value types, etc, entailing considerable complexity.\n\tif ( opts && opts.prng ) {\n\t\tsetReadOnly( prng, 'seed', null );\n\t\tsetReadOnly( prng, 'seedLength', null );\n\t\tsetReadWriteAccessor( prng, 'state', constantFunction( null ), noop );\n\t\tsetReadOnly( prng, 'stateLength', null );\n\t\tsetReadOnly( prng, 'byteLength', null );\n\t\tsetReadOnly( prng, 'toJSON', constantFunction( null ) );\n\t} else {\n\t\tsetReadOnlyAccessor( prng, 'seed', getSeed );\n\t\tsetReadOnlyAccessor( prng, 'seedLength', getSeedLength );\n\t\tsetReadWriteAccessor( prng, 'state', getState, setState );\n\t\tsetReadOnlyAccessor( prng, 'stateLength', getStateLength );\n\t\tsetReadOnlyAccessor( prng, 'byteLength', getStateSize );\n\t\tsetReadOnly( prng, 'toJSON', toJSON );\n\t}\n\tsetReadOnly( prng, 'PRNG', rand );\n\treturn prng;\n\n\t/**\n\t* Returns the PRNG seed.\n\t*\n\t* @private\n\t* @returns {PRNGSeedMT19937} seed\n\t*/\n\tfunction getSeed() {\n\t\treturn rand.seed;\n\t}\n\n\t/**\n\t* Returns the PRNG seed length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} seed length\n\t*/\n\tfunction getSeedLength() {\n\t\treturn rand.seedLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state length.\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state length\n\t*/\n\tfunction getStateLength() {\n\t\treturn rand.stateLength;\n\t}\n\n\t/**\n\t* Returns the PRNG state size (in bytes).\n\t*\n\t* @private\n\t* @returns {PositiveInteger} state size (in bytes)\n\t*/\n\tfunction getStateSize() {\n\t\treturn rand.byteLength;\n\t}\n\n\t/**\n\t* Returns the current pseudorandom number generator state.\n\t*\n\t* @private\n\t* @returns {PRNGStateMT19937} current state\n\t*/\n\tfunction getState() {\n\t\treturn rand.state;\n\t}\n\n\t/**\n\t* Sets the pseudorandom number generator state.\n\t*\n\t* @private\n\t* @param {PRNGStateMT19937} s - generator state\n\t* @throws {Error} must provide a valid state\n\t*/\n\tfunction setState( s ) {\n\t\trand.state = s;\n\t}\n\n\t/**\n\t* Serializes the pseudorandom number generator as a JSON object.\n\t*\n\t* ## Notes\n\t*\n\t* - `JSON.stringify()` implicitly calls this method when stringifying a PRNG.\n\t*\n\t* @private\n\t* @returns {Object} JSON representation\n\t*/\n\tfunction toJSON() {\n\t\tvar out = {};\n\t\tout.type = 'PRNG';\n\t\tout.name = prng.NAME;\n\t\tout.state = typedarray2json( rand.state );\n\t\tif ( alpha === void 0 ) {\n\t\t\tout.params = [];\n\t\t} else {\n\t\t\tout.params = [ alpha, beta ];\n\t\t}\n\t\treturn out;\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from an inverse gamma distribution.\n\t*\n\t* @private\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = invgamma1();\n\t* // returns <number>\n\t*/\n\tfunction invgamma1() {\n\t\treturn 1.0 / rgamma();\n\t}\n\n\t/**\n\t* Returns a pseudorandom number drawn from an inverse gamma distribution.\n\t*\n\t* @private\n\t* @param {PositiveNumber} alpha - shape parameter\n\t* @param {PositiveNumber} beta - scale parameter\n\t* @returns {number} pseudorandom number\n\t*\n\t* @example\n\t* var v = invgamma2( 2.0, 1.0 );\n\t* // returns <number>\n\t*/\n\tfunction invgamma2( alpha, beta ) {\n\t\tif (\n\t\t\tisnan( alpha ) ||\n\t\t\tisnan( beta ) ||\n\t\t\talpha <= 0.0 ||\n\t\t\tbeta <= 0.0\n\t\t) {\n\t\t\treturn NaN;\n\t\t}\n\t\treturn 1.0 / rgamma( alpha, beta );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\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 factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a random number drawn from an inverse gamma distribution.\n*\n* ## Method\n*\n* When\n*\n* ```tex\n* X \\sim \\operatorname{Gamma}( \\alpha, \\beta )\n* ```\n*\n* then\n*\n* ```tex\n* \\frac{1}{X} \\sim \\operatorname{InvGamma}\\left( \\alpha, \\tfrac{1}{beta} \\right)\n* ```\n*\n* Hence, to generate a draw from an inverse gamma distribution with parameters \\\\( \\alpha \\\\) and \\\\( \\beta \\\\), sample `X` from a \\\\( \\operatorname{Gamma}\\left( \\alpha, \\tfrac{1}{\\beta} \\right) \\\\) distribution and return `1/X`.\n*\n* @name invgamma\n* @type {PRNG}\n* @param {PositiveNumber} alpha - shape parameter\n* @param {PositiveNumber} beta - scale parameter\n* @returns {number} pseudorandom number\n*\n* @example\n* var v = invgamma( 2.0, 1.0 );\n* // returns <number>\n*\n* @example\n* var v = invgamma( -2.0, 5.0 );\n* // returns NaN\n*/\nvar invgamma = factory();\n\n\n// EXPORTS //\n\nmodule.exports = invgamma;\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* Inverse gamma distributed pseudorandom numbers.\n*\n* @module @stdlib/random-base-invgamma\n*\n* @example\n* var invgamma = require( '@stdlib/random-base-invgamma' );\n*\n* var v = invgamma( 2.0, 3.0 );\n* // returns <number>\n*\n* @example\n* var factory = require( '@stdlib/random-base-invgamma' ).factory;\n* var invgamma = factory( 3.0, 2.0, {\n* 'seed': 297\n* });\n*\n* var v = invgamma();\n* // returns <number>\n*\n* @example\n* var factory = require( '@stdlib/random-base-invgamma' ).factory;\n* var invgamma = factory({\n* 'seed': 297\n* });\n*\n* var v = invgamma( 3.0, 2.0 );\n* // returns <number>\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils-define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"],
5
+ "mappings": "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",
6
+ "names": ["require_validate", "__commonJSMin", "exports", "module", "isPositive", "format", "validate", "alpha", "beta", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "setReadOnlyAccessor", "setReadWriteAccessor", "isObject", "isFunction", "hasOwnProp", "constantFunction", "noop", "gamma", "isnan", "typedarray2json", "format", "validate", "factory", "rgamma", "alpha", "beta", "opts", "rand", "prng", "err", "invgamma2", "invgamma1", "getSeed", "getSeedLength", "getState", "setState", "getStateLength", "getStateSize", "toJSON", "s", "out", "require_main", "__commonJSMin", "exports", "module", "factory", "invgamma", "setReadOnly", "main", "factory"]
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
  /// <reference types="@stdlib/types"/>
22
22
 
package/lib/factory.js CHANGED
@@ -31,6 +31,7 @@ var noop = require( '@stdlib/utils-noop' );
31
31
  var gamma = require( '@stdlib/random-base-gamma' ).factory;
32
32
  var isnan = require( '@stdlib/math-base-assert-is-nan' );
33
33
  var typedarray2json = require( '@stdlib/array-to-json' );
34
+ var format = require( '@stdlib/string-format' );
34
35
  var validate = require( './validate.js' );
35
36
 
36
37
 
@@ -79,11 +80,11 @@ function factory() {
79
80
  } else if ( arguments.length === 1 ) {
80
81
  opts = arguments[ 0 ];
81
82
  if ( !isObject( opts ) ) {
82
- throw new TypeError( 'invalid argument. Options argument must be an object. Value: `' + opts + '`.' );
83
+ throw new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );
83
84
  }
84
85
  if ( hasOwnProp( opts, 'prng' ) ) {
85
86
  if ( !isFunction( opts.prng ) ) {
86
- throw new TypeError( 'invalid option. `prng` option must be a pseudorandom number generator function. Option: `' + opts.prng + '`.' );
87
+ throw new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );
87
88
  }
88
89
  rgamma = gamma({
89
90
  'prng': opts.prng
@@ -101,11 +102,11 @@ function factory() {
101
102
  if ( arguments.length > 2 ) {
102
103
  opts = arguments[ 2 ];
103
104
  if ( !isObject( opts ) ) {
104
- throw new TypeError( 'invalid argument. Options argument must be an object. Value: `' + opts + '`.' );
105
+ throw new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', opts ) );
105
106
  }
106
107
  if ( hasOwnProp( opts, 'prng' ) ) {
107
108
  if ( !isFunction( opts.prng ) ) {
108
- throw new TypeError( 'invalid option. `prng` option must be a pseudorandom number generator function. Option: `' + opts.prng + '`.' );
109
+ throw new TypeError( format( 'invalid option. `%s` option must be a pseudorandom number generator function. Option: `%s`.', 'prng', opts.prng ) );
109
110
  }
110
111
  rgamma = gamma( alpha, beta, {
111
112
  'prng': opts.prng
package/lib/index.js CHANGED
@@ -51,15 +51,15 @@
51
51
  // MODULES //
52
52
 
53
53
  var setReadOnly = require( '@stdlib/utils-define-nonenumerable-read-only-property' );
54
- var invgamma = require( './main.js' );
54
+ var main = require( './main.js' );
55
55
  var factory = require( './factory.js' );
56
56
 
57
57
 
58
58
  // MAIN //
59
59
 
60
- setReadOnly( invgamma, 'factory', factory );
60
+ setReadOnly( main, 'factory', factory );
61
61
 
62
62
 
63
63
  // EXPORTS //
64
64
 
65
- module.exports = invgamma;
65
+ module.exports = main;
package/lib/main.js CHANGED
@@ -44,7 +44,6 @@ var factory = require( './factory.js' );
44
44
  *
45
45
  * Hence, to generate a draw from an inverse gamma distribution with parameters \\( \alpha \\) and \\( \beta \\), sample `X` from a \\( \operatorname{Gamma}\left( \alpha, \tfrac{1}{\beta} \right) \\) distribution and return `1/X`.
46
46
  *
47
- *
48
47
  * @name invgamma
49
48
  * @type {PRNG}
50
49
  * @param {PositiveNumber} alpha - shape parameter
package/lib/validate.js CHANGED
@@ -21,6 +21,7 @@
21
21
  // MODULES //
22
22
 
23
23
  var isPositive = require( '@stdlib/assert-is-positive-number' ).isPrimitive;
24
+ var format = require( '@stdlib/string-format' );
24
25
 
25
26
 
26
27
  // MAIN //
@@ -41,10 +42,10 @@ var isPositive = require( '@stdlib/assert-is-positive-number' ).isPrimitive;
41
42
  */
42
43
  function validate( alpha, beta ) {
43
44
  if ( !isPositive( alpha ) ) {
44
- return new TypeError( 'invalid argument. `alpha` must be a positive number. Value: `' + alpha + '`.' );
45
+ return new TypeError( format( 'invalid argument. First argument must be a positive number. Value: `%s`.', alpha ) );
45
46
  }
46
47
  if ( !isPositive( beta ) ) {
47
- return new TypeError( 'invalid argument. `beta` must be a positive number. Value: `' + beta + '`.' );
48
+ return new TypeError( format( 'invalid argument. Second argument must be a positive number. Value: `%s`.', beta ) );
48
49
  }
49
50
  return null;
50
51
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stdlib/random-base-invgamma",
3
- "version": "0.0.6",
3
+ "version": "0.1.0",
4
4
  "description": "Inverse gamma distributed pseudorandom numbers.",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -37,35 +37,37 @@
37
37
  "url": "https://github.com/stdlib-js/stdlib/issues"
38
38
  },
39
39
  "dependencies": {
40
- "@stdlib/array-to-json": "^0.0.x",
41
- "@stdlib/assert-has-own-property": "^0.0.x",
42
- "@stdlib/assert-is-function": "^0.0.x",
43
- "@stdlib/assert-is-plain-object": "^0.0.x",
44
- "@stdlib/assert-is-positive-number": "^0.0.x",
45
- "@stdlib/math-base-assert-is-nan": "^0.0.x",
46
- "@stdlib/random-base-gamma": "^0.0.x",
47
- "@stdlib/types": "^0.0.x",
48
- "@stdlib/utils-constant-function": "^0.0.x",
49
- "@stdlib/utils-define-nonenumerable-read-only-accessor": "^0.0.x",
50
- "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x",
51
- "@stdlib/utils-define-nonenumerable-read-write-accessor": "^0.0.x",
52
- "@stdlib/utils-noop": "^0.0.x"
40
+ "@stdlib/array-to-json": "^0.1.0",
41
+ "@stdlib/assert-has-own-property": "^0.1.0",
42
+ "@stdlib/assert-is-function": "^0.1.0",
43
+ "@stdlib/assert-is-plain-object": "^0.1.0",
44
+ "@stdlib/assert-is-positive-number": "^0.1.0",
45
+ "@stdlib/math-base-assert-is-nan": "^0.1.0",
46
+ "@stdlib/random-base-gamma": "^0.1.0",
47
+ "@stdlib/string-format": "^0.1.0",
48
+ "@stdlib/types": "^0.1.0",
49
+ "@stdlib/utils-constant-function": "^0.1.0",
50
+ "@stdlib/utils-define-nonenumerable-read-only-accessor": "^0.1.0",
51
+ "@stdlib/utils-define-nonenumerable-read-only-property": "^0.1.0",
52
+ "@stdlib/utils-define-nonenumerable-read-write-accessor": "^0.1.0",
53
+ "@stdlib/utils-noop": "^0.1.0",
54
+ "@stdlib/error-tools-fmtprodmsg": "^0.1.0"
53
55
  },
54
56
  "devDependencies": {
55
- "@stdlib/array-uint32": "^0.0.x",
56
- "@stdlib/assert-is-uint32array": "^0.0.x",
57
- "@stdlib/bench": "^0.0.x",
58
- "@stdlib/constants-float64-eps": "^0.0.x",
59
- "@stdlib/constants-uint32-max": "^0.0.x",
60
- "@stdlib/process-env": "^0.0.x",
61
- "@stdlib/random-base-minstd": "^0.0.x",
62
- "@stdlib/random-base-minstd-shuffle": "^0.0.x",
63
- "@stdlib/random-base-randu": "^0.0.x",
64
- "@stdlib/stats-kstest": "^0.0.x",
65
- "@stdlib/time-now": "^0.0.x",
57
+ "@stdlib/array-uint32": "^0.1.0",
58
+ "@stdlib/assert-is-uint32array": "^0.1.0",
59
+ "@stdlib/bench": "^0.1.0",
60
+ "@stdlib/constants-float64-eps": "^0.1.0",
61
+ "@stdlib/constants-uint32-max": "^0.1.0",
62
+ "@stdlib/process-env": "^0.1.0",
63
+ "@stdlib/random-base-minstd": "^0.1.0",
64
+ "@stdlib/random-base-minstd-shuffle": "^0.1.0",
65
+ "@stdlib/random-base-randu": "^0.1.0",
66
+ "@stdlib/stats-kstest": "^0.1.0",
67
+ "@stdlib/time-now": "^0.1.0",
66
68
  "tape": "git+https://github.com/kgryte/tape.git#fix/globby",
67
69
  "istanbul": "^0.4.1",
68
- "tap-spec": "5.x.x"
70
+ "tap-min": "git+https://github.com/Planeshifter/tap-min.git"
69
71
  },
70
72
  "engines": {
71
73
  "node": ">=0.10.0",
@@ -103,7 +105,7 @@
103
105
  "factory"
104
106
  ],
105
107
  "funding": {
106
- "type": "patreon",
107
- "url": "https://www.patreon.com/athan"
108
+ "type": "opencollective",
109
+ "url": "https://opencollective.com/stdlib"
108
110
  }
109
111
  }
package/docs/repl.txt DELETED
@@ -1,184 +0,0 @@
1
-
2
- {{alias}}( α, β )
3
- Returns a pseudorandom number drawn from an inverse gamma distribution.
4
-
5
- If `α <= 0` or `β <= 0`, the function returns `NaN`.
6
-
7
- If `α` or `β` is `NaN`, the function returns `NaN`.
8
-
9
- Parameters
10
- ----------
11
- α: number
12
- Shape parameter.
13
-
14
- β: number
15
- Scale parameter.
16
-
17
- Returns
18
- -------
19
- r: number
20
- Pseudorandom number.
21
-
22
- Examples
23
- --------
24
- > var r = {{alias}}( 2.0, 5.0 );
25
-
26
-
27
- {{alias}}.factory( [α, β, ][options] )
28
- Returns a pseudorandom number generator (PRNG) for generating pseudorandom
29
- numbers drawn from an inverse gamma distribution.
30
-
31
- If provided `α` and `β`, the returned PRNG returns random variates drawn
32
- from the specified distribution.
33
-
34
- If not provided `α` and `β`, the returned PRNG requires that both `α` and
35
- `β` be provided at each invocation.
36
-
37
- Parameters
38
- ----------
39
- α: number (optional)
40
- Shape parameter.
41
-
42
- β: number (optional)
43
- Scale parameter.
44
-
45
- options: Object (optional)
46
- Options.
47
-
48
- options.prng: Function (optional)
49
- Pseudorandom number generator (PRNG) for generating uniformly
50
- distributed pseudorandom numbers on the interval `[0,1)`. If provided,
51
- the `state` and `seed` options are ignored. In order to seed the
52
- returned pseudorandom number generator, one must seed the provided
53
- `prng` (assuming the provided `prng` is seedable).
54
-
55
- options.seed: integer|ArrayLikeObject<integer> (optional)
56
- Pseudorandom number generator seed. The seed may be either a positive
57
- unsigned 32-bit integer or, for arbitrary length seeds, an array-like
58
- object containing unsigned 32-bit integers.
59
-
60
- options.state: Uint32Array (optional)
61
- Pseudorandom number generator state. If provided, the `seed` option is
62
- ignored.
63
-
64
- options.copy: boolean (optional)
65
- Boolean indicating whether to copy a provided pseudorandom number
66
- generator state. Setting this option to `false` allows sharing state
67
- between two or more pseudorandom number generators. Setting this option
68
- to `true` ensures that a returned generator has exclusive control over
69
- its internal state. Default: true.
70
-
71
- Returns
72
- -------
73
- rand: Function
74
- Pseudorandom number generator (PRNG).
75
-
76
- Examples
77
- --------
78
- // Basic usage:
79
- > var rand = {{alias}}.factory();
80
- > var r = rand( 1.5, 1.5 );
81
- > r = rand( 3.14, 2.25 );
82
-
83
- // Provide `α` and `β`:
84
- > rand = {{alias}}.factory( 1.5, 1.5 );
85
- > r = rand();
86
- > r = rand();
87
-
88
-
89
- {{alias}}.NAME
90
- Generator name.
91
-
92
- Examples
93
- --------
94
- > var str = {{alias}}.NAME
95
- 'invgamma'
96
-
97
-
98
- {{alias}}.PRNG
99
- Underlying pseudorandom number generator.
100
-
101
- Examples
102
- --------
103
- > var prng = {{alias}}.PRNG;
104
-
105
-
106
- {{alias}}.seed
107
- Pseudorandom number generator seed.
108
-
109
- Examples
110
- --------
111
- > var seed = {{alias}}.seed;
112
-
113
-
114
- {{alias}}.seedLength
115
- Length of generator seed.
116
-
117
- Examples
118
- --------
119
- > var len = {{alias}}.seedLength;
120
-
121
-
122
- {{alias}}.state
123
- Generator state.
124
-
125
- Examples
126
- --------
127
- > var r = {{alias}}( 2.0, 5.0 )
128
- <number>
129
- > r = {{alias}}( 2.0, 5.0 )
130
- <number>
131
- > r = {{alias}}( 2.0, 5.0 )
132
- <number>
133
-
134
- // Get a copy of the current state:
135
- > var state = {{alias}}.state
136
- <Uint32Array>
137
-
138
- > r = {{alias}}( 2.0, 5.0 )
139
- <number>
140
- > r = {{alias}}( 2.0, 5.0 )
141
- <number>
142
-
143
- // Set the state:
144
- > {{alias}}.state = state;
145
-
146
- // Replay the last two pseudorandom numbers:
147
- > r = {{alias}}( 2.0, 5.0 )
148
- <number>
149
- > r = {{alias}}( 2.0, 5.0 )
150
- <number>
151
-
152
-
153
- {{alias}}.stateLength
154
- Length of generator state.
155
-
156
- Examples
157
- --------
158
- > var len = {{alias}}.stateLength;
159
-
160
-
161
- {{alias}}.byteLength
162
- Size of generator state.
163
-
164
- Examples
165
- --------
166
- > var sz = {{alias}}.byteLength;
167
-
168
-
169
- {{alias}}.toJSON()
170
- Serializes the pseudorandom number generator as a JSON object.
171
-
172
- Returns
173
- -------
174
- out: Object
175
- JSON representation.
176
-
177
- Examples
178
- --------
179
- > var o = {{alias}}.toJSON()
180
- { 'type': 'PRNG', 'name': '...', 'state': {...}, 'params': [] }
181
-
182
- See Also
183
- --------
184
-
@@ -1,220 +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 invgamma = require( './index' );
20
-
21
-
22
- // TESTS //
23
-
24
- // The function returns a number...
25
- {
26
- invgamma( 2, 3 ); // $ExpectType number
27
- invgamma( 1, 2 ); // $ExpectType number
28
- }
29
-
30
- // The compiler throws an error if the function is provided values other than two numbers...
31
- {
32
- invgamma( true, 3 ); // $ExpectError
33
- invgamma( false, 2 ); // $ExpectError
34
- invgamma( '5', 1 ); // $ExpectError
35
- invgamma( [], 1 ); // $ExpectError
36
- invgamma( {}, 2 ); // $ExpectError
37
- invgamma( ( x: number ): number => x, 2 ); // $ExpectError
38
-
39
- invgamma( 9, true ); // $ExpectError
40
- invgamma( 9, false ); // $ExpectError
41
- invgamma( 5, '5' ); // $ExpectError
42
- invgamma( 8, [] ); // $ExpectError
43
- invgamma( 9, {} ); // $ExpectError
44
- invgamma( 8, ( x: number ): number => x ); // $ExpectError
45
- }
46
-
47
- // The compiler throws an error if the function is provided an unsupported number of arguments...
48
- {
49
- invgamma(); // $ExpectError
50
- invgamma( 2 ); // $ExpectError
51
- invgamma( 2, 2, 4 ); // $ExpectError
52
- }
53
-
54
- // Attached to main export is a `factory` method which returns a function...
55
- {
56
- invgamma.factory( 2, 2 ); // $ExpectType NullaryFunction
57
- invgamma.factory(); // $ExpectType BinaryFunction
58
- invgamma.factory( { 'copy': false } ); // $ExpectType BinaryFunction
59
- }
60
-
61
- // The `factory` method returns a function which returns a number...
62
- {
63
- const fcn1 = invgamma.factory( 2, 2 );
64
- fcn1(); // $ExpectType number
65
-
66
- const fcn2 = invgamma.factory();
67
- fcn2( 2, 2 ); // $ExpectType number
68
- }
69
-
70
- // The compiler throws an error if the function returned by the `factory` method is provided invalid arguments...
71
- {
72
- const fcn1 = invgamma.factory( 2, 4 );
73
- fcn1( 12 ); // $ExpectError
74
- fcn1( true ); // $ExpectError
75
- fcn1( false ); // $ExpectError
76
- fcn1( '5' ); // $ExpectError
77
- fcn1( [] ); // $ExpectError
78
- fcn1( {} ); // $ExpectError
79
- fcn1( ( x: number ): number => x ); // $ExpectError
80
-
81
- const fcn2 = invgamma.factory();
82
- fcn2( true, 2 ); // $ExpectError
83
- fcn2( false, 2 ); // $ExpectError
84
- fcn2( '5', 2 ); // $ExpectError
85
- fcn2( [], 2 ); // $ExpectError
86
- fcn2( {}, 2 ); // $ExpectError
87
- fcn2( ( x: number ): number => x, 2 ); // $ExpectError
88
-
89
- fcn2( 1, true ); // $ExpectError
90
- fcn2( 1, false ); // $ExpectError
91
- fcn2( 1, '5' ); // $ExpectError
92
- fcn2( 1, [] ); // $ExpectError
93
- fcn2( 1, {} ); // $ExpectError
94
- fcn2( 1, ( x: number ): number => x ); // $ExpectError
95
- }
96
-
97
- // The compiler throws an error if the function returned by the `factory` method is provided an unsupported number of arguments...
98
- {
99
- const fcn1 = invgamma.factory( 2, 2 );
100
- fcn1( 1 ); // $ExpectError
101
- fcn1( 2, 1 ); // $ExpectError
102
- fcn1( 2, 1, 1 ); // $ExpectError
103
-
104
- const fcn2 = invgamma.factory();
105
- fcn2(); // $ExpectError
106
- fcn2( 1 ); // $ExpectError
107
- fcn2( 2, 1, 1 ); // $ExpectError
108
- }
109
-
110
- // The compiler throws an error if the `factory` method is provided values other than two numbers aside from an options object...
111
- {
112
- invgamma.factory( true, 3 ); // $ExpectError
113
- invgamma.factory( false, 2 ); // $ExpectError
114
- invgamma.factory( '5', 1 ); // $ExpectError
115
- invgamma.factory( [], 1 ); // $ExpectError
116
- invgamma.factory( {}, 2 ); // $ExpectError
117
- invgamma.factory( ( x: number ): number => x, 2 ); // $ExpectError
118
-
119
- invgamma.factory( 9, true ); // $ExpectError
120
- invgamma.factory( 9, false ); // $ExpectError
121
- invgamma.factory( 5, '5' ); // $ExpectError
122
- invgamma.factory( 8, [] ); // $ExpectError
123
- invgamma.factory( 9, {} ); // $ExpectError
124
- invgamma.factory( 8, ( x: number ): number => x ); // $ExpectError
125
-
126
- invgamma.factory( true, 3, {} ); // $ExpectError
127
- invgamma.factory( false, 2, {} ); // $ExpectError
128
- invgamma.factory( '5', 1, {} ); // $ExpectError
129
- invgamma.factory( [], 1, {} ); // $ExpectError
130
- invgamma.factory( {}, 2, {} ); // $ExpectError
131
- invgamma.factory( ( x: number ): number => x, 2, {} ); // $ExpectError
132
-
133
- invgamma.factory( 9, true, {} ); // $ExpectError
134
- invgamma.factory( 9, false, {} ); // $ExpectError
135
- invgamma.factory( 5, '5', {} ); // $ExpectError
136
- invgamma.factory( 8, [], {} ); // $ExpectError
137
- invgamma.factory( 9, {}, {} ); // $ExpectError
138
- invgamma.factory( 8, ( x: number ): number => x, {} ); // $ExpectError
139
- }
140
-
141
- // The compiler throws an error if the `factory` method is provided an options argument which is not an object...
142
- {
143
- invgamma.factory( null ); // $ExpectError
144
- invgamma.factory( 2, 2, null ); // $ExpectError
145
- }
146
-
147
- // The compiler throws an error if the `factory` method is provided a `prng` option which is not a pseudorandom number generator...
148
- {
149
- invgamma.factory( 2, 2, { 'prng': 123 } ); // $ExpectError
150
- invgamma.factory( 2, 2, { 'prng': 'abc' } ); // $ExpectError
151
- invgamma.factory( 2, 2, { 'prng': null } ); // $ExpectError
152
- invgamma.factory( 2, 2, { 'prng': [] } ); // $ExpectError
153
- invgamma.factory( 2, 2, { 'prng': {} } ); // $ExpectError
154
- invgamma.factory( 2, 2, { 'prng': true ); // $ExpectError
155
-
156
- invgamma.factory( { 'prng': 123 } ); // $ExpectError
157
- invgamma.factory( { 'prng': 'abc' } ); // $ExpectError
158
- invgamma.factory( { 'prng': null } ); // $ExpectError
159
- invgamma.factory( { 'prng': [] } ); // $ExpectError
160
- invgamma.factory( { 'prng': {} } ); // $ExpectError
161
- invgamma.factory( { 'prng': true ); // $ExpectError
162
- }
163
-
164
- // The compiler throws an error if the `factory` method is provided a `seed` option which is not a valid seed...
165
- {
166
- invgamma.factory( 2, 2, { 'seed': true } ); // $ExpectError
167
- invgamma.factory( 2, 2, { 'seed': 'abc' } ); // $ExpectError
168
- invgamma.factory( 2, 2, { 'seed': null } ); // $ExpectError
169
- invgamma.factory( 2, 2, { 'seed': [ 'a' ] } ); // $ExpectError
170
- invgamma.factory( 2, 2, { 'seed': {} } ); // $ExpectError
171
- invgamma.factory( 2, 2, { 'seed': ( x: number ): number => x } ); // $ExpectError
172
-
173
- invgamma.factory( { 'seed': true } ); // $ExpectError
174
- invgamma.factory( { 'seed': 'abc' } ); // $ExpectError
175
- invgamma.factory( { 'seed': null } ); // $ExpectError
176
- invgamma.factory( { 'seed': [ 'a' ] } ); // $ExpectError
177
- invgamma.factory( { 'seed': {} } ); // $ExpectError
178
- invgamma.factory( { 'seed': ( x: number ): number => x } ); // $ExpectError
179
- }
180
-
181
- // The compiler throws an error if the `factory` method is provided a `state` option which is not a valid state...
182
- {
183
- invgamma.factory( 2, 2, { 'state': 123 } ); // $ExpectError
184
- invgamma.factory( 2, 2, { 'state': 'abc' } ); // $ExpectError
185
- invgamma.factory( 2, 2, { 'state': null } ); // $ExpectError
186
- invgamma.factory( 2, 2, { 'state': [] } ); // $ExpectError
187
- invgamma.factory( 2, 2, { 'state': {} } ); // $ExpectError
188
- invgamma.factory( 2, 2, { 'state': true ); // $ExpectError
189
- invgamma.factory( 2, 2, { 'state': ( x: number ): number => x } ); // $ExpectError
190
-
191
- invgamma.factory( { 'state': 123 } ); // $ExpectError
192
- invgamma.factory( { 'state': 'abc' } ); // $ExpectError
193
- invgamma.factory( { 'state': null } ); // $ExpectError
194
- invgamma.factory( { 'state': [] } ); // $ExpectError
195
- invgamma.factory( { 'state': {} } ); // $ExpectError
196
- invgamma.factory( { 'state': true ); // $ExpectError
197
- invgamma.factory( { 'state': ( x: number ): number => x } ); // $ExpectError
198
- }
199
-
200
- // The compiler throws an error if the `factory` method is provided a `copy` option which is not a boolean...
201
- {
202
- invgamma.factory( 2, 2, { 'copy': 123 } ); // $ExpectError
203
- invgamma.factory( 2, 2, { 'copy': 'abc' } ); // $ExpectError
204
- invgamma.factory( 2, 2, { 'copy': null } ); // $ExpectError
205
- invgamma.factory( 2, 2, { 'copy': [] } ); // $ExpectError
206
- invgamma.factory( 2, 2, { 'copy': {} } ); // $ExpectError
207
- invgamma.factory( 2, 2, { 'copy': ( x: number ): number => x } ); // $ExpectError
208
-
209
- invgamma.factory( { 'copy': 123 } ); // $ExpectError
210
- invgamma.factory( { 'copy': 'abc' } ); // $ExpectError
211
- invgamma.factory( { 'copy': null } ); // $ExpectError
212
- invgamma.factory( { 'copy': [] } ); // $ExpectError
213
- invgamma.factory( { 'copy': {} } ); // $ExpectError
214
- invgamma.factory( { 'copy': ( x: number ): number => x } ); // $ExpectError
215
- }
216
-
217
- // The compiler throws an error if the `factory` method is provided more than three arguments...
218
- {
219
- invgamma.factory( 2, 4, {}, 2 ); // $ExpectError
220
- }