class: center, middle, inverse, title-slide # Introduction ## PSYC 573 ### University of Southern California ### January 11, 2022 --- exclude: TRUE class: inverse, mline, center, middle # Warmup Quizz --- exclude: TRUE # Scoring 1. a = 1 point, b = 3 points, c = 2 points; 2. a = 1 point, b = 3 points, c = 1 point; 3. a = 3 points, b = 1 point; 4. a = 3 points, b = 1 point. --- exclude: TRUE # Scoring - 4--5: your current thinking is fairly frequentist - 9--12: alignment with the Bayesian philosophy - 6--8: strengths in both philosophies ??? From https://www.bayesrulesbook.com/chapter-1.html --- class: inverse, mline, center, middle # History of Bayesian Statistics --- class: clear - Video intro: https://www.youtube.com/watch?v=BcvLAw-JRss <iframe width="480" height="270" src="https://www.youtube.com/embed/BcvLAw-JRss" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> .pull-left[ - A nice popular science book by Sharon Bertsch McGrayne: *The theory that would not die* ] .pull-right[ ] --- # Historical Figures .pull-left[ Thomas Bayes (1701--1762) <img src="https://upload.wikimedia.org/wikipedia/commons/d/d4/Thomas_Bayes.gif" width="50%" style="display: block; margin: auto;" /> .font80[ - English Presbyterian minister - "An Essay towards solving a Problem in the Doctrine of Chances", edited by Richard Price after Bayes's death ] ] .pull-right[ Pierre-Simon Laplace (1749--1827) <img src="https://upload.wikimedia.org/wikipedia/commons/e/e3/Pierre-Simon_Laplace.jpg" width="40%" style="display: block; margin: auto;" /> .font80[ - French Mathematician - Formalize Bayesian interpretation of probability, and most of the machinery for Bayesian statistics ] ] ??? Image credit: [Wikimedia Commons](https://commons.wikimedia.org/wiki/File:Thomas_Bayes.gif), [Wikimedia Commons](https://commons.wikimedia.org/wiki/File:Pierre-Simon_Laplace.jpg) --- # In the 20th Century - Bayesian---way to do statistics until early 1920s - Ronald Fisher and Frequentist scholars took over * "The theory of inverse probability is founded upon an error, and must be wholly rejected" (Fisher, 1925, p. 10)<sup>1</sup> .footnote[ [1]: Aldrich, J. (2008). R. A. Fisher on Bayes and Bayes' theorem. *Bayesian Analysis, 3*(1), 161--170. ] --- # Resurrection .left-column[ <img src="https://upload.wikimedia.org/wikipedia/commons/a/a1/Alan_Turing_Aged_16.jpg" width="100%" style="display: block; margin: auto;" /> ] .right-column[ - Alan Turing's algorithms in code breaking in World War II - *Markov Chain Monte Carlo* (MCMC) algorithm * Bring Bayesian back to the main stream of statistics ] ??? Image credit: [Wikimedia Commons](https://commons.wikimedia.org/wiki/File:Alan_Turing_Aged_16.jpg) --- ## Why Should You Learn About the Bayesian Way? - Gigerenzer (2004): It is one tool of your statistical toolbox -- - Increasingly used as alternative to frequentist statistics -- - Computationally more stable for complex models -- - A coherent way of incorporating prior information * Common sense knowledge, previous literature, sequential experiments, etc --- # Bayesian Idea 1 ### Reallocation of credibility across possibilities Hypothetical example: How effective is a vaccine? -- Prior (before collecting data) .pull-left[ <img src="intro_files/figure-html/vaccine-prior-1-1.png" width="90%" style="display: block; margin: auto;" /> ] .pull-left[ <img src="intro_files/figure-html/vaccine-prior-2-1.png" width="90%" style="display: block; margin: auto;" /> ] --- # Updating Beliefs After seeing results of a trial - 4/5 with the vaccince improved - 2/5 without the vaccine improved -- .pull-left[ <img src="intro_files/figure-html/vaccine-posterior-1-1.png" width="90%" style="display: block; margin: auto;" /> ] .pull-right[ <img src="intro_files/figure-html/vaccine-posterior-2-1.png" width="90%" style="display: block; margin: auto;" /> ] --- # Possibilities = Parameter Values - Parameter: Effectiveness of the vaccine - Possibilities: Not effective, mildly effective, very effective > Here the parameter is a discrete variable -- - Parameter: Risk reduction by taking the vaccine - Possibilities: `\((-\infty, \infty)\)` (Any real number) > Here the parameter is a continuous variable --- class: clear Using Bayesian analysis, one obtains updated/**posterior probability** for every possibility of a parameter, given the **prior** belief and the **data** <img src="intro_files/figure-html/bayes-three-curves-1.png" width="70%" style="display: block; margin: auto;" /> --- # Steps of Bayesian Data Analysis "Turning the Bayesian crank" 1. Identify data 2. Define a mathematical model with parameters 3. Specify priors on parameters 4. Obtain and interpret posterior distributions of the parameters 5. Posterior predictive check --- # Example Frank et al. (2019, Cognition and Emotion) - Response time for 2 (Dutch--native vs. English--foreign) `\(\times\)` 2 (lie vs. truth) experimental conditions <img src="intro_files/figure-html/p_int-1.png" width="70%" style="display: block; margin: auto;" /> --- # Posterior of Mean RTs by Conditions L = Lie, T = Truth; D = Dutch, E = English <img src="intro_files/figure-html/pp_cond-1.png" width="70%" style="display: block; margin: auto;" /> --- # From Priors to Posteriors <img src="intro_files/figure-html/hypothesis-1.png" width="55%" style="display: block; margin: auto;" /> --- class: clear .pull-left[ ### Accepting the Null ] .pull-right[ <img src="intro_files/figure-html/mcmc_diff-1.png" width="100%" style="display: block; margin: auto;" /> ] -- ### Posterior Predictive Check <img src="intro_files/figure-html/pp_dens-1.png" width="60%" style="display: block; margin: auto;" /> --- # Multiple Experiments .footnote[ Kay, Nelson, & Hekler (2016, p. 4525, https://dl.acm.org/doi/abs/10.1145/2858036.2858465) ] --- class: inverse, mline, center, middle # Syllabus --- class: inverse, mline, center, middle # Homework 1