tests/prob_prog/lazy_sample/3/sample.hs
raw| 1 | module Model where |
| 2 | |
| 3 | import Probability |
| 4 | |
| 5 | model x = do |
| 6 | x <- sample $ normal 0.0 1.0 |
| 7 | ys <- lazy $ sample $ independent $ repeat $ normal 0.0 1.0 |
| 8 | let (mu,sigma) = (x, sum $ take 10 $ map (^2) ys) |
| 9 | observe x $ normal mu sigma |
| 10 | return [ "mu" %=% mu, "sigma" %=% sigma] |
| 11 | |
| 12 | main logDir = do |
| 13 | return $ model 1 |