3 ms·
Suppose you have a probability monad, implementing enumeration or random sampling. Like Amb but with probabilities attached. bayesRule :: (Prob a) -> (a ->
by laretluval 8y ago
Suppose you have a probability monad, implementing enumeration or random sampling. Like Amb but with probabilities attached.
bayesRule :: (Prob a) -> (a -> Prob b) -> b -> Prob a
bayesRule prior likelihood data = do
h <- prior
d <- likelihood h
guard $ d == data
return h
I don’t actually do Haskell...just thinking out loud.
Looks like it was written similarly here http://www.randomhacks.net/files/build-your-own-probability-monads.pdf http://www.randomhacks.net/files/build-your-own-probability-...
- platz 8y agod == data requires an exact match of data, doesn't seem right