class: center, middle, inverse, title-slide # Bayesian updating ### Math 315: Bayesian Statistics --- class: middle, clear ## 1. Comparing paradigms ## 2. Discrete prior ## 3. Continuous prior --- # Marshall & Halligan (1988) .pull-left[ <img src="figs/01-burning-house.png" width="267" /> ] .pull-right[ .large[ Simplified version of the study: - Patient (P.S.) presented with two cards in random order - Asked to identify which house she would rather live in - `\(Y=\)` # times P.S. chose non-burning house ] ] .footnote[ .footnotesize[ Marshall, J. C., & Halligan, P. W. (1988). Blindsight and insight in visuo-spatial neglect. *Nature*, 336(6201), 766. ] ] --- # Analyze the data .Large[ Take 5 minutes and draw a conclusion about `\(\theta\)` Feel free to collaborate with your neighbor(s) ] --- # The frequentist paradigm .content-box-blue[ .Large[ A **frequentist procedure** quantifies uncertainty in terms of repeating the process that generated the data many times ] ] --- # Would a frequentist ever claim that... -- - .Large[ `\(P( Y > 14) = 0.75\)`? ] -- - .Large[ `\(P( \theta > 0.5) = 0.75\)`? ] -- - .Large[ `\(\theta \sim {\rm Unif}\)`(0.25, 0.5)? ] -- - .Large[ the probability that the true proportion of correct guesses is in the interval (0.64, 1) is 0.95? ] -- - .Large[ the probability that the null hypothesis, `\(H_0: \ p = 0.5\)`, is true is 0.0002? ] --- # The Bayesian paradigm .content-box-yellow[ .Large[ A **Bayesian procedure** quantifies uncertainty about the parameters that remain after accounting for prior knowledge and the information in the observed data ] ] --- # Would a Bayesian ever claim that... -- - .Large[ `\(P( Y > 14) = 0.75\)`? ] -- - .Large[ `\(P( \theta > 0.5) = 0.75\)`? ] -- - .Large[ `\(\theta \sim {\rm Unif}\)`(0.25, 0.5)? ] -- - .Large[ the probability that the true proportion of correct guesses is in the interval (0.64, 1) is 0.95? ] -- - .Large[ the probability that the null hypothesis, `\(H_0: \ p = 0.5\)`, is true is 0.0002? ] --- class: middle, inverse # Updating a discrete prior --- # Design .Large[ **Data:** N N N N <font color = "tomato">B B</font> N N N <font color = "tomato">B</font> N N N N N N N (14 Ns; <font color = "tomato">3 Bs</font>) <br> **Data model:** Some true proportion of guesses, `\(\theta\)` Toss a coin with probability of heads, `\(\theta\)` <br> **Belief about `\(\theta\)`:** Uniform over {0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9} ] --- # Condition .Large[ **Posterior distribution** The distribution of `\(\theta\)` that incorporates both the prior information and the data. i.e., the <font color = "#26A69A">**posterior**</font> is the <font color = '#FDD835'>**prior**</font> *conditioned* on <font color = '#9C27B0'>**evidence**</font> <!-- 15 --> `\(p(\theta | y) = {\rm Pr}(\theta = k | y)\)` ] --- class: clear, center, middle .Large[ <table> <thead> <tr> <th style="text-align:center;"> p </th> <th style="text-align:center;"> prior probability </th> <th style="text-align:center;"> likelihood </th> <th style="text-align:center;"> posterior plausibility (prior x likelihood) </th> <th style="text-align:center;"> posterior probability </th> </tr> </thead> <tbody> <tr> <td style="text-align:center;"> 0.1 </td> <td style="text-align:center;width: 1.5in; "> 0.1111111 </td> <td style="text-align:center;"> 0.0000000 </td> <td style="text-align:center;width: 2.5in; "> 0.0000000 </td> <td style="text-align:center;width: 1.5in; "> 0.0000000 </td> </tr> <tr> <td style="text-align:center;"> 0.2 </td> <td style="text-align:center;width: 1.5in; "> 0.1111111 </td> <td style="text-align:center;"> 0.0000001 </td> <td style="text-align:center;width: 2.5in; "> 0.0000000 </td> <td style="text-align:center;width: 1.5in; "> 0.0000001 </td> </tr> <tr> <td style="text-align:center;"> 0.3 </td> <td style="text-align:center;width: 1.5in; "> 0.1111111 </td> <td style="text-align:center;"> 0.0000112 </td> <td style="text-align:center;width: 2.5in; "> 0.0000012 </td> <td style="text-align:center;width: 1.5in; "> 0.0000200 </td> </tr> <tr> <td style="text-align:center;"> 0.4 </td> <td style="text-align:center;width: 1.5in; "> 0.1111111 </td> <td style="text-align:center;"> 0.0003943 </td> <td style="text-align:center;width: 2.5in; "> 0.0000438 </td> <td style="text-align:center;width: 1.5in; "> 0.0007053 </td> </tr> <tr> <td style="text-align:center;"> 0.5 </td> <td style="text-align:center;width: 1.5in; "> 0.1111111 </td> <td style="text-align:center;"> 0.0051880 </td> <td style="text-align:center;width: 2.5in; "> 0.0005764 </td> <td style="text-align:center;width: 1.5in; "> 0.0092803 </td> </tr> <tr> <td style="text-align:center;"> 0.6 </td> <td style="text-align:center;width: 1.5in; "> 0.1111111 </td> <td style="text-align:center;"> 0.0341041 </td> <td style="text-align:center;width: 2.5in; "> 0.0037893 </td> <td style="text-align:center;width: 1.5in; "> 0.0610052 </td> </tr> <tr> <td style="text-align:center;"> 0.7 </td> <td style="text-align:center;width: 1.5in; "> 0.1111111 </td> <td style="text-align:center;"> 0.1245218 </td> <td style="text-align:center;width: 2.5in; "> 0.0138358 </td> <td style="text-align:center;width: 1.5in; "> 0.2227440 </td> </tr> <tr> <td style="text-align:center;"> 0.8 </td> <td style="text-align:center;width: 1.5in; "> 0.1111111 </td> <td style="text-align:center;"> 0.2392537 </td> <td style="text-align:center;width: 2.5in; "> 0.0265837 </td> <td style="text-align:center;width: 1.5in; "> 0.4279761 </td> </tr> <tr> <td style="text-align:center;"> 0.9 </td> <td style="text-align:center;width: 1.5in; "> 0.1111111 </td> <td style="text-align:center;"> 0.1555622 </td> <td style="text-align:center;width: 2.5in; "> 0.0172847 </td> <td style="text-align:center;width: 1.5in; "> 0.2782690 </td> </tr> </tbody> </table> ] --- class: clear, middle, center <img src="02-bayesian-updating_files/figure-html/unnamed-chunk-4-1.svg" width="100%" /> --- # Sequential updating <!-- --> --- # Evaluate .Large[ Bayesian inference must be supervised - Did the model malfunction? - Does the model's answer make sense? - Does the question make sense? - Check sensitivity of the answer to changes in the assumptions ] --- class: middle, inverse # Updating a continuous prior --- # Design, redux .Large[ **Data:** N N N N <font color = "tomato">B B</font> N N N <font color = "tomato">B</font> N N N N N N N (14 Ns; <font color = "tomato">3 Bs</font>) <br> **Data model:** Some true proportion of guesses, `\(\theta\)` Toss a coin with probability of heads, `\(\theta\)` <br> **Belief about `\(\theta\)`:** Uniform over (0, 1) ] --- class: center, middle, clear <img src="figs/002x006.png" width="575" /> --- class: inverse # Your turn .Large[ - Break into groups - Derive the posteriors - Are you working with a conjugate family? ]