Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Probabilistic Programming (Vermont Code Camp 2016)

Avatar for Eric Smith Eric Smith
September 19, 2016

Probabilistic Programming (Vermont Code Camp 2016)

The world is full of uncertainty. But most software handles computation deterministically. Probabilistic Programming is a bridge between general-purpose programming languages and the statistical methods of machine learning and artificial intelligence.

In this introduction, we cover some basics of probability theory, provide a conceptual framework for understanding probabilistic programming systems, compare probabilistic inference with logical inference and its use in making decisions, and survey some of the current efforts to bring probabilistic programming to industrial settings.

Avatar for Eric Smith

Eric Smith

September 19, 2016

Other Decks in Programming

Transcript

  1. Probabilis)c Programming System •  Probabilis)c program “Usual programs with two

    added constructs: (1) the ability the draw values at random from distribu)ons (2) the ability to condi)on values of variables in a program via observe statements. ” •  Probabilis)c inference “Compu)ng an explicit representa)on of the probability distribu)on implicitly specified by a probabilis)c program" Probabilis+c Programming (2014), Gordon et al
  2. Sample space Ω = { HHH, HHT, HTH, THH, HTT,

    THT, TTH, TTT } Flipping a fair coin 3 +mes
  3. Event A = { HHH, HHT, HTH, HTT } A

    = Get Heads on the first flip B = {HHH, HHT, THH, THT } B = Get Heads on the second flip
  4. Prior vs Posterior Probability A prior probability is your understanding

    before making an observa)on. A posterior (or condi+onal) probability is using an observa)on to revise a prior.
  5. A = { 3 } 3 dots B = {

    3, 4, 5, 6 } at least 3 dots Condi)onal Probability P(A|B) is 1/4
  6. Joint Distribu)on Toothache No Toothache Catch No Catch Catch No

    Catch Cavity 0.108 0.012 0.072 0.008 No Cavity 0.016 0.064 0.144 0.576 P(cavity | toothache) = P(cavity ∧ toothache) P(toothache) = 0.108 + 0.012 0.108 + 0.012 + 0.016 + 0.064 = 0.6
  7. Bayes Rule P(cause | effect) = P(effect | cause) P(cause)

    P(effect) Meningi)s can cause s)ff neck 70% of the )me. Incidence of meningi)s is 1/50,000. Probability that any pa)ent has a s)ff neck is 1%. P(s | m) = 0.7 P(m) = 1/50,000 P(s) = 0.01 P(m | s) = P(s | m) P(m) P(s) = 0.7 x 1/50,000 0.01 = 0.0014
  8. Bayes Net What is the probability that it is raining,

    given that the sprinkler Is on and the grass is wet?