https://github.com/gnlow/dscrtz
Generate random value from discrete distribution
https://github.com/gnlow/dscrtz
discrete-distributions random
Last synced: 6 months ago
JSON representation
Generate random value from discrete distribution
- Host: GitHub
- URL: https://github.com/gnlow/dscrtz
- Owner: gnlow
- License: mit
- Created: 2020-05-17T05:34:17.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-05-17T23:54:59.000Z (about 6 years ago)
- Last Synced: 2024-12-30T14:48:40.732Z (over 1 year ago)
- Topics: discrete-distributions, random
- Language: TypeScript
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Dscrtz
Generate random value from discrete distribution
## Example (Deno)
```ts
import {Discrete} from "https://raw.githubusercontent.com/gnlow/dscrtz/master/mod.ts"
const distribution = new Discrete(["A", 11], ["B", 20], ["C", 15])
console.log(distribution.rand(Math.random()))
```