Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype Dist a = D (Matrix Prob () a)
- type Prob = Double
- type Countable a = KnownNat (Count a)
- type CountableN a = KnownNat (Count (Normalize a))
- type CountableDimsN a b = (CountableN a, CountableN b)
- type FLN a b = FL (Normalize a) (Normalize b)
- type Liftable a b = (Bounded a, Bounded b, Enum a, Enum b, Eq b, Num Prob, Ord Prob)
- type TrivialP a b = Normalize (a, b) ~ Normalize (Normalize a, Normalize b)
- fmapD :: (Liftable a b, CountableDimsN a b, FLN b a) => (a -> b) -> Dist a -> Dist b
- unitD :: Dist ()
- multD :: (CountableDimsN a b, CountableN (a, b), FLN (a, b) a, FLN (a, b) b, TrivialP a b) => Dist a -> Dist b -> Dist (a, b)
- selectD :: (FLN b b, CountableN b) => Dist (Either a b) -> Matrix Prob a b -> Dist b
- branchD :: (Num e, CountableDimsN a b, CountableDimsN c (Either b c), FLN c b, FLN a b, FLN a a, FLN b b, FLN c c, FLN b a, FLN b c, FLN (Either b c) b, FLN (Either b c) c) => Dist (Either a b) -> Matrix Prob a c -> Matrix Prob b c -> Dist c
- ifD :: (CountableDimsN a (Either () a), FLN a a, FLN a (), FLN () a, FLN (Either () a) a) => Dist Bool -> Dist a -> Dist a -> Dist a
- returnD :: forall a. (Enum a, FLN () a, Countable a) => a -> Dist a
- bindD :: Dist a -> Matrix Prob a b -> Dist b
- (??) :: (Enum a, Countable a, FLN () a) => (a -> Bool) -> Dist a -> Prob
- choose :: FLN () a => Prob -> Dist a
- shape :: FLN () a => (Prob -> Prob) -> [a] -> Dist a
- linear :: FLN () a => [a] -> Dist a
- uniform :: FLN () a => [a] -> Dist a
- negExp :: FLN () a => [a] -> Dist a
- normal :: FLN () a => [a] -> Dist a
- toValues :: forall a. (Enum a, Countable a, FLN () a) => Dist a -> [(a, Prob)]
- prettyDist :: forall a. (Show a, Enum a, Countable a, FLN () a) => Dist a -> String
- prettyPrintDist :: forall a. (Show a, Enum a, Countable a, FLN () a) => Dist a -> IO ()
Documentation
Type synonym for column vector matrices. This represents a probability distribution.
type Countable a = KnownNat (Count a) Source #
Constraint type synonyms to keep the type signatures less convoluted
type CountableDimsN a b = (CountableN a, CountableN b) Source #
fmapD :: (Liftable a b, CountableDimsN a b, FLN b a) => (a -> b) -> Dist a -> Dist b Source #
Functor instance
multD :: (CountableDimsN a b, CountableN (a, b), FLN (a, b) a, FLN (a, b) b, TrivialP a b) => Dist a -> Dist b -> Dist (a, b) Source #
Applicative/Monoidal instance mult
function
selectD :: (FLN b b, CountableN b) => Dist (Either a b) -> Matrix Prob a b -> Dist b Source #
Selective instance function
branchD :: (Num e, CountableDimsN a b, CountableDimsN c (Either b c), FLN c b, FLN a b, FLN a a, FLN b b, FLN c c, FLN b a, FLN b c, FLN (Either b c) b, FLN (Either b c) c) => Dist (Either a b) -> Matrix Prob a c -> Matrix Prob b c -> Dist c Source #
Chooses which of the two given effectful functions to apply to a given argument;
ifD :: (CountableDimsN a (Either () a), FLN a a, FLN a (), FLN () a, FLN (Either () a) a) => Dist Bool -> Dist a -> Dist a -> Dist a Source #
Branch on a Boolean value, skipping unnecessary computations.
returnD :: forall a. (Enum a, FLN () a, Countable a) => a -> Dist a Source #
Monad instance return
function
(??) :: (Enum a, Countable a, FLN () a) => (a -> Bool) -> Dist a -> Prob Source #
Extract probabilities given an Event.
shape :: FLN () a => (Prob -> Prob) -> [a] -> Dist a Source #
Creates a distribution given a shape function
toValues :: forall a. (Enum a, Countable a, FLN () a) => Dist a -> [(a, Prob)] Source #
Transforms a Dist
into a list of pairs.