Skip to content

v0.1.14

Choose a tag to compare

@github-actions github-actions released this 26 Sep 11:46
· 28 commits to main since this release
deda55f

Added

  • More distributions in Random (#8): lognormal(mu, sigma) with Random.lognormalParams(mean, stdDev), gamma(shape, scale) (Marsaglia-Tsang), erlang(k, mean), weibull(shape, scale), beta(alpha, beta), bernoulli(p), geometric(p), weightedChoice(items, weights), discrete([{ value, weight }]) and empirical(samples, { interpolate }). All are seeded from the same generator, validate their parameters with ValidationError, and document mean/variance in JSDoc. New exported types WeightedValue<T> and EmpiricalOptions.

Fixed

  • exponential(), normal() and the new log-based transforms draw from the open interval (0, 1), so they can no longer return Infinity or NaN on the one generator state per period that yields exactly 0.