Safe Haskell | Safe-Inferred |
---|
Randomized values
- newtype T a = Cons {}
- randomR :: Random a => (a, a) -> T a
- run :: T a -> IO a
- runSeed :: StdGen -> T a -> a
- print :: Show a => T a -> IO ()
- pick :: (Num prob, Ord prob, Random prob) => T prob a -> T a
- type Distribution prob a = T (T prob a)
- above :: (Num prob, Ord prob, Ord a) => prob -> Distribution prob a -> Distribution prob (Select a)
- dist :: (Fractional prob, Ord a) => [T a] -> Distribution prob a
- type Change a = a -> T a
- change :: (Num prob, Ord prob, Random prob) => T prob a -> Change a
- type Transition prob a = a -> Distribution prob a
- type ApproxDist a = T [a]
random generator
Random values
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
Randomized transitions
type Transition prob a = a -> Distribution prob aSource
random transition
type ApproxDist a = T [a]Source