random-fu-0.2.6.2: Random number generation

Safe HaskellNone
LanguageHaskell98

Data.Random.Distribution.Triangular

Synopsis

Documentation

data Triangular a Source

A description of a triangular distribution - a distribution whose PDF is a triangle ramping up from a lower bound to a specified midpoint and back down to the upper bound. This is a very simple distribution that does not generally occur naturally but is used sometimes as an estimate of a true distribution when only the range of the values and an approximate mode of the true distribution are known.

Constructors

Triangular 

Fields

triLower :: a

The lower bound of the triangle in the PDF (the smallest number the distribution can generate)

triMid :: a

The midpoint of the triangle (also the mode of the distribution)

triUpper :: a

The upper bound of the triangle (and the largest number the distribution can generate)

floatingTriangular :: (Floating a, Ord a, Distribution StdUniform a) => a -> a -> a -> RVarT m a Source

Compute a triangular distribution for a Floating type.

triangularCDF :: RealFrac a => a -> a -> a -> a -> Double Source

triangularCDF a b c is the CDF of realFloatTriangular a b c.