Search code examples
bayesianpymcpymc3stanedward

Could someone explain more clear "programming" part of probabilistic programming?


Usually in the docs for probabilistic programming frameworks I can read much about MCMC but not very much about programming. Every example I see have usually only very short and simple probabilistic program. Usually they are about 5-10 lines of code, if you don't count input of the data and output of the results. So, it doesn't kinda look like programming.

As I understand, I can write probabilistic program to regularize learning process, so the longer my probabilistic program is, the faster calculation will be, the smaller training data set I need and more correct result I can get. Am I right?

For example, if I want to find a cat on the picture. I can write probabilistic program that describes how cats look like and in what kind of exposition they can be. And the more detailed my description is the better result will be?

Thanks, Dmitry


Solution

  • To me, "probababilistic programming" just means you write your models down in a programming language with probabilitiy constructs. Stan gives you an imperative programming language with variables that denote random variables.

    Stan's documentation has 200+ pages on programming in Stan, so I'm not sure what you're looking for. It covers everything from data types to parameterizations to user-defined functions. Like most intros and manuals, the examples tend to be short. If you want to see longer programs, look at the case studies or follow the user forums.

    Larger models don't necessarily mean you need less data. The more information the model contains about the answer before you start (the prior), the less data you need. With more data you have, you can make finer-grained inferences.

    I don't think you'll have much luck describing cats with a detailed hand-built model.