tweag / monad-bayes

A library for probabilistic programming in Haskell.
MIT License
407 stars 62 forks source link

Notebooks: Bayesian.ipynb #220

Closed mknorps closed 1 year ago

mknorps commented 1 year ago

Detailed review of Bayesian.ipynb tutorial.

netlify[bot] commented 1 year ago

Deploy Preview for monad-bayes ready!

Name Link
Latest commit 8894fa06964e91e21bee3e07619b1adfa3baf055
Latest deploy log https://app.netlify.com/sites/monad-bayes/deploys/6350f8ba09a86e0009f37935
Deploy Preview https://deploy-preview-220--monad-bayes.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

mknorps commented 1 year ago

@reubenharry What do you mean by "an't always get the density of a sample"? Could you elaborate on the difference between generative and likelihood?

Monad-Bayes exports a Bayesian datatype to make using Bayesian models easier. The idea is that you specify your model as a prior, generative model and a likelihood (separate from the generative model because you can't always get the density of a sample from a distribution).

reubenharry commented 1 year ago

@reubenharry What do you mean by "an't always get the density of a sample"? Could you elaborate on the difference between generative and likelihood?

Monad-Bayes exports a Bayesian datatype to make using Bayesian models easier. The idea is that you specify your model as a prior, generative model and a likelihood (separate from the generative model because you can't always get the density of a sample from a distribution).

Yes, I didn't explain that well. What I mean is that from code like normal 0 1, there's no automatic way to transform it into normalPdf 0 1, or more generally, if I have x :: MonadDistribution m => m a, I can't automatically get y :: a -> Log Double.