Processing math: 100%
+ - 0:00:00
Notes for current slide
Notes for next slide

Being a Basic Bayesian

EDP 619 Week 9

Dr. Abhik Roy

1 / 26
2 / 26

Note

3 / 26

Note

We are going to try to keep this as light as possible, but you will to think outside of your traditional training. For most of you, you'll likely see this as a new way of thinking and may even appear to be counterintuitive - however you may find this idea of iterative refining of one's beliefs is a fundamental principle of being human

If you are interested in learning more about the statistics, here is an absolutely biased selection of texts you may want to look at. While both employ R, the one on the right uses it significantly less than the text sitting on the left.

3 / 26

Note

We are going to try to keep this as light as possible, but you will to think outside of your traditional training. For most of you, you'll likely see this as a new way of thinking and may even appear to be counterintuitive - however you may find this idea of iterative refining of one's beliefs is a fundamental principle of being human

If you are interested in learning more about the statistics, here is an absolutely biased selection of texts you may want to look at. While both employ R, the one on the right uses it significantly less than the text sitting on the left.


3 / 26

Note

We are going to try to keep this as light as possible, but you will to think outside of your traditional training. For most of you, you'll likely see this as a new way of thinking and may even appear to be counterintuitive - however you may find this idea of iterative refining of one's beliefs is a fundamental principle of being human

If you are interested in learning more about the statistics, here is an absolutely biased selection of texts you may want to look at. While both employ R, the one on the right uses it significantly less than the text sitting on the left.



As of this writing, both texts are available as ebooks through WVU Libraries. Please click on the images above to access them
3 / 26

Bayesian Inference

Bayes' theorem in neon lights at the office of a software company in Cambridge, England

4 / 26

The Idea

  1. Begin with

    a hypothesis

    a degree of belief (in the hypothesis)

    So based on domain expertise or prior knowledge, we assign a non-zero probability to that hypothesis

  2. Then

    gather data

    Collection is probability based and done without a purpose

  3. Finally

    update our initial beliefs (if needed)

    If the data supports the hypothesis then the probability goes up, and if not then it goes down. Then recursively begin the cycle again with the updated probabilities

5 / 26

The Idea

  1. Begin with

    a hypothesis

    a degree of belief (in the hypothesis)

    So based on domain expertise or prior knowledge, we assign a non-zero probability to that hypothesis

  2. Then

    gather data

    Collection is probability based and done without a purpose

  3. Finally

    update our initial beliefs (if needed)

    If the data supports the hypothesis then the probability goes up, and if not then it goes down. Then recursively begin the cycle again with the updated probabilities





Bayes' theorem in neon lights at the office of a software company in Cambridge, England

5 / 26

Getting A Different Perspective

6 / 26

Getting A Different Perspective

Is your understanding of conditional probability a bit fuzzy or possibly even non existent? That is understandable - you probably took statistics from a frequentist, that's ok! Take a look at the two videos from the wonderful series Crash Course Statistics. I'm 95% sure you won't regret it!

6 / 26

Hopefully Some Review

7 / 26

Hopefully Some Review


P(AandB)means the probability ofAandBhappening

7 / 26

Hopefully Some Review


P(AandB)means the probability ofAandBhappening

P(A|B)means the probability ofAhappening ifBhappens

7 / 26

Hopefully Some Review


P(AandB)means the probability ofAandBhappening

P(A|B)means the probability ofAhappening ifBhappens


P(AandB)=P(BandA)

7 / 26

Hopefully Some Review


P(AandB)means the probability ofAandBhappening

P(A|B)means the probability ofAhappening ifBhappens


P(AandB)=P(BandA)

P(A|B)P(B|A)

7 / 26

Hopefully Some Review


P(AandB)means the probability ofAandBhappening

P(A|B)means the probability ofAhappening ifBhappens


P(AandB)=P(BandA)

P(A|B)P(B|A)


As long as both events happen, we DO NOT care about the order

7 / 26

Hopefully Some Review


P(AandB)means the probability ofAandBhappening

P(A|B)means the probability ofAhappening ifBhappens


P(AandB)=P(BandA)

P(A|B)P(B|A)


As long as both events happen, we DO NOT care about the order

One event relies on the other happening so we ABSOLUTELY care about the order

7 / 26

And Some More Review

8 / 26

And Some More Review



P(AandB)

has a standard formula regardless
if they are dependent or independent
8 / 26

And Some More Review



P(AandB)

has a standard formula regardless
if they are dependent or independent


P(AandB)=P(B|A)P(A)

8 / 26

And Some More Review



P(AandB)

has a standard formula regardless
if they are dependent or independent


P(AandB)=P(B|A)P(A)



P(B)

is the average
probability of a positive test result1
8 / 26

And Some More Review



P(AandB)

has a standard formula regardless
if they are dependent or independent


P(AandB)=P(B|A)P(A)



P(B)

is the average
probability of a positive test result1


P(B)=P(AandB)+P(B|¬A)(1P(A))

1 ¬A is one of many ways to write shorthand for the statement NOT A. In an absolutely non confusing way, you may also see variants like A˜A,  or ¯A just to name a few that all denote the same
   thing

8 / 26

Labels

Now that we have some understanding of what the parts of Bayes' Theorem are, let's take a look at the names of each




Bayes' theorem in neon lights at the office of a software company in Cambridge, England

9 / 26

More about P(A|B)P(B|A)


P(A|B)=P(AandB)P(B)

10 / 26

More about P(A|B)P(B|A)


P(A|B)=P(AandB)P(B)

P(B|A)=P(BandA)P(A)

10 / 26

More about P(A|B)P(B|A)


P(A|B)=P(AandB)P(B)

P(B|A)=P(BandA)P(A)



Some Algebra!


10 / 26

More about P(A|B)P(B|A)


P(A|B)=P(AandB)P(B)

P(B|A)=P(BandA)P(A)



Some Algebra!



P(AandB)=P(A)P(B|A)

10 / 26

More about P(A|B)P(B|A)


P(A|B)=P(AandB)P(B)

P(B|A)=P(BandA)P(A)



Some Algebra!



P(AandB)=P(A)P(B|A)

P(BandA)=P(B)P(B|A)

10 / 26

Getting A Different Perspective

11 / 26

Getting A Different Perspective

Still a bit or all the way confused? Then try going through through this incredible video by Josh Starmer. Now I'm 98% sure you won't regret it!






11 / 26

Example

Shaun of the Dead gif

12 / 26

Screening

13 / 26

Screening

Let's say the chance of a test for infection coming back positive given a person was bitten by a zombie is P(+|zombie bite)=0.90

This is known as as test sensitivity
13 / 26

Screening

Let's say the chance of a test for infection coming back positive given a person was bitten by a zombie is P(+|zombie bite)=0.90

This is known as as test sensitivity

And the chance of a test for infection coming back negative
given a person was NOT bitten by a zombie is P(|NO zombie bite)=0.95

This is known as as test specificity
13 / 26

Screening

Let's say the chance of a test for infection coming back positive given a person was bitten by a zombie is P(+|zombie bite)=0.90

This is known as as test sensitivity

And the chance of a test for infection coming back negative
given a person was NOT bitten by a zombie is P(|NO zombie bite)=0.95

This is known as as test specificity




So based on the two pieces of information above we can say the following about
a test for infection coming back positive even though a person was NOT bitten by a zombie

P(+|NO zombie bite)=1P(|NO zombie bite)=10.95=0.05

13 / 26

Screening

Let's say the chance of a test for infection coming back positive given a person was bitten by a zombie is P(+|zombie bite)=0.90

This is known as as test sensitivity

And the chance of a test for infection coming back negative
given a person was NOT bitten by a zombie is P(|NO zombie bite)=0.95

This is known as as test specificity




So based on the two pieces of information above we can say the following about
a test for infection coming back positive even though a person was NOT bitten by a zombie

P(+|NO zombie bite)=1P(|NO zombie bite)=10.95=0.05

Remember that all test, especially medical tests have some error

13 / 26

Questions

14 / 26

Questions





Perspective of a person administering the test

Given a person was bitten by a zombie, what is
the probability that their test is positive?


P(+|zombie bite)=0.90
14 / 26

Questions





Perspective of a person administering the test

Given a person was bitten by a zombie, what is
the probability that their test is positive?


P(+|zombie bite)=0.90
Perspective of a person who is not infected

Given that their test is positive, what is
the probability that person was bitten by a zombie?


P(zombie bite|+)=?
14 / 26

Assumtions

15 / 26

Assumtions

Assume that for now zombies are pretty rare and represent only 0.1% of the population. This means that
P(zombie bite)=0.001












This is known as a prior
15 / 26

The Math

16 / 26

The Math

  1. From Bayes'theorem we have P(zombie bite|+)=P(zombie biteand+)P(+)



The numerator P(zombie biteand+)=P(zombie bite)P(+|zombie bite)=0.0010.90=0.0009
16 / 26

The Math

  1. From Bayes'theorem we have P(zombie bite|+)=P(zombie biteand+)P(+)



The numerator P(zombie biteand+)=P(zombie bite)P(+|zombie bite)=0.0010.90=0.0009


This follows P(AandB)=P(A)P(B|A)

16 / 26
The denominator P(+)=P(zombie biteand+)+P(+|NO zombie bite)(1P(zombie bite))=0.0009+0.05(10.0001)=0.5085
17 / 26
The denominator P(+)=P(zombie biteand+)+P(+|NO zombie bite)(1P(zombie bite))=0.0009+0.05(10.0001)=0.5085


The above follows P(B)=P(AandB)+P(B|¬A)(1P(A))

17 / 26
    2. We can take the previous values into Bayes' theorem to get P(zombie bite|+)=0.00090.05085=0.02
18 / 26
    2. We can take the previous values into Bayes' theorem to get P(zombie bite|+)=0.00090.05085=0.02

   implying that given a positive test result, there is only a 2% chance that they were bitten by a zombie

18 / 26

Does this seem counterintuitive?

19 / 26

Does this seem counterintuitive?

You are definitely not alone, but this silly example is indicative a pretty important result because it parallels the nature of many realistic testing contexts such as HIV and DNA testing, criminal profiling, and even your standard run of the mill statistical significance testing

19 / 26

Does this seem counterintuitive?

You are definitely not alone, but this silly example is indicative a pretty important result because it parallels the nature of many realistic testing contexts such as HIV and DNA testing, criminal profiling, and even your standard run of the mill statistical significance testing

Now for the time being, forget about the result that you may be dismissing as garbage and try to make sense think about why the probability was so low. After you come to conclusion or get stuck, move on

19 / 26

Considerations

20 / 26

Considerations

Whenever the condition of interest is very rare, having a test that finds all the true cases is still no guarantee that a positive result carries much information at all

20 / 26

Considerations

Whenever the condition of interest is very rare, having a test that finds all the true cases is still no guarantee that a positive result carries much information at all

Remember that zombies are pretty rare, only making up 0.1% of the population. As of this writing, there are about 7.93 billion people in the world. While 8 million zombies appears to be a lot, consider that in this scenario they would be spread out over the globe. Even if you restrict that number to the United States, the country alone has a population of about 333 million people making zombies about 2.4% of the total count of "people". or to put it another way, as of 2021 the number of zombies could almost equal the state population of Virginia

20 / 26

Considerations

Whenever the condition of interest is very rare, having a test that finds all the true cases is still no guarantee that a positive result carries much information at all

Remember that zombies are pretty rare, only making up 0.1% of the population. As of this writing, there are about 7.93 billion people in the world. While 8 million zombies appears to be a lot, consider that in this scenario they would be spread out over the globe. Even if you restrict that number to the United States, the country alone has a population of about 333 million people making zombies about 2.4% of the total count of "people". or to put it another way, as of 2021 the number of zombies could almost equal the state population of Virginia



But why?


20 / 26

Considerations

Whenever the condition of interest is very rare, having a test that finds all the true cases is still no guarantee that a positive result carries much information at all

Remember that zombies are pretty rare, only making up 0.1% of the population. As of this writing, there are about 7.93 billion people in the world. While 8 million zombies appears to be a lot, consider that in this scenario they would be spread out over the globe. Even if you restrict that number to the United States, the country alone has a population of about 333 million people making zombies about 2.4% of the total count of "people". or to put it another way, as of 2021 the number of zombies could almost equal the state population of Virginia



But why?


Well the reason may also seem counterintuitive but here you go:

most positive results are false positives, even when all the true positives are detected correctly
20 / 26

Considerations

Whenever the condition of interest is very rare, having a test that finds all the true cases is still no guarantee that a positive result carries much information at all

Remember that zombies are pretty rare, only making up 0.1% of the population. As of this writing, there are about 7.93 billion people in the world. While 8 million zombies appears to be a lot, consider that in this scenario they would be spread out over the globe. Even if you restrict that number to the United States, the country alone has a population of about 333 million people making zombies about 2.4% of the total count of "people". or to put it another way, as of 2021 the number of zombies could almost equal the state population of Virginia



But why?


Well the reason may also seem counterintuitive but here you go:

most positive results are false positives, even when all the true positives are detected correctly

Now through testing and larger samples, if the prior probability changes then there is a good chance that the narrative above also changes with it

20 / 26

A Probability Tree of the Zombie "Problem"

21 / 26

A Probability Tree of the Zombie "Problem"

%0 1->2 Zombie Bite 1->3 NO Zombie Bite 2->4 True Positive 2->5 False Negative 3->6 True Negative 3->7 False Positive 4->8 True Negative 5->9 True Negative 6->10 True Negative 7->11 True Negative 1 infection test 2 0.001 3 0.999 4 0.9 5 0.1 6 0.95 7 0.05 8 9e-04 9 1e-04 10 0.949 11 0.05
21 / 26

Is it perfect?

22 / 26

Is it perfect?

No! If someone has a prior of 0 or 1, then it doesn't matter what you do, statistically speaking their mind is not going to change!

22 / 26

Is it perfect?

No! If someone has a prior of 0 or 1, then it doesn't matter what you do, statistically speaking their mind is not going to change!

Also there are some issues with people's ability to use Bayesian approaches

Doing Bayesian Data Analysis Cover
22 / 26

Did You Know?

In 2005 John Ioannidis, a professor at the Stanford School of Medicine, published a very famous and highly controversial paper named Why Most Published Research Findings Are False. He used Bayes' Theorem to establish a weak basis, though one did not exist prior to his publication. His calculation led to a broader argument and warnings that have been for the most part accepted by the broader research community

23 / 26

If You Torture Data Long Enough, It Will Confess to Anything

If you're interested in a broader review of how most research is false but is worth doing anyway, take a look at the great video below


24 / 26

One Last Thing About Bayes

We barely scratched the surface of Bayesian thinking. Unfortunately it is underutilized in the social sciences and education and that will become an issue as areas such as machine learning and the data sciences in general become prevalent. If you find this area interesting, I am happy to point you to resources that may be useful. In the meantime, you may wish to take a look at the papers below by hovering over the pills







Read More!

Aczel et al. (2020)

Paper
Read More!

Kruschke (2010)

Paper
25 / 26

Thats it!

If you have any questions, please reach out

26 / 26

Thats it!

If you have any questions, please reach out














Creative Commons License

This work is licensed under a
Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License
26 / 26
2 / 26
Paused

Help

Keyboard shortcuts

, , Pg Up, k Go to previous slide
, , Pg Dn, Space, j Go to next slide
Home Go to first slide
End Go to last slide
Number + Return Go to specific slide
b / m / f Toggle blackout / mirrored / fullscreen mode
c Clone slideshow
p Toggle presenter mode
t Restart the presentation timer
?, h Toggle this help
oTile View: Overview of Slides
Esc Back to slideshow