What is probabilistic programming?
radar.oreilly.com
radar.oreilly.com
The new term "probabilistic programming" stems from the recognition that stochastic programs can be automatically interpreted as defining a joint probability model and Bayesian inference on this model equates to sampling execution traces that are consistent with the observed data. This is an extremely powerful idea. It enables one to quickly build and compose both the standard Bayesian models you'd find in textbooks, and innovate easily to build new models tailored to particular application domains, often by composing more standard models with more exotic ones. Probabilistic programming provides a natural way to specify these complex models and has the potential to hide the computational difficulties that plague applied Bayesian modeling.
Making all this practical is the real challenge. Performant sampling of execution traces for a broad class of models is an unsolved problem, which is part of the motivation for DARPA's new project.
For those interested in this area, we're working on one effort alone these lines at Sense: https://www.senseplatform.com.
Given that probabilistic graphical models is in general NP-hard (or #P-hard) then approximate algorithms are often used. However, for many problems discrete valued networks can be effectively managed with exact algorithms.
Some tools for exact inference (that are free or commercial with free versions) are:
http://genie.sis.pitt.edu http://www.norsys.com/netica.html http://www.hugin.com
Netica in particular has a large library of example networks.
Say you have a model, y = mx + b, and you have some data. Normally you can solve this explicitly with matrices or whatever. But you'll need to implement the solution. With probabilistic language like BUGS, you can feed in the model and the data and it would return `m` and `b` as a probability distribution.
This is an trivial example. One example of where it really comes in handy is doing bayesian inference.
Consider BUGS as it's a very prototypical probabilistic programming example. If your goal is to specify that you have a model where you observe the "wetness of the grass outside" and infer whether it "rained previously" then you can use BUGS to express it easily.
model {
rained ~ dbinom(0.1) /* prior probability */
for (i in 1:N) {
grass[i] ~ rained
}
}
for some data grass[i].(That was a very sketchy example, don't read into it too closely)
The heart of this is that quantitative methods are getting so well understood that we can express the algebra of models as a formal language. When we do this we get many of the benefits that programming has done for formal expressions of flow-charts.
If your unit tests were automagically varied wouldn't that make them more valuable? They might actually find new bugs once in a while.
Here's a link to JAGS's homepage: http://mcmc-jags.sourceforge.net/
There's also PyMC (which can do similar types of analysis). https://github.com/pymc-devs/pymc