Safe Haskell | Safe |
---|---|
Language | Haskell98 |
Randomized values
Synopsis
- 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)
- below :: (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
Instances
Monad T Source # | |
Functor T Source # | |
Applicative T Source # | |
C T Source # | |
Defined in Numeric.Probability.Simulation (~.) :: (Fractional prob, Ord prob, Random prob, Ord a) => Int -> (a -> T a) -> Transition prob a Source # (~..) :: (Fractional prob, Ord prob, Random prob, Ord a) => (Int, Int) -> (a -> T a) -> RExpand prob a Source # (~*.) :: (Fractional prob, Ord prob, Random prob, Ord a) => (Int, Int) -> (a -> T a) -> Transition prob a Source # | |
C Double T Source # | |
Defined in Numeric.Probability.Object fromFrequencies :: [(a, Double)] -> 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
Randomized transitions
type Transition prob a = a -> Distribution prob a Source #
random transition
type ApproxDist a = T [a] Source #