@techreport{gordon2013a, author = {Gordon, Andrew D. and Aizatulin, Mihhail and Claret, Guillaume and Graepel, Thore and Nori, Aditya and Rajamani, Sriram and Russo, Claudio and Borgstroem, Johannes and Gordon, Andy}, title = {A Model-Learner Pattern for Bayesian Reasoning}, institution = {Microsoft}, year = {2013}, month = {January}, abstract = {A Bayesian model is based on a pair of probability distributions, known as the prior and sampling distributions. A wide range of fundamental machine learning tasks, including regression, classification, clustering, and many others, can all be seen as Bayesian models. We propose a new probabilistic programming abstraction, a typed Bayesian model, based on a pair of probabilistic expressions for the prior and sampling distributions. A sampler for a model is an algorithm to compute synthetic data from its sampling distribution, while a learner for a model is an algorithm for probabilistic inference on the model. Models, samplers, and learners form a generic programming pattern for model-based inference. They support the uniform expression of common tasks including model testing, and generic compositions such as mixture models, evidence-based model averaging, and mixtures of experts. A formal semantics supports reasoning about model equivalence and implementation correctness. By developing a series of examples and three learner implementations based on exact inference, factor graphs, and Markov chain Monte Carlo, we demonstrate the broad applicability of this new programming pattern.}, url = {http://approjects.co.za/?big=en-us/research/publication/a-model-learner-pattern-for-bayesian-reasoning/}, number = {MSR-TR-2013-1}, }