hakaru-0.1.2: A probabilistic programming embedded DSL

Safe HaskellNone

Language.Hakaru.Metropolis

Documentation

type DistVal = DynamicSource

data Dist a Source

Constructors

Dist 

Fields

logDensity :: a -> Likelihood
 
sample :: forall g. RandomGen g => g -> (a, g)
 

Instances

Typeable1 Dist 

data XRP Source

Constructors

forall e . Typeable e => XRP (e, Dist e) 

unXRP :: Typeable a => XRP -> Maybe (a, Dist a)Source

type Var a = IntSource

type Likelihood = DoubleSource

type Visited = BoolSource

type Observed = BoolSource

type Cond = Maybe DistValSource

type Subloc = IntSource

newtype Measure a Source

Constructors

Measure 

Fields

unMeasure :: RandomGen g => (Name, Database, (Likelihood, Likelihood), [Cond], g) -> (a, Database, (Likelihood, Likelihood), [Cond], g)
 

Instances

Monad Measure 
Typeable1 Measure 

lit :: (Eq a, Typeable a) => a -> aSource

makeXRP :: (Typeable a, RandomGen g) => Cond -> Dist a -> Name -> Database -> g -> (a, Database, Likelihood, Likelihood, g)Source

updateLikelihood :: (Typeable a, RandomGen g) => Likelihood -> Likelihood -> (a, Database, Likelihood, Likelihood, g) -> [Cond] -> (a, Database, (Likelihood, Likelihood), [Cond], g)Source

dirac :: (Eq a, Typeable a) => a -> Cond -> Measure aSource

bern :: Double -> Cond -> Measure BoolSource

poisson :: Double -> Cond -> Measure IntSource

gamma :: Double -> Double -> Cond -> Measure DoubleSource

beta :: Double -> Double -> Cond -> Measure DoubleSource

uniform :: Double -> Double -> Cond -> Measure DoubleSource

normal :: Double -> Double -> Cond -> Measure DoubleSource

laplace :: Double -> Double -> Cond -> Measure DoubleSource

categorical :: (Eq a, Typeable a) => [(a, Double)] -> Cond -> Measure aSource

resample :: RandomGen g => XRP -> g -> (XRP, Likelihood, Likelihood, Likelihood, g)Source

bind :: Measure a -> (a -> Measure b) -> Measure bSource

lam :: (a -> b) -> a -> bSource

app :: (a -> b) -> a -> bSource

fix :: ((a -> b) -> a -> b) -> a -> bSource

ifThenElse :: Bool -> a -> a -> aSource

run :: Measure a -> [Cond] -> IO (a, Database, Likelihood)Source

traceUpdate :: RandomGen g => Measure a -> Database -> [Cond] -> g -> (a, Database, Likelihood, Likelihood, Likelihood, g)Source

updateDB :: RandomGen g => Name -> Database -> Observed -> XRP -> g -> (Database, Likelihood, Likelihood, Likelihood, g)Source

transition :: (Typeable a, RandomGen g) => Measure a -> [Cond] -> a -> Database -> Likelihood -> g -> [a]Source

mcmc :: Typeable a => Measure a -> [Cond] -> IO [a]Source