@stdlib/random-streams

Standard library pseudorandom number generator streams.

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

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
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.5%) 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

Standard library pseudorandom number generator streams.

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 over 4 years ago · Last pushed 11 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!

Pseudorandom Number Generator Streams

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

Pseudorandom number generator (PRNG) streams.

## Installation ```bash npm install @stdlib/random-streams ``` 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-streams' ); ``` #### ns Namespace containing pseudorandom number generator (PRNG) streams. ```javascript var streams = ns; // returns {...} ``` The namespace contains the following functions for creating readable pseudorandom number generator streams:
- [`arcsine( a, b[, options] )`][@stdlib/random/streams/arcsine]: create a readable stream for generating pseudorandom numbers drawn from an arcsine distribution. - [`bernoulli( p[, options] )`][@stdlib/random/streams/bernoulli]: create a readable stream for generating pseudorandom numbers drawn from a Bernoulli distribution. - [`beta( alpha, beta[, options] )`][@stdlib/random/streams/beta]: create a readable stream for generating pseudorandom numbers drawn from a beta distribution. - [`betaprime( alpha, beta[, options] )`][@stdlib/random/streams/betaprime]: create a readable stream for generating pseudorandom numbers drawn from a beta prime distribution. - [`binomial( n, p[, options] )`][@stdlib/random/streams/binomial]: create a readable stream for generating pseudorandom numbers drawn from a binomial distribution. - [`boxMuller( [options] )`][@stdlib/random/streams/box-muller]: create a readable stream for generating pseudorandom numbers drawn from a standard normal distribution using the Box-Muller transform. - [`cauchy( x0, gamma[, options] )`][@stdlib/random/streams/cauchy]: create a readable stream for generating pseudorandom numbers drawn from a Cauchy distribution. - [`chi( k[, options] )`][@stdlib/random/streams/chi]: create a readable stream for generating pseudorandom numbers drawn from a chi distribution. - [`chisquare( k[, options] )`][@stdlib/random/streams/chisquare]: create a readable stream for generating pseudorandom numbers drawn from a chi-square distribution. - [`cosine( mu, s[, options] )`][@stdlib/random/streams/cosine]: create a readable stream for generating pseudorandom numbers drawn from a raised cosine distribution. - [`discreteUniform( a, b[, options] )`][@stdlib/random/streams/discrete-uniform]: create a readable stream for generating pseudorandom numbers drawn from a discrete uniform distribution. - [`erlang( k, lambda[, options] )`][@stdlib/random/streams/erlang]: create a readable stream for generating pseudorandom numbers drawn from an Erlang distribution. - [`exponential( lambda[, options] )`][@stdlib/random/streams/exponential]: create a readable stream for generating pseudorandom numbers drawn from an exponential distribution. - [`f( d1, d2[, options] )`][@stdlib/random/streams/f]: create a readable stream for generating pseudorandom numbers drawn from an F distribution. - [`frechet( alpha, s, m[, options] )`][@stdlib/random/streams/frechet]: create a readable stream for generating pseudorandom numbers drawn from a Fréchet distribution. - [`gamma( alpha, beta[, options] )`][@stdlib/random/streams/gamma]: create a readable stream for generating pseudorandom numbers drawn from a gamma distribution. - [`geometric( p[, options] )`][@stdlib/random/streams/geometric]: create a readable stream for generating pseudorandom numbers drawn from a geometric distribution. - [`gumbel( mu, beta[, options] )`][@stdlib/random/streams/gumbel]: create a readable stream for generating pseudorandom numbers drawn from a Gumbel distribution. - [`hypergeometric( N, K, n[, options] )`][@stdlib/random/streams/hypergeometric]: create a readable stream for generating pseudorandom numbers drawn from a hypergeometric distribution. - [`improvedZiggurat( [options] )`][@stdlib/random/streams/improved-ziggurat]: create a readable stream for generating pseudorandom numbers drawn from a standard normal distribution using the Improved Ziggurat algorithm. - [`invgamma( alpha, beta[, options] )`][@stdlib/random/streams/invgamma]: create a readable stream for generating pseudorandom numbers drawn from an inverse gamma distribution. - [`kumaraswamy( a, b[, options] )`][@stdlib/random/streams/kumaraswamy]: create a readable stream for generating pseudorandom numbers drawn from a Kumaraswamy's double bounded distribution. - [`laplace( mu, b[, options] )`][@stdlib/random/streams/laplace]: create a readable stream for generating pseudorandom numbers drawn from a Laplace (double exponential) distribution. - [`levy( mu, c[, options] )`][@stdlib/random/streams/levy]: create a readable stream for generating pseudorandom numbers drawn from a Lévy distribution. - [`logistic( mu, s[, options] )`][@stdlib/random/streams/logistic]: create a readable stream for generating pseudorandom numbers drawn from a logistic distribution. - [`lognormal( mu, sigma[, options] )`][@stdlib/random/streams/lognormal]: create a readable stream for generating pseudorandom numbers drawn from a lognormal distribution. - [`minstdShuffle( [options] )`][@stdlib/random/streams/minstd-shuffle]: create a readable stream for a linear congruential pseudorandom number generator (LCG) whose output is shuffled. - [`minstd( [options] )`][@stdlib/random/streams/minstd]: create a readable stream for a linear congruential pseudorandom number generator (LCG) based on Park and Miller. - [`mt19937( [options] )`][@stdlib/random/streams/mt19937]: create a readable stream for a 32-bit Mersenne Twister pseudorandom number generator. - [`negativeBinomial( r, p[, options] )`][@stdlib/random/streams/negative-binomial]: create a readable stream for generating pseudorandom numbers drawn from a negative binomial distribution. - [`normal( mu, sigma[, options] )`][@stdlib/random/streams/normal]: create a readable stream for generating pseudorandom numbers drawn from a normal distribution. - [`pareto1( alpha, beta[, options] )`][@stdlib/random/streams/pareto-type1]: create a readable stream for generating pseudorandom numbers drawn from a Pareto (Type I) distribution. - [`poisson( lambda[, options] )`][@stdlib/random/streams/poisson]: create a readable stream for generating pseudorandom numbers drawn from a Poisson distribution. - [`randi( [options] )`][@stdlib/random/streams/randi]: create a readable stream for generating pseudorandom numbers having integer values. - [`randn( [options] )`][@stdlib/random/streams/randn]: create a readable stream for generating pseudorandom numbers drawn from a standard normal distribution. - [`randu( [options] )`][@stdlib/random/streams/randu]: create a readable stream for generating uniformly distributed pseudorandom numbers between `0` and `1`. - [`rayleigh( sigma[, options] )`][@stdlib/random/streams/rayleigh]: create a readable stream for generating pseudorandom numbers drawn from a Rayleigh distribution. - [`t( v[, options] )`][@stdlib/random/streams/t]: create a readable stream for generating pseudorandom numbers drawn from a Student's t distribution. - [`triangular( a, b, c[, options] )`][@stdlib/random/streams/triangular]: create a readable stream for generating pseudorandom numbers drawn from a triangular distribution. - [`uniform( a, b[, options] )`][@stdlib/random/streams/uniform]: create a readable stream for generating pseudorandom numbers drawn from a uniform distribution. - [`weibull( k, lambda[, options] )`][@stdlib/random/streams/weibull]: create a readable stream for generating pseudorandom numbers drawn from a Weibull distribution.
## Examples ```javascript var objectKeys = require( '@stdlib/utils-keys' ); var ns = require( '@stdlib/random-streams' ); console.log( objectKeys( ns ) ); ```
* * * ## 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: 10
Last Year
  • Push event: 10

Committers

Last synced: about 2 years ago

All Time
  • Total Commits: 34
  • Total Committers: 1
  • Avg Commits per committer: 34.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 8
  • Committers: 1
  • Avg Commits per committer: 8.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
stdlib-bot n****y@s****o 34
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 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 3 last-month
  • Total dependent packages: 2
  • Total dependent repositories: 0
  • Total versions: 9
  • Total maintainers: 4
npmjs.org: @stdlib/random-streams

Pseudorandom number generator streams.

  • Homepage: https://stdlib.io
  • License: Apache-2.0
  • Latest release: 0.2.1
    published almost 2 years ago
  • Versions: 9
  • Dependent Packages: 2
  • Dependent Repositories: 0
  • Downloads: 3 Last month
Rankings
Dependent packages count: 9.5%
Stargazers count: 16.8%
Forks count: 17.4%
Average: 19.9%
Dependent repos count: 25.3%
Downloads: 30.3%
Funding
  • type: opencollective
  • url: https://opencollective.com/stdlib
Last synced: 6 months ago

Dependencies

package.json npm
  • @stdlib/array-int32 ^0.0.x development
  • @stdlib/array-uint32 ^0.0.x development
  • @stdlib/array-uint8 ^0.0.x development
  • @stdlib/assert-has-own-property ^0.0.x development
  • @stdlib/assert-is-boolean ^0.0.x development
  • @stdlib/assert-is-browser ^0.0.x development
  • @stdlib/assert-is-buffer ^0.0.x development
  • @stdlib/assert-is-error ^0.0.x development
  • @stdlib/assert-is-int32array ^0.0.x development
  • @stdlib/assert-is-integer ^0.0.x development
  • @stdlib/assert-is-nonnegative-integer ^0.0.x development
  • @stdlib/assert-is-nonnegative-number ^0.0.x development
  • @stdlib/assert-is-number ^0.0.x development
  • @stdlib/assert-is-plain-object ^0.0.x development
  • @stdlib/assert-is-positive-integer ^0.0.x development
  • @stdlib/assert-is-positive-number ^0.0.x development
  • @stdlib/assert-is-probability ^0.0.x development
  • @stdlib/assert-is-string ^0.0.x development
  • @stdlib/assert-is-uint32array ^0.0.x development
  • @stdlib/assert-is-windows ^0.0.x development
  • @stdlib/bench ^0.0.x development
  • @stdlib/blas-base-gcopy ^0.0.x development
  • @stdlib/buffer-from-string ^0.0.x development
  • @stdlib/constants-int32-max ^0.0.x development
  • @stdlib/constants-uint32-max ^0.0.x development
  • @stdlib/fs-exists ^0.0.x development
  • @stdlib/fs-read-file ^0.0.x development
  • @stdlib/fs-unlink ^0.0.x development
  • @stdlib/math-base-assert-is-integer ^0.0.x development
  • @stdlib/math-base-assert-is-nan ^0.0.x development
  • @stdlib/process-exec-path ^0.0.x development
  • @stdlib/random-base-arcsine ^0.0.x development
  • @stdlib/random-base-bernoulli ^0.0.x development
  • @stdlib/random-base-beta ^0.0.x development
  • @stdlib/random-base-betaprime ^0.0.x development
  • @stdlib/random-base-binomial ^0.0.x development
  • @stdlib/random-base-box-muller ^0.0.x development
  • @stdlib/random-base-cauchy ^0.0.x development
  • @stdlib/random-base-chi ^0.0.x development
  • @stdlib/random-base-chisquare ^0.0.x development
  • @stdlib/random-base-cosine ^0.0.x development
  • @stdlib/random-base-discrete-uniform ^0.0.x development
  • @stdlib/random-base-erlang ^0.0.x development
  • @stdlib/random-base-exponential ^0.0.x development
  • @stdlib/random-base-f ^0.0.x development
  • @stdlib/random-base-frechet ^0.0.x development
  • @stdlib/random-base-gamma ^0.0.x development
  • @stdlib/random-base-geometric ^0.0.x development
  • @stdlib/random-base-gumbel ^0.0.x development
  • @stdlib/random-base-hypergeometric ^0.0.x development
  • @stdlib/random-base-improved-ziggurat ^0.0.x development
  • @stdlib/random-base-invgamma ^0.0.x development
  • @stdlib/random-base-kumaraswamy ^0.0.x development
  • @stdlib/random-base-laplace ^0.0.x development
  • @stdlib/random-base-levy ^0.0.x development
  • @stdlib/random-base-logistic ^0.0.x development
  • @stdlib/random-base-lognormal ^0.0.x development
  • @stdlib/random-base-minstd ^0.0.x development
  • @stdlib/random-base-minstd-shuffle ^0.0.x development
  • @stdlib/random-base-mt19937 ^0.0.x development
  • @stdlib/random-base-negative-binomial ^0.0.x development
  • @stdlib/random-base-normal ^0.0.x development
  • @stdlib/random-base-pareto-type1 ^0.0.x development
  • @stdlib/random-base-poisson ^0.0.x development
  • @stdlib/random-base-randi ^0.0.x development
  • @stdlib/random-base-randn ^0.0.x development
  • @stdlib/random-base-randu ^0.0.x development
  • @stdlib/random-base-rayleigh ^0.0.x development
  • @stdlib/random-base-t ^0.0.x development
  • @stdlib/random-base-triangular ^0.0.x development
  • @stdlib/random-base-uniform ^0.0.x development
  • @stdlib/random-base-weibull ^0.0.x development
  • @stdlib/streams-node-inspect-sink ^0.0.x development
  • @stdlib/string-format ^0.0.x development
  • @stdlib/string-replace ^0.0.x development
  • @stdlib/time-now ^0.0.x development
  • @stdlib/utils-copy ^0.0.x development
  • @stdlib/utils-define-nonenumerable-property ^0.0.x development
  • @stdlib/utils-define-nonenumerable-read-only-property ^0.0.x development
  • @stdlib/utils-define-read-only-accessor ^0.0.x development
  • @stdlib/utils-define-read-write-accessor ^0.0.x development
  • @stdlib/utils-inherit ^0.0.x development
  • @stdlib/utils-keys ^0.0.x development
  • @stdlib/utils-next-tick ^0.0.x development
  • istanbul ^0.4.1 development
  • tap-spec 5.x.x development
  • tape git+https://github.com/kgryte/tape.git#fix/globby development
  • @stdlib/random-streams-arcsine ^0.0.x
  • @stdlib/random-streams-bernoulli ^0.0.x
  • @stdlib/random-streams-beta ^0.0.x
  • @stdlib/random-streams-betaprime ^0.0.x
  • @stdlib/random-streams-binomial ^0.0.x
  • @stdlib/random-streams-box-muller ^0.0.x
  • @stdlib/random-streams-cauchy ^0.0.x
  • @stdlib/random-streams-chi ^0.0.x
  • @stdlib/random-streams-chisquare ^0.0.x
  • @stdlib/random-streams-cosine ^0.0.x
  • @stdlib/random-streams-discrete-uniform ^0.0.x
  • @stdlib/random-streams-erlang ^0.0.x
  • @stdlib/random-streams-exponential ^0.0.x
  • @stdlib/random-streams-f ^0.0.x
  • @stdlib/random-streams-frechet ^0.0.x
  • @stdlib/random-streams-gamma ^0.0.x
  • @stdlib/random-streams-geometric ^0.0.x
  • @stdlib/random-streams-gumbel ^0.0.x
  • @stdlib/random-streams-hypergeometric ^0.0.x
  • @stdlib/random-streams-improved-ziggurat ^0.0.x
  • @stdlib/random-streams-invgamma ^0.0.x
  • @stdlib/random-streams-kumaraswamy ^0.0.x
  • @stdlib/random-streams-laplace ^0.0.x
  • @stdlib/random-streams-levy ^0.0.x
  • @stdlib/random-streams-logistic ^0.0.x
  • @stdlib/random-streams-lognormal ^0.0.x
  • @stdlib/random-streams-minstd ^0.0.x
  • @stdlib/random-streams-minstd-shuffle ^0.0.x
  • @stdlib/random-streams-mt19937 ^0.0.x
  • @stdlib/random-streams-negative-binomial ^0.0.x
  • @stdlib/random-streams-normal ^0.0.x
  • @stdlib/random-streams-pareto-type1 ^0.0.x
  • @stdlib/random-streams-poisson ^0.0.x
  • @stdlib/random-streams-randi ^0.0.x
  • @stdlib/random-streams-randn ^0.0.x
  • @stdlib/random-streams-randu ^0.0.x
  • @stdlib/random-streams-rayleigh ^0.0.x
  • @stdlib/random-streams-t ^0.0.x
  • @stdlib/random-streams-triangular ^0.0.x
  • @stdlib/random-streams-uniform ^0.0.x
  • @stdlib/random-streams-weibull ^0.0.x
  • @stdlib/utils-define-read-only-property ^0.0.x
.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