mathjs
Version:
Math.js is an extensive math library for JavaScript and Node.js. It features a flexible expression parser and offers an integrated solution to work with numbers, big numbers, complex numbers, units, and matrices.
42 lines (25 loc) • 919 B
Markdown
Create a distribution object with a set of random functions for given
random distribution.
```js
math.distribution(name)
```
Parameter | Type | Description
--------- | ---- | -----------
`name` | String | Name of a distribution. Choose from 'uniform', 'normal'.
Type | Description
---- | -----------
Object | Returns a distribution object containing functions: `random([size] [, min] [, max])`, `randomInt([min] [, max])`, `pickRandom(array)`
```js
var normalDist = math.distribution('normal'); // create a normal distribution
normalDist.random(0, 10); // get a random value between 0 and 10
```
[](random.md),
[](randomInt.md),
[](pickRandom.md)
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->