56
Welcome to Amsterdam!

Welcome to Amsterdam!

  • Upload
    addo

  • View
    36

  • Download
    0

Embed Size (px)

DESCRIPTION

Welcome to Amsterdam!. Welcome to Amsterdam!. Bayesian Modeling for Cognitive Science: A WinBUGS Workshop. Contributors. Michael Lee http://www.socsci.uci.edu/~mdlee/. Contributors. Dora Matzke http://dora.erbe-matzke.com/. Contributors. Ruud Wetzels http://www.ruudwetzels.com/. - PowerPoint PPT Presentation

Citation preview

Page 1: Welcome to Amsterdam!

Welcome to Amsterdam!

Page 2: Welcome to Amsterdam!

Welcome to Amsterdam!

Page 3: Welcome to Amsterdam!

Bayesian Modeling for Cognitive Science: A WinBUGS Workshop

Page 4: Welcome to Amsterdam!

Contributors

Michael Leehttp://www.socsci.uci.edu/~mdlee/

Page 5: Welcome to Amsterdam!

Contributors

Dora Matzkehttp://dora.erbe-matzke.com/

Page 6: Welcome to Amsterdam!

Contributors

Ruud Wetzelshttp://www.ruudwetzels.com/

Page 7: Welcome to Amsterdam!

Contributors

EJ Wagenmakershttp://www.ejwagenmakers.com/

Page 8: Welcome to Amsterdam!

Assistants

Don van Ravenzwaaijhttp://www.donvanravenzwaaij.com

Page 9: Welcome to Amsterdam!

Assistants

Gilles Dutilhhttp://gillesdutilh.com/

Page 10: Welcome to Amsterdam!

Assistants

Helen Steingröver

Page 11: Welcome to Amsterdam!

Why We Like Bayesian Modeling

It is fun. It is cool. It is easy. It is principled. It is superior. It is useful. It is flexible.

Page 12: Welcome to Amsterdam!

Our Goals This Week Are…

For you to experience some of the possibilities that WinBUGS has to offer.

For you to get some hands-on training by trying out some programs.

For you to work at your own pace. For you to get answers to questions when

you get stuck.

Page 13: Welcome to Amsterdam!

Our Goals This WeekAre NOT…

For you to become a Bayesian graphical modeling expert in one week.

For you to gain deep insight in the statistical foundations of Bayesian inference.

For you to get frustrated when the programs do not work or you do not understand the materials (please ask questions).

Page 14: Welcome to Amsterdam!

Logistics

You should now have the course book, information on how to get wireless access, and a USB stick. The stick contains a pdf of the book and the computer programs.

Page 15: Welcome to Amsterdam!

Logistics

Brief plenary lectures are at 09:30 and 14:00. All plenary lectures are in this room. All practicals are in the computer rooms on

the next floor. Coffee and tea are available in the small

opposite the computer rooms.

Page 16: Welcome to Amsterdam!

What is Bayesian Inference?Why be Bayesian?

Page 17: Welcome to Amsterdam!

What is Bayesian Inference?

Page 18: Welcome to Amsterdam!

What is Bayesian Inference?

“Common sense expressed in numbers”

Page 19: Welcome to Amsterdam!

What is Bayesian Inference?

“The only statistical procedure that is coherent, meaning that it avoids statements

that are internally inconsistent.”

Page 20: Welcome to Amsterdam!

What is Bayesian Inference?

“The only good statistics”

Page 21: Welcome to Amsterdam!

Outline

Bayes in a Nutshell The Bayesian Revolution This Course

Page 22: Welcome to Amsterdam!

Bayesian Inferencein a Nutshell

In Bayesian inference, uncertainty or degree of belief is quantified by probability.

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

Page 23: Welcome to Amsterdam!

Bayesian Parameter Estimation: Example

We prepare for you a series of 10 factual questions of equal difficulty.

You answer 9 out of 10 questions correctly. What is your latent probability θ of

answering any one question correctly?

Page 24: Welcome to Amsterdam!

Bayesian Parameter Estimation: Example

We start with a prior distribution for θ. This reflect all we know about θ prior to the experiment. Here we make a standard choice and assume that all values of θ are equally likely a priori.

Page 25: Welcome to Amsterdam!

Bayesian Parameter Estimation: Example

We then update the prior distribution by means of the data (technically, the likelihood) to arrive at a posterior distribution.

The posterior distribution is a compromise between what we knew before the experiment and what we have learned from the experiment. The posterior distribution reflects all that we know about θ.

Page 26: Welcome to Amsterdam!

Mode = 0.9

95% confidence interval: (0.59, 0.98)

Page 27: Welcome to Amsterdam!

Outline

Bayes in a Nutshell The Bayesian Revolution This Course

Page 28: Welcome to Amsterdam!

The Bayesian Revolution

Until about 1990, Bayesian statistics could only be applied to a select subset of very simple models.

Only recently, Bayesian statistics has undergone a transformation; With current numerical techniques, Bayesian models are “limited only by the user’s imagination.”

Page 29: Welcome to Amsterdam!

The Bayesian Revolutionin Statistics

Page 30: Welcome to Amsterdam!

The Bayesian Revolutionin Statistics

Page 31: Welcome to Amsterdam!

Why Bayes is Now Popular

Markov chain Monte Carlo!

Page 32: Welcome to Amsterdam!

Markov Chain Monte Carlo

Instead of calculating the posterior analytically, numerical techniques such as MCMC approximate the posterior by drawing samples from it.

Consider again our earlier example…

Page 33: Welcome to Amsterdam!
Page 34: Welcome to Amsterdam!

Mode = 0.89

95% confidence interval: (0.59, 0.98)

With 9000 samples, almost identical toanalytical result.

Page 35: Welcome to Amsterdam!
Page 36: Welcome to Amsterdam!

Want to Know MoreAbout MCMC?

Page 37: Welcome to Amsterdam!

MCMC

With MCMC, the models you can build and estimate are said to be “limited only by the user’s imagination”.

But how do you get MCMC to work? Option 1: write the code it yourself. Option 2: use WinBUGS!

Page 38: Welcome to Amsterdam!

Outline

Bayes in a Nutshell The Bayesian Revolution This Course

Page 39: Welcome to Amsterdam!

Bayesian Cognitive Modeling:A Practical Course

…is a course book under development, used at several universities.

…is still regularly updated. …will eventually be published by Cambridge

University Press. …greatly benefits from your suggestions for

improvement! [e.g., typos, awkward sentences, new exercises, new applications, etc.]

Page 40: Welcome to Amsterdam!

…requires you to run computer code. Do not mindlessly copy-paste the code, but study it first, and try to discover why it does its job.

…did not print very well (i.e., the quality of some of the pictures is below par). You will receive a better version tomorrow!

Bayesian Cognitive Modeling:A Practical Course

Page 41: Welcome to Amsterdam!

WinBUGS

Bayesian inference Using

Gibbs Sampling

You want to have thisinstalled (plus the registration key)

Page 42: Welcome to Amsterdam!

WinBUGS

Knows many probability distributions (likelihoods);

Allows you to specify a model; Allows you to specify priors; Will then automatically run the MCMC

sampling routines and produce output.

Page 43: Welcome to Amsterdam!

WinBUGS knows many statistical distributions (e.g., the binomial distribution,

the Gaussian distribution, the Poisson distribution). These distributions form the

elementary building blocks from which you may construct infinitely many models.

Page 44: Welcome to Amsterdam!
Page 45: Welcome to Amsterdam!
Page 46: Welcome to Amsterdam!
Page 47: Welcome to Amsterdam!
Page 48: Welcome to Amsterdam!

WinBUGS & R

WinBUGS produces MCMC samples. We want to analyze the output in a nice

program, such as R or Matlab. This can be accomplished using the R

package “R2WinBUGS”, or the Matlab function “matbugs”.

Page 49: Welcome to Amsterdam!

R: “Here are the data and abunch of commands”

WinBUGS: “OK, I did what you wanted, here’s the samples you asked for”

Page 50: Welcome to Amsterdam!

Matlab: “Here are the data and abunch of commands”

WinBUGS: “OK, I did what you wanted, here’s the samples you asked for”

Page 51: Welcome to Amsterdam!

Getting Started

Work through some of the exercises of the book.

Most of you will want to get started with the chapter “getting started”.

For those of you who have worked with the book before, you can start wherever you want. Note that most early chapters have been restructured (and new content was added).

Page 52: Welcome to Amsterdam!

Running the R programs

The R scripts have extension .R. You can use “File” -> “Open Script” to read these.

You can run these scripts by copying-and-pasting the scripts in the R console.

Page 53: Welcome to Amsterdam!

Saving Your Work

If you want to save your work, please do this on the USB stick!

Page 54: Welcome to Amsterdam!

WARNING

The first chapters are mostly about simple statistical models. This lays the groundwork for the later chapters on more complicated cognitive modeling.

The idea is that you have to walk before you can run.

Page 55: Welcome to Amsterdam!

Questions?

Feel free to ask questions when you are stuck.

Answers to the exercises for the first few chapters can be found at the end of the book!!

Page 56: Welcome to Amsterdam!

Inside every Non-Bayesian, there is a Bayesian

struggling to get out

Dennis Lindley