probability-0.2.5: Probabilistic Functional Programming

Safe HaskellSafe-Inferred
LanguageHaskell98

Numeric.Probability.Random

Contents

Description

Randomized values

Synopsis

random generator

newtype T a Source

Random values

Constructors

Cons 

Fields

decons :: State StdGen a
 

Instances

randomR :: Random a => (a, a) -> T a Source

run :: T a -> IO a Source

Run random action in IO monad.

runSeed :: StdGen -> T a -> a Source

Run random action without IO using a seed.

print :: Show a => T a -> IO () Source

pick :: (Num prob, Ord prob, Random prob) => T prob a -> T a Source

random distribution

type Distribution prob a = T (T prob a) Source

Randomized distribution

above :: (Num prob, Ord prob, Ord a) => prob -> Distribution prob a -> Distribution prob (Select a) Source

below :: (Num prob, Ord prob, Ord a) => prob -> Distribution prob a -> Distribution prob (Select a) Source

dist :: (Fractional prob, Ord a) => [T a] -> Distribution prob a Source

dist converts a list of randomly generated values into a distribution by taking equal weights for all values. Thus dist (replicate n rnd) simulates rnd n times and returns an estimation of the distribution represented by rnd.

Randomized changes

type Change a = a -> T a Source

random change

change :: (Num prob, Ord prob, Random prob) => T prob a -> Change a Source

Randomized transitions

type Transition prob a = a -> Distribution prob a Source

random transition

type ApproxDist a = T [a] Source