jxxcarlson/elm-stat/5.0.1

NOTE: the latest version is 6.0.3

StatRandom

The goal of this module is to provide commonly used probability distributions.

Discrete distributions

bernoulliBool : Float -> Generator Bool

A discrete generator that follows the bernoulli distribution and returns true or false with the given probability.

bernoulliInt : Float -> Generator Int

A discrete generator that follows the bernoulli distribution and returns 1 or 0 with the given probability.

binomial : Float -> Int -> Generator Int

A discrete generator that follows the binomial distribution with the given probability for n number of trials.

poisson : Float -> Int -> Generator Int

A discrete generator that follows the poisson distribution with the given lambda and for n number of trials.

geometric : Float -> Int -> Generator Int

A discrete generator that follows the geomtric distribution with the given probability for n number of trials.

Continous distributions

normal : Float -> Float -> Generator Float

Create a generator of floats that is normally distributed with given mean and standard deviation.

standardNormal : Generator Float

A generator that follows a standard normal distribution.

exponential : Float -> Generator Float

A generator that follows the exponential distribution with the given lambda.

beta : Float -> Float -> Generator Float

A generator that follows the beta distribution with the given alpha and beta parameters.

Data Structures

generateList : Int -> Generator a -> Generator (List a)

Generates a list with the given size. (same as Random.list)

generateMatrix : Int -> Int -> Generator a -> Generator (List (List a))

Generates a matrix with the given form.