probability-0.2.6: Probabilistic Functional Programming

Safe HaskellSafe
LanguageHaskell98

Numeric.Probability.Random

Contents

Description

Randomized values

Synopsis

random generator

newtype T a Source #

Random values

Constructors

Cons 

Fields

Instances
Monad T Source # 
Instance details

Defined in Numeric.Probability.Random

Methods

(>>=) :: T a -> (a -> T b) -> T b #

(>>) :: T a -> T b -> T b #

return :: a -> T a #

fail :: String -> T a #

Functor T Source # 
Instance details

Defined in Numeric.Probability.Random

Methods

fmap :: (a -> b) -> T a -> T b #

(<$) :: a -> T b -> T a #

Applicative T Source # 
Instance details

Defined in Numeric.Probability.Random

Methods

pure :: a -> T a #

(<*>) :: T (a -> b) -> T a -> T b #

liftA2 :: (a -> b -> c) -> T a -> T b -> T c #

(*>) :: T a -> T b -> T b #

(<*) :: T a -> T b -> T a #

C T Source # 
Instance details

Defined in Numeric.Probability.Simulation

Methods

(~.) :: (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 # 
Instance details

Defined in Numeric.Probability.Object

Methods

fromFrequencies :: [(a, Double)] -> T a Source #

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 #