an introduction to jasp and bayesian statistics · an introduction to jasp and bayesian statistics...

Post on 11-Jul-2020

14 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

An Introduction to JASP and Bayesian StatisticsTim Draws, University of Amsterdam

Once Upon a Time…

EJ Wagenmakers

Fast Forward to Today

3 Key Features of JASP

1. Free: fully open-source

2. Friendly: easy-to-use & intuitive GUI

3. Flexible: allows for classical (frequentist) & Bayesian analyses

My Goals for Today

• For you to experience the possibilities that JASP has to offer

• For you to grasp the process of Bayesian inference and understand the meaning behind its main concepts

• For you to do statistics and have fun at the same time (it is possible)!

The Plan

1. Exploring JASP and its possibilities

2. The basic idea of Bayesian statistics

3. Bayesian parameter estimation

4. Bayesian hypothesis testing

The Plan

1. Exploring JASP and its possibilities

2. The basic idea of Bayesian statistics

3. Bayesian parameter estimation

4. Bayesian hypothesis testing

The Plan

1. Exploring JASP and its possibilities

2. The basic idea of Bayesian statistics

3. Bayesian parameter estimation

4. Bayesian hypothesis testing

The Origin of Science

Plato: All knowledge is in our thoughts. We can reason our way towards it.

Aristotle: We have to observe the world in order to find out truths.

We Still Use Aristotle’s Reasoning

The Basic Idea of Bayesian Statistics

Basic assumption: Reasoning under uncertainty adheres to the rules of probability theory.

• Bayesian statistics aims to quantify the uncertainty surrounding our inference.

• Prior beliefs are updated by means of the data to yield posterior beliefs.

• Belief updates are governed by predictive success. Does the data confirm or prior knowledge or not?

Bayesian Inductive Cycle

The Plan

1. Exploring JASP and its possibilities

2. The basic idea of Bayesian statistics

3. Bayesian parameter estimation

4. Bayesian hypothesis testing

Parameter Estimation

What‘s the bike situation here?

Amsterdam São Paulo?

! = The true proportion of São Paulo Residents who own a bycicle.

Frequentist Parameter Estimation

Frequentists consider ! to be a fixed but unknown quantity that can be approximated by using different samples from a population.

Frequentists say: If we were to do this experiment over an over again, in 95% of cases the confidence interval would include the true !.

Bayesian Parameter Estimation

Bayesians treat parameters as random variables that can be describedwith a probability distribution.

Bayesian Parameter Estimation

• When estimating parameters, our prior beliefs are reflected in theprior distribu*on.

• Beliefs are then updated by the predictive updating factor.• The update yields the posterior distribution.

! " #$%$ = ! #$%$ "! #$%$ ∗ ! "

(posterior = predictive updating factor * prior)

Bayesian Parameter Estimation

Bayesian Parameter Estimation

Let‘s estimate the proportion of São Paulo Residents who own a bike!

Amsterdam São Paulo?

Go to resource (2): A First Lesson in Bayesian Inference(https://tellmi.psy.lmu.de/felix/BayesLessons/BayesianLesson1.Rmd)

The Plan

1. Exploring JASP and its possibilities

2. The basic idea of Bayesian statistics

3. Bayesian parameter estimation

4. Bayesian hypothesis testing

Frequentist Hypothesis Testing1. Formulate hypotheses (e.g., H0 and H1)2. Collect data3. Calculate the p-value 4. If p < 0.05: We have found an effect!

If p > 0.05: We have not found an effect.

Problem: The p-value is the probability of obtaining the observed data, or something more extreme, given that H0 is true.

The p-value does not tell us anything about how likely it is that a hypothesis is true. (However, this is mostly what we are interested in.)

Bayesian Hypothesis TestingThe central question in Bayesian Hypothesis Testing: Which of the hypotheses is better supported by the data?

Answer: The model that predicted the data best!

The ratio of predictive performance is known as the Bayes factor.

Bayesian Hypothesis Testing! "1 #$%$! "0 #$%$

= ! #$%$ "1! #$%$ "0

∗ P H1P H0

posterior model odds = Bayes factor * prior model odds

Example:

41 =

41 ∗

11

BF10 = 4(The data are 4 times more likely to occur under H1

than under H0.)

Bayesian Hypothesis TestingWe can flip the Bayes factor fraction in order to quantify evidence in favor of H0:

! "#$# %1! "#$# %0

= '( BF10 = 4

! "#$# %0! "#$# %1

= (' BF01 = ('

Both of these Bayes factors convey the exact same thing: The data are 4 times more likely to occur under H1 than under H0.

Bayesian Hypothesis TestingInterpreting strength of evidence: What does the Bayes factor tell us?

BF Evidence

1-3 Anecdotal3-10 Moderate10-30 Strong30-100 Very strong100+ Extreme

Harold Jeffreys

Bayesian Hypothesis TestingInterpreting strength of evidence: What does the Bayes factor tell us?

BF10 = 4 (Odds of 4:1 in favor of H1)BF01 = ¼ (Odds of 1:4 in favor of H0)

Spin the wheel! How surprised are you when the arrow lands on the smaller part?

" #$%$ &1

" #$%$ &0

Bayesian Hypothesis TestingInterpreting strength of evidence: What does the Bayes factor tell us?

BF10 = 32 (Odds of 32:1 in favor of H1)BF01 = !"# (Odds of 1:32 in favor of H0)

$ %&'& (1

$ %&'& (0

Bayesian Hypothesis TestingBack to our previous example: Which of the hypotheses is better supported by the data?

In Germany, 75% of people own a bike. Is it the same in Brazil?

H0: 75% of Brazilians have a bike. (! = 0.75)H1: A different proportion of Brazilians have a bike. (! ≠ 0.75)

Any Questions?

You can find all workshop materials at https://jasp-stats.org/usp-workshop

top related