probability-0.2.4.1: Probabilistic Functional Programming

Safe HaskellSafe-Inferred

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 aSource

run :: T a -> IO aSource

Run random action in IO monad.

runSeed :: StdGen -> T a -> aSource

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 aSource

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

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

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 aSource

random change

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

Randomized transitions

type Transition prob a = a -> Distribution prob aSource

random transition

type ApproxDist a = T [a]Source