Frozen probability distributions in the style of scipy.stats: each object exposes density/mass, cumulative and quantile functions, moments and sampling.
Every function accepts a number or a (nested) array of numbers and returns the same shape.
- Source:
Example
import { stats } from 'randlibjs'
const n = stats.normal(0, 1)
n.cdf(1.96) // 0.9750021048517795
n.ppf([0.025, 0.975]) // [-1.959963984540054, 1.959963984540054]
n.interval(0.95) // [-1.96, 1.96]
n.sample(5) // five random draws
Classes
Namespaces
Members
(inner, constant) mixtureMethods
Shared behaviour of continuous and discrete mixtures. @private
- Source:
Methods
(inner) refineTail()
Newton refinement of an upper-tail quantile using the survival function. @private
- Source: