random-fu-0.3.0.1: Random number generation

Safe Haskell | None
Language | Haskell2010

Data.Random.Distribution.Simplex

Synopsis

- newtype StdSimplex as = StdSimplex Int
- stdSimplex :: Distribution StdSimplex [a] => Int -> RVar [a]
- stdSimplexT :: forall a (m :: Type -> Type). Distribution StdSimplex [a] => Int -> RVarT m [a]
- fractionalStdSimplex :: (Ord a, Fractional a, Distribution StdUniform a) => Int -> RVar [a]

# 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 Source # show :: StdSimplex as -> String Source # showList :: [StdSimplex as] -> ShowS Source #
Eq (StdSimplex as) Source # |
Instance details Defined in Data.Random.Distribution.Simplex Methods (==) :: StdSimplex as -> StdSimplex as -> Bool Source # (/=) :: StdSimplex as -> StdSimplex as -> Bool Source #

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

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

stdSimplexT :: forall a (m :: Type -> Type). Distribution StdSimplex [a] => Int -> RVarT m [a] Source #

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.