@stdlib/random-array

Pseudorandom number generator array creation functions.

https://github.com/stdlib-js/random-array

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.8%) to scientific vocabulary

Keywords

generator javascript lib library math mathematics node node-js nodejs prng pseudorandom rand random rng seed seedable standard statistics stats stdlib
Last synced: 6 months ago · JSON representation ·

Repository

Pseudorandom number generator array creation functions.

Basic Info
Statistics
  • Stars: 2
  • Watchers: 3
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Topics
generator javascript lib library math mathematics node node-js nodejs prng pseudorandom rand random rng seed seedable standard statistics stats stdlib
Created about 3 years ago · Last pushed 8 months ago
Metadata Files
Readme Changelog Contributing License Code of conduct Citation Security

README.md

About stdlib...

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.

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.

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.

To join us in bringing numerical computing to the web, get started by checking us out on GitHub, and please consider financially supporting stdlib. We greatly appreciate your continued support!

Array

NPM version Build Status Coverage Status <!-- dependencies -->

Pseudorandom number generator (PRNG) array creation functions.

## Installation ```bash npm install @stdlib/random-array ``` Alternatively, - To load the package in a website via a `script` tag without installation and bundlers, use the [ES Module][es-module] available on the [`esm`][esm-url] branch (see [README][esm-readme]). - If you are using Deno, visit the [`deno`][deno-url] branch (see [README][deno-readme] for usage intructions). - For use in Observable, or in browser/node environments, use the [Universal Module Definition (UMD)][umd] build available on the [`umd`][umd-url] branch (see [README][umd-readme]). The [branches.md][branches-url] file summarizes the available branches and displays a diagram illustrating their relationships. To view installation and usage instructions specific to each branch build, be sure to explicitly navigate to the respective README files on each branch, as linked to above.
## Usage ```javascript var ns = require( '@stdlib/random-array' ); ``` #### ns Namespace containing array creation pseudorandom number generator (PRNG) functions. ```javascript var o = ns; // returns {...} ``` The namespace contains the following:
- [`arcsine( len, a, b[, options] )`][@stdlib/random/array/arcsine]: create an array containing pseudorandom numbers drawn from an arcsine distribution. - [`bernoulli( len, p[, options] )`][@stdlib/random/array/bernoulli]: create an array containing pseudorandom numbers drawn from a Bernoulli distribution. - [`beta( len, alpha, beta[, options] )`][@stdlib/random/array/beta]: create an array containing pseudorandom numbers drawn from a beta distribution. - [`betaprime( len, alpha, beta[, options] )`][@stdlib/random/array/betaprime]: create an array containing pseudorandom numbers drawn from a beta prime distribution. - [`binomial( len, n, p[, options] )`][@stdlib/random/array/binomial]: create an array containing pseudorandom numbers drawn from a binomial distribution. - [`cauchy( len, x0, gamma[, options] )`][@stdlib/random/array/cauchy]: create an array containing pseudorandom numbers drawn from a Cauchy distribution. - [`chi( len, k[, options] )`][@stdlib/random/array/chi]: create an array containing pseudorandom numbers drawn from a chi distribution. - [`chisquare( len, k[, options] )`][@stdlib/random/array/chisquare]: create an array containing pseudorandom numbers drawn from a chi-square distribution. - [`cosine( len, mu, s[, options] )`][@stdlib/random/array/cosine]: create an array containing pseudorandom numbers drawn from a raised cosine distribution. - [`discreteUniform( len, a, b[, options] )`][@stdlib/random/array/discrete-uniform]: create an array containing pseudorandom numbers drawn from a discrete uniform distribution. - [`erlang( len, k, lambda[, options] )`][@stdlib/random/array/erlang]: create an array containing pseudorandom numbers drawn from an Erlang distribution. - [`exponential( len, lambda[, options] )`][@stdlib/random/array/exponential]: create an array containing pseudorandom numbers drawn from an exponential distribution. - [`f( len, d1, d2[, options] )`][@stdlib/random/array/f]: create an array containing pseudorandom numbers drawn from an F distribution. - [`frechet( len, alpha, s, m[, options] )`][@stdlib/random/array/frechet]: create an array containing pseudorandom numbers drawn from a Fréchet distribution. - [`gamma( len, alpha, beta[, options] )`][@stdlib/random/array/gamma]: create an array containing pseudorandom numbers drawn from a gamma distribution. - [`geometric( len, p[, options] )`][@stdlib/random/array/geometric]: create an array containing pseudorandom numbers drawn from a geometric distribution. - [`gumbel( len, mu, beta[, options] )`][@stdlib/random/array/gumbel]: create an array containing pseudorandom numbers drawn from a Gumbel distribution. - [`hypergeometric( len, N, K, n[, options] )`][@stdlib/random/array/hypergeometric]: create an array containing pseudorandom numbers drawn from a hypergeometric distribution. - [`invgamma( len, alpha, beta[, options] )`][@stdlib/random/array/invgamma]: create an array containing pseudorandom numbers drawn from a inverse gamma distribution. - [`kumaraswamy( len, a, b[, options] )`][@stdlib/random/array/kumaraswamy]: create an array containing pseudorandom numbers drawn from Kumaraswamy's double bounded distribution. - [`laplace( len, mu, b[, options] )`][@stdlib/random/array/laplace]: create an array containing pseudorandom numbers drawn from a Laplace (double exponential) distribution. - [`levy( len, mu, c[, options] )`][@stdlib/random/array/levy]: create an array containing pseudorandom numbers drawn from a Lévy distribution. - [`logistic( len, mu, s[, options] )`][@stdlib/random/array/logistic]: create an array containing pseudorandom numbers drawn from a logistic distribution. - [`lognormal( len, mu, sigma[, options] )`][@stdlib/random/array/lognormal]: create an array containing pseudorandom numbers drawn from a lognormal distribution. - [`minstdShuffle( len[, options] )`][@stdlib/random/array/minstd-shuffle]: create an array containing pseudorandom numbers generated using a linear congruential pseudorandom number generator (LCG) whose output is shuffled. - [`minstd( len[, options] )`][@stdlib/random/array/minstd]: create an array containing pseudorandom numbers generated using a linear congruential pseudorandom number generator (LCG). - [`mt19937( len[, options] )`][@stdlib/random/array/mt19937]: create an array containing pseudorandom numbers generated using a 32-bit Mersenne Twister pseudorandom number generator. - [`negativeBinomial( len, r, p[, options] )`][@stdlib/random/array/negative-binomial]: create an array containing pseudorandom numbers drawn from a negative binomial distribution. - [`normal( len, mu, sigma[, options] )`][@stdlib/random/array/normal]: create an array containing pseudorandom numbers drawn from a normal distribution. - [`pareto1( len, alpha, beta[, options] )`][@stdlib/random/array/pareto-type1]: create an array containing pseudorandom numbers drawn from a Pareto (Type I) distribution. - [`poisson( len, lambda[, options] )`][@stdlib/random/array/poisson]: create an array containing pseudorandom numbers drawn from a Poisson distribution. - [`randu( len[, options] )`][@stdlib/random/array/randu]: create an array containing uniformly distributed pseudorandom numbers between `0` and `1`. - [`rayleigh( len, sigma[, options] )`][@stdlib/random/array/rayleigh]: create an array containing pseudorandom numbers drawn from a Rayleigh distribution. - [`t( len, v[, options] )`][@stdlib/random/array/t]: create an array containing pseudorandom numbers drawn from a Student's t-distribution. - [`tools`][@stdlib/random/array/tools]: pseudorandom number generator (PRNG) array creation function tools. - [`triangular( len, a, b, c[, options] )`][@stdlib/random/array/triangular]: create an array containing pseudorandom numbers drawn from a triangular distribution. - [`uniform( len, a, b[, options] )`][@stdlib/random/array/uniform]: create an array containing pseudorandom numbers drawn from a continuous uniform distribution. - [`weibull( len, k, lambda[, options] )`][@stdlib/random/array/weibull]: create an array containing pseudorandom numbers drawn from a Weibull distribution.
## Examples ```javascript var ns = require( '@stdlib/random-array' ); // Generate arrays with ten random numbers drawn from the respective distributions: var out = ns.arcsine( 10, 2.0, 5.0 ); // returns out = ns.weibull( 10, 2.0, 5.0 ); // returns out = ns.laplace( 10, 2.0, 5.0 ); // returns // Factory methods: // 1. Basic factory usage (no parameters): var random = ns.arcsine.factory(); out = random( 10, 2.0, 5.0 ); // returns // 2. Factory with options (e.g., seed): random = ns.arcsine.factory({ 'seed': 1234 }); out = random( 10, 2.0, 5.0 ); // returns // 3. Factory with distribution parameters: random = ns.arcsine.factory( 2.0, 5.0 ); out = random( 10 ); // returns // 4. Factory with both distribution parameters and options: random = ns.arcsine.factory( 2.0, 5.0, { 'dtype': 'float32' }); out = random( 10 ); // returns ```
* * * ## Notice This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib]. #### Community [![Chat][chat-image]][chat-url] --- ## License See [LICENSE][stdlib-license]. ## Copyright Copyright © 2016-2025. The Stdlib [Authors][stdlib-authors].

Owner

  • Name: stdlib
  • Login: stdlib-js
  • Kind: organization

Standard library for JavaScript.

Citation (CITATION.cff)

cff-version: 1.2.0
title: stdlib
message: >-
  If you use this software, please cite it using the
  metadata from this file.

type: software

authors:
  - name: The Stdlib Authors
    url: https://github.com/stdlib-js/stdlib/graphs/contributors

repository-code: https://github.com/stdlib-js/stdlib
url: https://stdlib.io

abstract: |
  Standard library for JavaScript and Node.js.

keywords:
  - JavaScript
  - Node.js
  - TypeScript
  - standard library
  - scientific computing
  - numerical computing
  - statistical computing

license: Apache-2.0 AND BSL-1.0

date-released: 2016

GitHub Events

Total
  • Push event: 22
Last Year
  • Push event: 22

Issues and Pull Requests

Last synced: 8 months ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • npm 2 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 3
  • Total maintainers: 4
npmjs.org: @stdlib/random-array

Pseudorandom number generator array creation functions.

  • Homepage: https://stdlib.io
  • License: Apache-2.0
  • Latest release: 0.2.1
    published almost 2 years ago
  • Versions: 3
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 2 Last month
Rankings
Forks count: 15.9%
Stargazers count: 17.3%
Average: 31.0%
Dependent repos count: 37.4%
Dependent packages count: 53.5%
Funding
  • type: opencollective
  • url: https://opencollective.com/stdlib
Last synced: 6 months ago

Dependencies

.github/workflows/benchmark.yml actions
  • actions/checkout v3 composite
  • actions/setup-node v3 composite
.github/workflows/cancel.yml actions
  • styfle/cancel-workflow-action 0.11.0 composite
.github/workflows/close_pull_requests.yml actions
  • superbrothers/close-pull-request v3 composite
.github/workflows/examples.yml actions
  • actions/checkout v3 composite
  • actions/setup-node v3 composite
.github/workflows/npm_downloads.yml actions
  • actions/checkout v3 composite
  • actions/setup-node v3 composite
  • actions/upload-artifact v3 composite
  • distributhor/workflow-webhook v3 composite
.github/workflows/productionize.yml actions
  • act10ns/slack v1 composite
  • actions/checkout v3 composite
  • actions/setup-node v3 composite
  • stdlib-js/bundle-action main composite
  • stdlib-js/transform-errors-action main composite
.github/workflows/publish.yml actions
  • JS-DevTools/npm-publish v1 composite
  • act10ns/slack v1 composite
  • actions/checkout v3 composite
  • actions/setup-node v3 composite
  • styfle/cancel-workflow-action 0.11.0 composite
.github/workflows/test.yml actions
  • act10ns/slack v1 composite
  • actions/checkout v3 composite
  • actions/setup-node v3 composite
.github/workflows/test_bundles.yml actions
  • act10ns/slack v1 composite
  • actions/checkout v3 composite
  • actions/setup-node v3 composite
  • denoland/setup-deno v1 composite
.github/workflows/test_coverage.yml actions
  • act10ns/slack v1 composite
  • actions/checkout v3 composite
  • actions/setup-node v3 composite
  • codecov/codecov-action v3 composite
  • distributhor/workflow-webhook v3 composite
.github/workflows/test_install.yml actions
  • act10ns/slack v1 composite
  • actions/checkout v3 composite
  • actions/setup-node v3 composite
package.json npm
  • @stdlib/array-base-filled-by ^0.0.2 development
  • @stdlib/array-float32 ^0.0.6 development
  • @stdlib/array-float64 ^0.0.6 development
  • @stdlib/array-int32 ^0.0.6 development
  • @stdlib/array-typed-real-ctors ^0.0.1 development
  • @stdlib/array-typed-real-dtypes ^0.0.2 development
  • @stdlib/array-typed-real-float-ctors ^0.0.1 development
  • @stdlib/array-typed-real-float-dtypes ^0.0.1 development
  • @stdlib/array-uint32 ^0.0.6 development
  • @stdlib/assert-has-own-property ^0.0.7 development
  • @stdlib/assert-is-int32array ^0.0.8 development
  • @stdlib/assert-is-nonnegative-integer ^0.0.7 development
  • @stdlib/assert-is-number ^0.0.7 development
  • @stdlib/assert-is-plain-object ^0.0.7 development
  • @stdlib/assert-is-uint32array ^0.0.8 development
  • @stdlib/bench ^0.0.12 development
  • @stdlib/console-log-each ^0.0.2 development
  • @stdlib/constants-int32-max ^0.0.7 development
  • @stdlib/constants-uint32-max ^0.0.7 development
  • @stdlib/math-base-assert-is-nan ^0.0.8 development
  • @stdlib/math-base-assert-is-nanf ^0.0.8 development
  • @stdlib/math-base-special-pow ^0.0.7 development
  • @stdlib/random-base-arcsine ^0.0.6 development
  • @stdlib/random-base-beta ^0.0.7 development
  • @stdlib/random-base-betaprime ^0.0.6 development
  • @stdlib/random-base-cosine ^0.0.6 development
  • @stdlib/random-base-discrete-uniform ^0.0.6 development
  • @stdlib/random-base-exponential ^0.0.6 development
  • @stdlib/random-base-gamma ^0.0.6 development
  • @stdlib/random-base-invgamma ^0.0.6 development
  • @stdlib/random-base-lognormal ^0.0.6 development
  • @stdlib/random-base-minstd ^0.0.6 development
  • @stdlib/random-base-minstd-shuffle ^0.0.6 development
  • @stdlib/random-base-mt19937 ^0.0.6 development
  • @stdlib/random-base-normal ^0.0.6 development
  • @stdlib/random-base-randu ^0.0.8 development
  • @stdlib/random-base-uniform ^0.0.6 development
  • @stdlib/strided-base-binary ^0.0.8 development
  • @stdlib/strided-base-nullary ^0.0.7 development
  • @stdlib/strided-base-unary ^0.0.8 development
  • @stdlib/string-format ^0.0.3 development
  • @stdlib/utils-constant-function ^0.0.8 development
  • @stdlib/utils-define-nonenumerable-read-only-accessor ^0.0.7 development
  • @stdlib/utils-define-nonenumerable-read-only-property ^0.0.7 development
  • @stdlib/utils-define-nonenumerable-read-write-accessor ^0.0.7 development
  • @stdlib/utils-keys ^0.0.7 development
  • @stdlib/utils-noop ^0.0.14 development
  • istanbul ^0.4.1 development
  • tap-min git+https://github.com/Planeshifter/tap-min.git development
  • tape git+https://github.com/kgryte/tape.git#fix/globby development
  • @stdlib/random-array-arcsine github:stdlib-js/random-array-arcsine#main
  • @stdlib/random-array-beta github:stdlib-js/random-array-beta#main
  • @stdlib/random-array-betaprime github:stdlib-js/random-array-betaprime#main
  • @stdlib/random-array-cosine github:stdlib-js/random-array-cosine#main
  • @stdlib/random-array-discrete-uniform github:stdlib-js/random-array-discrete-uniform#main
  • @stdlib/random-array-exponential github:stdlib-js/random-array-exponential#main
  • @stdlib/random-array-gamma github:stdlib-js/random-array-gamma#main
  • @stdlib/random-array-invgamma github:stdlib-js/random-array-invgamma#main
  • @stdlib/random-array-lognormal github:stdlib-js/random-array-lognormal#main
  • @stdlib/random-array-minstd github:stdlib-js/random-array-minstd#main
  • @stdlib/random-array-minstd-shuffle github:stdlib-js/random-array-minstd-shuffle#main
  • @stdlib/random-array-mt19937 github:stdlib-js/random-array-mt19937#main
  • @stdlib/random-array-normal github:stdlib-js/random-array-normal#main
  • @stdlib/random-array-randu github:stdlib-js/random-array-randu#main
  • @stdlib/random-array-uniform github:stdlib-js/random-array-uniform#main
  • @stdlib/utils-define-read-only-property ^0.0.8