an introduction to bayesian statistics

50
An Introduction to Bayesian Statistics Paul Herendeen April 2013

Upload: john-tyndall

Post on 01-Nov-2014

314 views

Category:

Education


4 download

DESCRIPTION

test presentation

TRANSCRIPT

Page 1: An introduction to bayesian statistics

An Introduction to

Bayesian Statistics

Paul HerendeenApril 2013

Page 2: An introduction to bayesian statistics

1960 1970 1980 1990 2000 20100

2000

4000

6000

8000WOS "Bayesian"Citations by Year

The rise of Bayesian statistics

Page 3: An introduction to bayesian statistics

So…What are Bayesian Statistics?

Page 4: An introduction to bayesian statistics

So…What are Bayesian Statistics?

1) A fundamentally different approach to probability

Page 5: An introduction to bayesian statistics

So…What are Bayesian Statistics?

1) A fundamentally different approach to probability

2) An associated set of mathematical tools

Page 6: An introduction to bayesian statistics

Frequentists vs. BayesianRound 1

Parameters fixed

Data varies

Data fixed

Parameters Vary

Page 7: An introduction to bayesian statistics

Frequentists vs. BayesianRound 1

Probability

Likelihood

Page 8: An introduction to bayesian statistics

Frequentists vs. BayesianRound 1

Confidence Interval

Credible Interval

Page 9: An introduction to bayesian statistics

Conditional Probability in 2 minutes

Page 10: An introduction to bayesian statistics

Conditional Probability in 2 minutes

All possible outcomes

Page 11: An introduction to bayesian statistics

Conditional Probability in 2 minutes

red blue

𝑃 (𝑅 ,𝐵 )=?

Page 12: An introduction to bayesian statistics

Conditional Probability in 2 minutes

red blue

𝑃 (𝑅 ,𝐵 )=¿𝑃 (𝑅 ) 𝑃 (𝐵 )

Page 13: An introduction to bayesian statistics

Conditional Probability in 2 minutes

red blue

𝑃 (𝐵|𝑅 )=¿𝑃 (𝐵 ,𝑅 )𝑃 (𝑅)  

Page 14: An introduction to bayesian statistics

Conditional Probability in 2 minutes

red blue

𝑃 (𝑅|𝐵 )= 𝑃 (𝐵|𝑅 )𝑃 (𝑅 )𝑃 (𝐵)

Page 15: An introduction to bayesian statistics

Conditional Probability in 2 minutes

red blue

𝑃 (𝑅|𝐵 )= 𝑃 (𝐵|𝑅 )𝑃 (𝑅 )𝑃 (𝐵)

Page 16: An introduction to bayesian statistics

Bayes’ Theorem

𝑃 (𝜃|𝐷 )= 𝑃 (𝐷|𝜃 ) 𝑃 (𝜃 )

∫𝑃 (𝐷|𝜃 ) 𝑃 (𝜃)

Page 17: An introduction to bayesian statistics

Bayes’ Theorem

𝑃 (𝜃|𝐷 )= 𝑃 (𝐷|𝜃 ) 𝑃 (𝜃 )𝑃 (𝐷)

Prior

Page 18: An introduction to bayesian statistics

Bayes’ Theorem

𝑃 (𝜃|𝐷 )= 𝑃 (𝐷|𝜃 ) 𝑃 (𝜃 )𝑃 (𝐷)

Likelihood

Prior

Page 19: An introduction to bayesian statistics

Bayes’ Theorem

𝑃 (𝜃|𝐷 )= 𝑃 (𝐷|𝜃 ) 𝑃 (𝜃 )𝑃 (𝐷)

Likelihood

Prior

Evidence

Page 20: An introduction to bayesian statistics

Bayes’ Theorem

𝑃 (𝜃|𝐷 )= 𝑃 (𝐷|𝜃 ) 𝑃 (𝜃 )𝑃 (𝐷)

Likelihood

Prior

Posterior

Evidence

Page 21: An introduction to bayesian statistics

Frequentist vs. BayesianRound 2

“The Strength of the Prior”

Page 22: An introduction to bayesian statistics

𝑃 (𝜃|𝐷 )= 𝑃 (𝜃 )𝑃 (𝐷|𝜃 )𝑃 (𝐷)

Sparse Data

Page 23: An introduction to bayesian statistics

𝑃 (𝜃|𝐷 )= 𝑃 (𝜃 )𝑃 (𝐷|𝜃 )𝑃 (𝐷)

Abundant Data

Page 24: An introduction to bayesian statistics

𝑃 (𝜃|𝐷 )= 𝑃 (𝜃 )𝑃 (𝐷|𝜃 )𝑃 (𝐷)

Uniform Prior

Page 25: An introduction to bayesian statistics

Where do Priors Come From?

Page 26: An introduction to bayesian statistics

So…What are Bayesian Statistics?

1) A fundamentally different approach to probability

2) An associated set of mathematical tools

𝑃 (𝜃|𝐷 )= 𝑃 (𝐷|𝜃 )𝑃 (𝜃 )

∫𝑃 (𝐷|𝜃 ) 𝑃 (𝐷)

Page 27: An introduction to bayesian statistics

How do you actually do this?

Page 28: An introduction to bayesian statistics

So how do you actually do this?

1.Analytical methods

Page 29: An introduction to bayesian statistics

So how do you actually do this?

1.Analytical methods

2.Grid approximation

Page 30: An introduction to bayesian statistics

So how do you actually do this?

1.Analytical methods

2.Grid approximation

3.Markov Chain Monte Carlo

Page 31: An introduction to bayesian statistics

MCMC• Algorithm for exploring parameter

space

Page 32: An introduction to bayesian statistics

MCMC• Algorithm for exploring parameter

space1.Pick a starting point

Page 33: An introduction to bayesian statistics

MCMC• Algorithm for exploring parameter

space1.Pick a starting point2.Propose a move

Page 34: An introduction to bayesian statistics

MCMC• Algorithm for exploring parameter

space1.Pick a starting point2.Propose a move3.Accept or decline move based on

probability

Page 35: An introduction to bayesian statistics

MCMC• Algorithm for exploring parameter

space1.Pick a starting point2.Propose a move3.Accept or decline move based on

probability• Time spent at each point

approximates parameter distribution

Page 36: An introduction to bayesian statistics

MCMC• Algorithm for exploring parameter space

1.Pick a starting point2.Propose a move3.Accept or decline move based on

probability• Time spent at each point approximates

parameter distribution• E.g. Metropolis-Hastings, Gibbs

sampling

Page 37: An introduction to bayesian statistics

MCMC2D example

Page 38: An introduction to bayesian statistics

MCMC2D example

Page 39: An introduction to bayesian statistics

So what does all this get us?

Page 40: An introduction to bayesian statistics

Bayesian methods really shine in complex (hierarchical) models…

Page 41: An introduction to bayesian statistics

For example,

IndividualFecundity

Group Effect

Population Effect

Foraging success

Environment

Page 42: An introduction to bayesian statistics

or…

Individual Fecundity

Group Effect

Population Effect

Environment

Page 43: An introduction to bayesian statistics

Many benefits to this approach

• Simultaneously estimate parameters• …as well as parameter relationships• “Borrow” strength across studies• Model comparison

Page 44: An introduction to bayesian statistics

So, is it a Bayesian Revolution?

Page 45: An introduction to bayesian statistics

Bayesian stats can do most things

frequentist,

Page 46: An introduction to bayesian statistics

Bayesian stats can do most things

frequentist, but…• Many simple models don’t gain

much• Better do something ‘boring’

well than something exciting poorly

Page 47: An introduction to bayesian statistics

Bayesian stats can do most things

frequentist, but…• Many simple models don’t gain

much• Better do something ‘boring’

well than something exciting poorly

• Don’t be this guy

Page 48: An introduction to bayesian statistics

DO use Bayesian methods if

• You have a complex model with many interacting parameters

• You have ‘messy’ data• You don’t want to make

assumptions about distributions

Page 49: An introduction to bayesian statistics

In Conclusion• Bayesian methods are powerful

tools for ecological research • Like most things statistical, they

are no substitute for thinking• They are here to stay, and you

should at least be familiar with them

Page 50: An introduction to bayesian statistics

Great, I want to learn more!

JAGS(Just Another Gibbs Sampler)