random-fu-0.3.0.1: Random number generation
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Random.Distribution.Simplex

Synopsis

Documentation

newtype StdSimplex as Source #

Uniform distribution over a standard simplex.

Constructors

StdSimplex Int

StdSimplex k constructs a standard simplex of dimension k (standard k-simplex). An element of the simplex represents a vector variable as = (a_0, a_1, ..., a_k). The elements of as are more than or equal to 0 and sum as is always equal to 1.

Instances

Instances details
(Ord a, Fractional a, Distribution StdUniform a) => Distribution StdSimplex [a] Source # 
Instance details

Defined in Data.Random.Distribution.Simplex

Methods

rvar :: StdSimplex [a] -> RVar [a] Source #

rvarT :: forall (n :: Type -> Type). StdSimplex [a] -> RVarT n [a] Source #

Show (StdSimplex as) Source # 
Instance details

Defined in Data.Random.Distribution.Simplex

Methods

showsPrec :: Int -> StdSimplex as -> ShowS #

show :: StdSimplex as -> String #

showList :: [StdSimplex as] -> ShowS #

Eq (StdSimplex as) Source # 
Instance details

Defined in Data.Random.Distribution.Simplex

Methods

(==) :: StdSimplex as -> StdSimplex as -> Bool #

(/=) :: StdSimplex as -> StdSimplex as -> Bool #

stdSimplex :: Distribution StdSimplex [a] => Int -> RVar [a] Source #

stdSimplex k returns a random variable being uniformly distributed over a standard simplex of dimension k.

fractionalStdSimplex :: (Ord a, Fractional a, Distribution StdUniform a) => Int -> RVar [a] Source #

An algorithm proposed by Rubinstein & Melamed (1998). See, e.g., S. Onn, I. Weissman. Generating uniform random vectors over a simplex with implications to the volume of a certain polytope and to multivariate extremes. Ann Oper Res (2011) 189:331-342.