SlideShare a Scribd company logo
1 of 101
How
Bayesian inference
Works
Brandon Rohrer
Bayesian inference is not magic
Bayesian inference is not incomprehensible
What does “Bayesian inference” even mean?
Inference = Educated guessing
Thomas Bayes = A nonconformist Presbyterian
minister in London back when the United States
were still The Colonies.
He also wrote an essay on probability. His friend
Richard Price edited and published it after he
died.
Bayesian inference = Guessing in the style of
Bayes
Dilemma at the movies
This person dropped their ticket in
the hallway.
Do you call out
“Excuse me, ma’am!”
or
“Excuse me, sir!”
You have to make a guess.
Dilemma at the movies
What if they’re standing in line for
the men’s restroom?
Bayesian inference is a way to
capture common sense.
It helps you use what you know to
make better guesses.
Put numbers to our dilemma
Out of 100 men
at the movies
4 have
long hair
96 have
short hair
Out of 100 women
at the movies
50 have
long hair
50 have
short hair
Put numbers to our dilemma
4 have
long hair
96 have
short hair
50 have
long hair
50 have
short hair
About 12 times more women have long hair than men.
Out of 100 men
at the movies
Out of 100 women
at the movies
Put numbers to our dilemma
Out of 98 men
in line
4 have
long hair
94 have
short hair
Out of 2 women
in line
1 has
long hair
1 has
short hair
But there are 98 men and 2 women in line for the men’s restroom.
In the line, 4 times more men have long hair than women.
Put numbers to our dilemma
4 have
long hair
94 have
short hair
1 has
long hair
1 has
short hair
Out of 98 men
in line
Out of 2 women
in line
50 are men
2 men have long hair
48 men
have
short hair
50 are women
25 women
have
long hair
25 women
have
short hair
Out of 100 people
at the movies
98 are men
4 men have long hair
94 men
have
short hair
2 are
women
One
woman
has
long
hair
One
woman
has
short
hair
Out of 100 people
In line for the
men’s restroom
Translate to math
P(something) = # something / # everything
P(woman) = Probability that a person is a woman
= # women / # people
= 50 / 100 = .5
P(man) = Probability that a person is a man
= # men / # people
= 50 / 100 = .5
50 are men
50 are women
Out of 100 people
at the movies
P(something) = # something / # everything
P(woman) = Probability that a person is a woman
= # women / # people
= 2 / 100 = .02
P(man) = Probability that a person is a man
= # men / # people
= 98 / 100 = .98
98 are men
2 are
women
Out of 100 people
In line for the
men’s restroom
Translate to math
Conditional probabilities
P(long hair | woman)
If I know that a person is a woman, what is
the probability that person has long hair?
P(long hair | woman)
= # women with long hair / # women
= 25 / 50 = .5
50 are women
25 women
have
long hair
25 women
have
short hair
Out of 100 people
at the movies
2 are
women
One
woman
has
long
hair
One
woman
has
short
hair
Out of 100 people
In line for the
men’s restroom
Conditional probabilities
This doesn’t change when we consider
people in line.
P(long hair | woman)
= # women with long hair / # women
= 1 / 2 = .5
Conditional probabilities
If I know that a person is a man, what is the
probability that person has long hair?
P(long hair | man)
= # men with long hair / # men
= 2 / 50 = .04
Whether in line or not.
50 are men
2 men have long hair
48 men
have
short hair
Out of 100 people
at the movies
Conditional probabilities
P(A | B) is the probability of A, given B.
“If I know B is the case, what is the
probability that A is also the case?”
P(A | B) is not the same as P(B | A).
P(cute | puppy) is not the same as P(puppy | cute)
If I know the thing I’m holding is a puppy, what is the probability that it is cute?
If I know the the thing I’m holding is cute, what is the probability that it is a puppy?
Joint probabilities
What is the probability that a person is both
a woman and has short hair?
P(woman with short hair)
= P(woman) * P(short hair | woman)
= .5 * .5 = .25
P(man) = .5
P(woman) = .5
Out of probability of 1
P(woman with
short hair) = .25
Joint probabilities
P(woman with long hair)
= P(woman) * P(long hair | woman)
= .5 * .5 = .25
P(man) = .5
P(woman) = .5
Out of probability of 1
P(woman with
short hair) = .25
P(woman with
long hair) = .25
Joint probabilities
P(man with short hair)
= P(man) * P(short hair | man)
= .5 * .96 = .48
P(man) = .5
P(woman) = .5
Out of probability of 1
P(woman with
short hair) = .25
P(woman with
long hair) = .25
P(man with
short hair) = .48
Joint probabilities
P(man with long hair)
= P(man) * P(long hair | man)
= .5 * .04 = .02
P(man) = .5
P(woman) = .5
P(woman with
short hair) = .25
Out of probability of 1
P(woman with
long hair) = .25
P(man with
short hair) = .48
P(man with long
hair) = .02
Joint probabilities
If P(man) = .98 and P(woman) = .02,
then the answers change.
P(man with long hair)
= P(man) * P(long hair | man)
= .98 * .04 = .04
P(man) = .98
P(woman) = .02
P(woman
with short
hair) = .01
Out of probability of 1
P(woman
with long
hair) = .01
P(man with short hair) = .94
P(man with long hair) = .04
Joint probabilities
P(woman with long hair)
= P(woman) * P(long hair | woman)
= .02 * .5 = .01
P(man) = .98
P(woman) = .02
P(woman
with short
hair) = .01
Out of probability of 1
P(woman
with long
hair) = .01
P(man with short hair) = .94
P(man with long hair) = .04
Joint probabilities
P(A and B) is the probability that both A and B
are the case.
Also written P(A, B) or P(A ∩ B)
P(A and B) is the same as P(B and A)
The probability that I am having a jelly donut
with my milk is the same as the probability that
I am having milk with my jelly donut.
P(donut and milk) = P(milk and donut)
Marginal probabilities
P(long hair) = P(woman with long hair) +
P(man with long hair)
= .01 + .04 = .05
P(man) = .98
P(woman) = .02
P(woman
with short
hair) = .01
Out of probability of 1
P(woman
with long
hair) = .01
P(man with short hair) = .94
P(man with long hair) = .04
Marginal probabilities
P(short hair) = P(woman with short hair) +
P(man with short hair)
= .01 + .94 = .95
P(man) = .98
P(woman) = .02
P(woman
with short
hair) = .01
Out of probability of 1
P(woman
with long
hair) = .01
P(man with short hair) = .94
P(man with long hair) = .04
What we really care about
We know the person has long hair.
Are they a man or a woman?
P(man | long hair)
We don’t know this answer yet.
Thomas Bayes noticed something cool
P(man with long hair) = P(long hair) * P(man | long hair)
Thomas Bayes noticed something cool
P(man with long hair) = P(long hair) * P(man | long hair)
P(long hair and man) = P(man) * P(long hair | man)
Thomas Bayes noticed something cool
P(man with long hair) = P(long hair) * P(man | long hair)
P(long hair and man) = P(man) * P(long hair | man)
Because P(man and long hair) = P(long hair and man)
Thomas Bayes noticed something cool
P(man with long hair) = P(long hair) * P(man | long hair)
P(long hair and man) = P(man) * P(long hair | man)
Because P(man and long hair) = P(long hair and man)
P(long hair) * P(man | long hair) = P(man) * P(long hair | man)
Thomas Bayes noticed something cool
P(man with long hair) = P(long hair) * P(man | long hair)
P(long hair and man) = P(man) * P(long hair | man)
Because P(man and long hair) = P(long hair and man)
P(long hair) * P(man | long hair) = P(man) * P(long hair | man)
P(man | long hair) = P(man) * P(long hair | man) / P(long hair)
Thomas Bayes noticed something cool
P(man with long hair) = P(long hair) * P(man | long hair)
P(long hair and man) = P(man) * P(long hair | man)
Because P(man and long hair) = P(long hair and man)
P(long hair) * P(man | long hair) = P(man) * P(long hair | man)
P(man | long hair) = P(man) * P(long hair | man) / P(long hair)
P(A | B) = P(B | A) * P(A) / P(B)
Bayes’ Theorem
P(A | B) = P(B | A) P(A)
P(B)
Back to the movie theater, this time with Bayes
P(man | long hair) = P(man) * P(long hair | man)
P(long hair)
P(man) = .5
P(woman) = .5
P(long hair | woman) = .5
P(long hair | man) = .04
Back to the movie theater, this time with Bayes
P(man | long hair) = P(man) * P(long hair | man)
P(long hair)
= P(man) * P(long hair | man)
P(woman with long hair) + P(man with long hair)
P(man) = .5
P(woman) = .5
P(long hair | woman) = .5
P(long hair | man) = .04
Back to the movie theater, this time with Bayes
P(man | long hair) = P(man) * P(long hair | man)
P(long hair)
= P(man) * P(long hair | man)
P(woman with long hair) + P(man with long hair)
P(man | long hair) = .5 * .04 = .02 / .27 =
.07
.25 + .02
P(man) = .5
P(woman) = .5
P(long hair | woman) = .5
P(long hair | man) = .04
P(long hair | man) = .04
P(man) = .98
P(woman) = .02
Back to the movie theater, this time with Bayes
P(man | long hair) = P(man) * P(long hair | man)
P(long hair)
= P(man) * P(long hair | man)
P(woman with long hair) + P(man with long hair)
P(long hair | woman) = .5
P(long hair | man) = .04
P(man) = .98
P(woman) = .02
Back to the movie theater, this time with Bayes
P(man | long hair) = P(man) * P(long hair | man)
P(long hair)
= P(man) * P(long hair | man)
P(woman with long hair) + P(man with long hair)
P(man | long hair) = .98 * .04 = .04 / .05 =
.80
.01 + .04 P(long hair | woman) = .5
Probability distributions
Probability is like a pot with just one cup of coffee left in it.
Probability distributions
If you only have one cup, you can fill it completely.
100%
Probability distributions
If you have two cups, you have to decide how to share (distribute) it.
27%
73%
Probability distributions
Our people are distributed between two groups, women and men.
50%
50%
Women Men
Probability distributions
We can distribute them more.
2%
Women with
long hair
Men with
long hair
48%
25%
Women with
short hair
Men with
short hair
25%
Probability distributions
2%
Women with
long hair
Men with
long hair
48%
25%
Women with
short hair
Men with
short hair
25%
P(woman with
short hair) = .25
P(woman with
long hair) = .25
P(man with
short hair) = .48
P(man with long
hair) = .02
Probability distributions
2%
Women with
long hair
Men with
long hair
48%
25%
Women with
short hair
Men with
short hair
25%
Probability distributions
.02
Women with
long hair
Men with
long hair
.48
.25
Women with
short hair
Men with
short hair
.25
Probability distributions
.02
Women with
long hair
Men with
long hair
.48
.25
Women with
short hair
Men with
short hair
.25
It’s helpful to think of probabilities as beliefs
Probability
Probability distributions
Heads
.5
Tails
Flipping a fair coin
.5
Probability
Probability distributions
3
Rolling a fair die
.17
2
.17
1
.17
6
.17
5
.17
4
.17
Probability
Probability distributions
Lose
.000000001
Win
Playing for the Powerball jackpot
.99999999
Probability
Probability distributions
Height of adults in cm
<150
.06
150
to
160
.09
160
to
170
.17
170
to
180
.24
180
to
190
.28
190
to
200
.12
200
to
210
.03
>210
.01
Probability
205
to
210
185
to
190
165
to
170
Probability distributions
Height of adults in cm
<150
.06
150
to
155
.07
160
to
165
.05
170
to
175
.13
180
to
185
.16
190
to
195
.05
200
to
205
.01
>210
.01
155
to
160
175
to
180
195
to
200
.04
.10
.11
.12
.07
.02
Probability
200 210
Probability distributions
Height of adults in cm
Probability
150 160 170 180 190
Probability distributions
Height of adults in cm
Probability
200 210
150 160 170 180 190
Probability distributions
Height of adults in cm
Probability
200 210
150 160 170 180 190
Probability distributions
Height of adults in cm
150 160 170 180 190 200 210
Probability
Probability distributions
Height of adults in cm
150 160 170 180 190 200 210
Probability
Average
(mean)
Probability distributions
Height of adults in cm
150 160 170 180 190 200 210
Probability
Middle
(median)
Probability distributions
Height of adults in cm
150 160 170 180 190 200 210
Probability
Most common
(mode)
Weighing my dog
My dog is named Reign of Terror.
When we go to the veterinarian,
Reign squirms on the scale. Each
time we get a different weight
measurement.
13.9 lb
17.5 lb
14.1 lb
How much does she weigh?
Take the average.
mean = (13.9 + 17.5 + 14.1) / 3 = 15.2 lb
Calculate the standard deviation.
std dev = sqrt((13.9 - 15.1)^2 + (17.5 - 15.1)^2 + (14.1 - 15.1)^2) / 2 = 2.0 lb
Calculate the standard error.
std err = std dev / sqrt(3) = 1.16
How much does she weigh?
The estimate of the mean is a Normal distribution with a mean of 15.2 lb and a
standard deviation of 1.2 lb.
12 13 14 15 16 17 18
Probability
Reign’s weight in pounds
Bayes’ Theorem
P(A | B) = P(B | A) P(A)
P(B)
Bayes’ Theorem
P(w | m) = P(m | w) P(w)
P(m)
Bayes’ Theorem
P(w | m) = P(m | w) P(w)
P(m)
prior
Bayes’ Theorem
P(w | m) = P(m | w) P(w)
P(m)
likelihood
Bayes’ Theorem
P(w | m) = P(m | w) P(w)
P(m)
posterior
Bayes’ Theorem
P(w | m) = P(m | w) P(w)
P(m) marginal likelihood
Bayes’ Theorem
P(w) = uniform
Start with
Bayes’ Theorem
P(w | m) = P(m | w) C1
C2
Assumes that the mean of the weight is equally likely to be anything.
Bayes’ Theorem
P(w | m) = P(m | w)
P(w = 17 | m = [13.9, 14.1, 17.5]) = P(m = [13.9, 14.1, 17.5] | w = 17)
P(w | m) = P(m | w)
12 13 14 15 16 17 18
Probability
Reign’s weight in pounds
P(w = 17 | m = [13.9, 14.1, 17.5]) = P(m = [13.9, 14.1, 17.5] | w = 17)
= P(m = 13.9 | w = 17) * P(m = 14.1 | w = 17) * P(m = 17.5 | w =
17)
P(w | m) = P(m | w)
12 13 14 15 16 17 18
Probability
Reign’s weight in pounds
P(w = 17 | m = [13.9, 14.1, 17.5]) = P(m = [13.9, 14.1, 17.5] | w = 17)
= P(m = 13.9 | w = 17) * P(m = 14.1 | w = 17) * P(m = 17.5 | w =
17)
P(w | m) = P(m | w)
12 13 14 15 16 17 18
Probability
Reign’s weight in pounds
P(w = 17 | m = [13.9, 14.1, 17.5]) = P(m = [13.9, 14.1, 17.5] | w = 17)
= P(m = 13.9 | w = 17) * P(m = 14.1 | w = 17) * P(m = 17.5 | w =
17)
P(w | m) = P(m | w)
12 13 14 15 16 17 18
Probability
Reign’s weight in pounds
P(w = 16 | m = [13.9, 14.1, 17.5]) = P(m = [13.9, 14.1, 17.5] | w = 16)
= P(m = 13.9 | w = 16) * P(m = 14.1 | w = 16) * P(m = 17.5 | w =
16)
P(w | m) = P(m | w)
12 13 14 15 16 17 18
Probability
Reign’s weight in pounds
P(w = 16 | m = [13.9, 14.1, 17.5]) = P(m = [13.9, 14.1, 17.5] | w = 16)
= P(m = 13.9 | w = 16) * P(m = 14.1 | w = 16) * P(m = 17.5 | w =
16)
P(w | m) = P(m | w)
12 13 14 15 16 17 18
Probability
Reign’s weight in pounds
P(w = 15 | m = [13.9, 14.1, 17.5]) = P(m = [13.9, 14.1, 17.5] | w = 15)
= P(m = 13.9 | w = 15) * P(m = 14.1 | w = 15) * P(m = 17.5 | w =
15)
P(w | m) = P(m | w)
12 13 14 15 16 17 18
Probability
Reign’s weight in pounds
mean = 15.2 lb
Also known as a Maximum Likelihood Estimate (MLE)
P(w | m) = P(m | w)
12 13 14 15 16 17 18
Probability
Reign’s weight in pounds
What would Thomas do?
Start with what we know.
Reign was 14.2 lb the last time we
came in.
She doesn’t seem noticeably more
heavy to me.
I can start with a prior belief--a
bias toward what I think the
answer will be.
How much does she weigh?
My prior is a normal curve with a mean at 14.2 lb and a standard error of .5 lb.
12 13 14 15 16 17 18
Probability
Reign’s weight in pounds
How much does she weigh?
My prior is a normal curve with a mean at 14.2 lb and a standard error of .5 lb.
12 13 14 15 16 17 18
Probability
P(w)
Reign’s weight in pounds
Bayes’ Theorem
P(w | m) = P(m | w) P(w)
P(m)
This time I don’t neglect the P(w) term. I still assume the P(m) term is constant.
P(w = 17 | m = [13.9, 14.1, 17.5]) = P(m = [13.9, 14.1, 17.5] | w = 17)
= P(m = 13.9 | w = 17) *
P(m = 14.1 | w = 17) *
P(m = 17.5 | w = 17)
12 13 14 15 16 17 18
Probability
P(w)
P(w | m) = P(m | w) * P(w)
Reign’s weight in pounds
P(w = 17 | m = [13.9, 14.1, 17.5]) = P(m = [13.9, 14.1, 17.5] | w = 17) * P(w=17)
= P(m = 13.9 | w = 17) *
P(w=17) *
P(m = 14.1 | w = 17) * P(w=17) *
P(m = 17.5 | w = 17) * P(w=17)
P(w | m) = P(m | w) * P(w)
12 13 14 15 16 17 18
Probability
P(w)
Reign’s weight in pounds
P(w = 17 | m = [13.9, 14.1, 17.5]) = P(m = [13.9, 14.1, 17.5] | w = 17) * P(w=17)
= P(m = 13.9 | w = 17) *
P(w=17) *
P(m = 14.1 | w = 17) * P(w=17) *
P(m = 17.5 | w = 17) * P(w=17)
12 13 14 15 16 17 18
Probability
P(w)
P(m | w)
P(w | m) = P(m | w) * P(w)
Reign’s weight in pounds
P(w = 16 | m = [13.9, 14.1, 17.5]) = P(m = [13.9, 14.1, 17.5] | w = 16) * P(w=16)
= P(m = 13.9 | w = 16) *
P(w=16) *
P(m = 14.1 | w = 16) * P(w=16) *
P(m = 17.5 | w = 16) * P(w=16)
12 13 14 15 16 17 18
Probability
P(w)
P(m | w)
P(w | m) = P(m | w) * P(w)
Reign’s weight in pounds
P(w = 15 | m = [13.9, 14.1, 17.5]) = P(m = [13.9, 14.1, 17.5] | w = 15) * P(w=15)
= P(m = 13.9 | w = 15) *
P(w=15) *
P(m = 14.1 | w = 15) * P(w=15) *
P(m = 17.5 | w = 15) * P(w=15)
12 13 14 15 16 17 18
Probability
P(w)
P(m | w)
P(w | m) = P(m | w) * P(w)
Reign’s weight in pounds
P(w = 14 | m = [13.9, 14.1, 17.5]) = P(m = [13.9, 14.1, 17.5] | w = 14) * P(w=14)
= P(m = 13.9 | w = 14) *
P(w=14) *
P(m = 14.1 | w = 14) * P(w=14) *
P(m = 17.5 | w = 14) * P(w=14)
12 13 14 15 16 17 18
Probability
P(w)
P(m | w)
P(w | m) = P(m | w) * P(w)
Reign’s weight in pounds
Our new estimate of Reign’s weight, P(w | m), is a normal distribution with a mean
at about 14.1 lb and a std err of .4 lb.
Also known as Maximum A Posteriori (MAP).
12 13 14 15 16 17 18
Probability
P(w) P(w|m)
P(w | m) = P(m | w) * P(w)
Reign’s weight in pounds
The Bayesian estimate ignores 17.5 lb like an outlier.
The distribution is narrower. Confidence is greater.
The answer is probably much closer to correct.
12 13 14 15 16 17 18
Probability
Bayesian
estimate
Bayesian vs. not
non-Bayesian
estimate
Reign’s weight in pounds
Why we might want to use Bayesian inference
We know things
Age is more than zero
Temperature is greater than -273 Celsius
Height is probably less than 2.4 meters (8 feet)
Starting with a belief helps us get to a confident answer with fewer data points.
Why Bayesian inference makes us nervous
We’re not always aware of what we believe.
Putting what we believe into a distribution correctly is
tricky.
We want to be able to be surprised by our data.
Inaccurate beliefs can make it hard or impossible to learn.
“It ain't what you don't know that gets you into trouble.
It's what you know for sure that just ain't so.”
- Mark Twain
Believe the impossible, at least a little bit
Leave room for believing the unlikely. Leave a non-
zero probability unless you are absolutely certain.
“When you have excluded the impossible,
whatever remains, however improbable, must be
the truth”
- Sherlock Holmes (Sir Arthur Conan Doyle)
Believe the impossible, at least a little bit
"Alice laughed: "There's no use trying," she said; "one
can't believe impossible things."
"I daresay you haven't had much practice," said the
Queen. "When I was younger, I always did it for half an
hour a day. Why, sometimes I've believed as many as
six impossible things before breakfast."
- Lewis Carroll (Alice’s Adventures in Wonderland)
Questions?
Here’s how you can get in touch with me.
brohrer@gmail.com
Blog (Data Science and Robots)
LinkedIn
Twitter
YouTube
Facebook
GitHub
Link to these slides:
https://docs.google.com/presentation/d/1325yenZP_VdHoVj-tU0AnbQUxFwb8Fl1VdyAAUxEzfg/edit?usp=sharing
Acknowledgements
Businessman Consulting Glowing Crystal Ball, InfoWire.dk, Public domain
Equation images from The Conjugate Prior for the Normal Distribution, Michael I. Jordan, Teodor Mihai Moldovan, February 8 th, 2010
Portrait of an unknown 19th-century Presbyterian clergyman. Identified as Thomas Bayes, Public domain
Woman blond hair, face long hair laleyla5, pixabay, Public Domain
hairfreaky long hair, Creative Commons 2.0
Amber Rose at the "PEOPLE Magazine Awards”, Creative Commons Attribution-Share Alike 2.0 Generic
Neil Armstrong, Public Domain
A blond long-haired young lady-woman, "Mike" Michael L. Baird, Creative Commons Attribution 2.0 Generic
White Long Coated Puppy, Creative Commons Zero
Long Beach Comic & Horror Con 2011, Creative Commons 2.0
Donuts and milk, Creative Commons Zero
Photo of Reign of Terror, Diane Rohrer under Creative Commons Zero
Mark Twain, Public domain
Sherlock Holmes, Public domain
Red Queen with Alice, Public domain
How
Bayesian Inference
Works
by Brandon Rohrer
12 13 14 15 16 17 18
Probability
Bayesian
estimate
non-Bayesian
estimate
Weight in pounds
P(A | B) = P(B | A) P(A)
Bayesian
estimate
non-Bayesian
estimate

More Related Content

Recently uploaded

Temporomandibular joint Muscles of Mastication
Temporomandibular joint Muscles of MasticationTemporomandibular joint Muscles of Mastication
Temporomandibular joint Muscles of Masticationvidulajaib
 
Neurodevelopmental disorders according to the dsm 5 tr
Neurodevelopmental disorders according to the dsm 5 trNeurodevelopmental disorders according to the dsm 5 tr
Neurodevelopmental disorders according to the dsm 5 trssuser06f238
 
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.aasikanpl
 
zoogeography of pakistan.pptx fauna of Pakistan
zoogeography of pakistan.pptx fauna of Pakistanzoogeography of pakistan.pptx fauna of Pakistan
zoogeography of pakistan.pptx fauna of Pakistanzohaibmir069
 
Analytical Profile of Coleus Forskohlii | Forskolin .pptx
Analytical Profile of Coleus Forskohlii | Forskolin .pptxAnalytical Profile of Coleus Forskohlii | Forskolin .pptx
Analytical Profile of Coleus Forskohlii | Forskolin .pptxSwapnil Therkar
 
BIOETHICS IN RECOMBINANT DNA TECHNOLOGY.
BIOETHICS IN RECOMBINANT DNA TECHNOLOGY.BIOETHICS IN RECOMBINANT DNA TECHNOLOGY.
BIOETHICS IN RECOMBINANT DNA TECHNOLOGY.PraveenaKalaiselvan1
 
‏‏VIRUS - 123455555555555555555555555555555555555555
‏‏VIRUS -  123455555555555555555555555555555555555555‏‏VIRUS -  123455555555555555555555555555555555555555
‏‏VIRUS - 123455555555555555555555555555555555555555kikilily0909
 
Bentham & Hooker's Classification. along with the merits and demerits of the ...
Bentham & Hooker's Classification. along with the merits and demerits of the ...Bentham & Hooker's Classification. along with the merits and demerits of the ...
Bentham & Hooker's Classification. along with the merits and demerits of the ...Nistarini College, Purulia (W.B) India
 
Behavioral Disorder: Schizophrenia & it's Case Study.pdf
Behavioral Disorder: Schizophrenia & it's Case Study.pdfBehavioral Disorder: Schizophrenia & it's Case Study.pdf
Behavioral Disorder: Schizophrenia & it's Case Study.pdfSELF-EXPLANATORY
 
Twin's paradox experiment is a meassurement of the extra dimensions.pptx
Twin's paradox experiment is a meassurement of the extra dimensions.pptxTwin's paradox experiment is a meassurement of the extra dimensions.pptx
Twin's paradox experiment is a meassurement of the extra dimensions.pptxEran Akiva Sinbar
 
Call Girls in Aiims Metro Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Aiims Metro Delhi 💯Call Us 🔝9953322196🔝 💯Escort.Call Girls in Aiims Metro Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Aiims Metro Delhi 💯Call Us 🔝9953322196🔝 💯Escort.aasikanpl
 
TOPIC 8 Temperature and Heat.pdf physics
TOPIC 8 Temperature and Heat.pdf physicsTOPIC 8 Temperature and Heat.pdf physics
TOPIC 8 Temperature and Heat.pdf physicsssuserddc89b
 
Call Us ≽ 9953322196 ≼ Call Girls In Mukherjee Nagar(Delhi) |
Call Us ≽ 9953322196 ≼ Call Girls In Mukherjee Nagar(Delhi) |Call Us ≽ 9953322196 ≼ Call Girls In Mukherjee Nagar(Delhi) |
Call Us ≽ 9953322196 ≼ Call Girls In Mukherjee Nagar(Delhi) |aasikanpl
 
Gas_Laws_powerpoint_notes.ppt for grade 10
Gas_Laws_powerpoint_notes.ppt for grade 10Gas_Laws_powerpoint_notes.ppt for grade 10
Gas_Laws_powerpoint_notes.ppt for grade 10ROLANARIBATO3
 
Call Girls in Mayapuri Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Mayapuri Delhi 💯Call Us 🔝9953322196🔝 💯Escort.Call Girls in Mayapuri Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Mayapuri Delhi 💯Call Us 🔝9953322196🔝 💯Escort.aasikanpl
 
Speech, hearing, noise, intelligibility.pptx
Speech, hearing, noise, intelligibility.pptxSpeech, hearing, noise, intelligibility.pptx
Speech, hearing, noise, intelligibility.pptxpriyankatabhane
 
Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...
Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...
Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...lizamodels9
 
Artificial Intelligence In Microbiology by Dr. Prince C P
Artificial Intelligence In Microbiology by Dr. Prince C PArtificial Intelligence In Microbiology by Dr. Prince C P
Artificial Intelligence In Microbiology by Dr. Prince C PPRINCE C P
 

Recently uploaded (20)

Temporomandibular joint Muscles of Mastication
Temporomandibular joint Muscles of MasticationTemporomandibular joint Muscles of Mastication
Temporomandibular joint Muscles of Mastication
 
Neurodevelopmental disorders according to the dsm 5 tr
Neurodevelopmental disorders according to the dsm 5 trNeurodevelopmental disorders according to the dsm 5 tr
Neurodevelopmental disorders according to the dsm 5 tr
 
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
 
zoogeography of pakistan.pptx fauna of Pakistan
zoogeography of pakistan.pptx fauna of Pakistanzoogeography of pakistan.pptx fauna of Pakistan
zoogeography of pakistan.pptx fauna of Pakistan
 
Analytical Profile of Coleus Forskohlii | Forskolin .pptx
Analytical Profile of Coleus Forskohlii | Forskolin .pptxAnalytical Profile of Coleus Forskohlii | Forskolin .pptx
Analytical Profile of Coleus Forskohlii | Forskolin .pptx
 
Volatile Oils Pharmacognosy And Phytochemistry -I
Volatile Oils Pharmacognosy And Phytochemistry -IVolatile Oils Pharmacognosy And Phytochemistry -I
Volatile Oils Pharmacognosy And Phytochemistry -I
 
BIOETHICS IN RECOMBINANT DNA TECHNOLOGY.
BIOETHICS IN RECOMBINANT DNA TECHNOLOGY.BIOETHICS IN RECOMBINANT DNA TECHNOLOGY.
BIOETHICS IN RECOMBINANT DNA TECHNOLOGY.
 
‏‏VIRUS - 123455555555555555555555555555555555555555
‏‏VIRUS -  123455555555555555555555555555555555555555‏‏VIRUS -  123455555555555555555555555555555555555555
‏‏VIRUS - 123455555555555555555555555555555555555555
 
Bentham & Hooker's Classification. along with the merits and demerits of the ...
Bentham & Hooker's Classification. along with the merits and demerits of the ...Bentham & Hooker's Classification. along with the merits and demerits of the ...
Bentham & Hooker's Classification. along with the merits and demerits of the ...
 
Behavioral Disorder: Schizophrenia & it's Case Study.pdf
Behavioral Disorder: Schizophrenia & it's Case Study.pdfBehavioral Disorder: Schizophrenia & it's Case Study.pdf
Behavioral Disorder: Schizophrenia & it's Case Study.pdf
 
Twin's paradox experiment is a meassurement of the extra dimensions.pptx
Twin's paradox experiment is a meassurement of the extra dimensions.pptxTwin's paradox experiment is a meassurement of the extra dimensions.pptx
Twin's paradox experiment is a meassurement of the extra dimensions.pptx
 
Call Girls in Aiims Metro Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Aiims Metro Delhi 💯Call Us 🔝9953322196🔝 💯Escort.Call Girls in Aiims Metro Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Aiims Metro Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
 
TOPIC 8 Temperature and Heat.pdf physics
TOPIC 8 Temperature and Heat.pdf physicsTOPIC 8 Temperature and Heat.pdf physics
TOPIC 8 Temperature and Heat.pdf physics
 
Call Us ≽ 9953322196 ≼ Call Girls In Mukherjee Nagar(Delhi) |
Call Us ≽ 9953322196 ≼ Call Girls In Mukherjee Nagar(Delhi) |Call Us ≽ 9953322196 ≼ Call Girls In Mukherjee Nagar(Delhi) |
Call Us ≽ 9953322196 ≼ Call Girls In Mukherjee Nagar(Delhi) |
 
Gas_Laws_powerpoint_notes.ppt for grade 10
Gas_Laws_powerpoint_notes.ppt for grade 10Gas_Laws_powerpoint_notes.ppt for grade 10
Gas_Laws_powerpoint_notes.ppt for grade 10
 
Engler and Prantl system of classification in plant taxonomy
Engler and Prantl system of classification in plant taxonomyEngler and Prantl system of classification in plant taxonomy
Engler and Prantl system of classification in plant taxonomy
 
Call Girls in Mayapuri Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Mayapuri Delhi 💯Call Us 🔝9953322196🔝 💯Escort.Call Girls in Mayapuri Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Mayapuri Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
 
Speech, hearing, noise, intelligibility.pptx
Speech, hearing, noise, intelligibility.pptxSpeech, hearing, noise, intelligibility.pptx
Speech, hearing, noise, intelligibility.pptx
 
Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...
Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...
Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...
 
Artificial Intelligence In Microbiology by Dr. Prince C P
Artificial Intelligence In Microbiology by Dr. Prince C PArtificial Intelligence In Microbiology by Dr. Prince C P
Artificial Intelligence In Microbiology by Dr. Prince C P
 

Featured

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 

Featured (20)

Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 

How Bayesian inference works in the real world

  • 3. Bayesian inference is not incomprehensible
  • 4. What does “Bayesian inference” even mean? Inference = Educated guessing Thomas Bayes = A nonconformist Presbyterian minister in London back when the United States were still The Colonies. He also wrote an essay on probability. His friend Richard Price edited and published it after he died. Bayesian inference = Guessing in the style of Bayes
  • 5. Dilemma at the movies This person dropped their ticket in the hallway. Do you call out “Excuse me, ma’am!” or “Excuse me, sir!” You have to make a guess.
  • 6. Dilemma at the movies What if they’re standing in line for the men’s restroom? Bayesian inference is a way to capture common sense. It helps you use what you know to make better guesses.
  • 7. Put numbers to our dilemma Out of 100 men at the movies 4 have long hair 96 have short hair Out of 100 women at the movies 50 have long hair 50 have short hair
  • 8. Put numbers to our dilemma 4 have long hair 96 have short hair 50 have long hair 50 have short hair About 12 times more women have long hair than men. Out of 100 men at the movies Out of 100 women at the movies
  • 9. Put numbers to our dilemma Out of 98 men in line 4 have long hair 94 have short hair Out of 2 women in line 1 has long hair 1 has short hair But there are 98 men and 2 women in line for the men’s restroom.
  • 10. In the line, 4 times more men have long hair than women. Put numbers to our dilemma 4 have long hair 94 have short hair 1 has long hair 1 has short hair Out of 98 men in line Out of 2 women in line
  • 11. 50 are men 2 men have long hair 48 men have short hair 50 are women 25 women have long hair 25 women have short hair Out of 100 people at the movies
  • 12. 98 are men 4 men have long hair 94 men have short hair 2 are women One woman has long hair One woman has short hair Out of 100 people In line for the men’s restroom
  • 13. Translate to math P(something) = # something / # everything P(woman) = Probability that a person is a woman = # women / # people = 50 / 100 = .5 P(man) = Probability that a person is a man = # men / # people = 50 / 100 = .5 50 are men 50 are women Out of 100 people at the movies
  • 14. P(something) = # something / # everything P(woman) = Probability that a person is a woman = # women / # people = 2 / 100 = .02 P(man) = Probability that a person is a man = # men / # people = 98 / 100 = .98 98 are men 2 are women Out of 100 people In line for the men’s restroom Translate to math
  • 15. Conditional probabilities P(long hair | woman) If I know that a person is a woman, what is the probability that person has long hair? P(long hair | woman) = # women with long hair / # women = 25 / 50 = .5 50 are women 25 women have long hair 25 women have short hair Out of 100 people at the movies
  • 16. 2 are women One woman has long hair One woman has short hair Out of 100 people In line for the men’s restroom Conditional probabilities This doesn’t change when we consider people in line. P(long hair | woman) = # women with long hair / # women = 1 / 2 = .5
  • 17. Conditional probabilities If I know that a person is a man, what is the probability that person has long hair? P(long hair | man) = # men with long hair / # men = 2 / 50 = .04 Whether in line or not. 50 are men 2 men have long hair 48 men have short hair Out of 100 people at the movies
  • 18. Conditional probabilities P(A | B) is the probability of A, given B. “If I know B is the case, what is the probability that A is also the case?” P(A | B) is not the same as P(B | A). P(cute | puppy) is not the same as P(puppy | cute) If I know the thing I’m holding is a puppy, what is the probability that it is cute? If I know the the thing I’m holding is cute, what is the probability that it is a puppy?
  • 19. Joint probabilities What is the probability that a person is both a woman and has short hair? P(woman with short hair) = P(woman) * P(short hair | woman) = .5 * .5 = .25 P(man) = .5 P(woman) = .5 Out of probability of 1 P(woman with short hair) = .25
  • 20. Joint probabilities P(woman with long hair) = P(woman) * P(long hair | woman) = .5 * .5 = .25 P(man) = .5 P(woman) = .5 Out of probability of 1 P(woman with short hair) = .25 P(woman with long hair) = .25
  • 21. Joint probabilities P(man with short hair) = P(man) * P(short hair | man) = .5 * .96 = .48 P(man) = .5 P(woman) = .5 Out of probability of 1 P(woman with short hair) = .25 P(woman with long hair) = .25 P(man with short hair) = .48
  • 22. Joint probabilities P(man with long hair) = P(man) * P(long hair | man) = .5 * .04 = .02 P(man) = .5 P(woman) = .5 P(woman with short hair) = .25 Out of probability of 1 P(woman with long hair) = .25 P(man with short hair) = .48 P(man with long hair) = .02
  • 23. Joint probabilities If P(man) = .98 and P(woman) = .02, then the answers change. P(man with long hair) = P(man) * P(long hair | man) = .98 * .04 = .04 P(man) = .98 P(woman) = .02 P(woman with short hair) = .01 Out of probability of 1 P(woman with long hair) = .01 P(man with short hair) = .94 P(man with long hair) = .04
  • 24. Joint probabilities P(woman with long hair) = P(woman) * P(long hair | woman) = .02 * .5 = .01 P(man) = .98 P(woman) = .02 P(woman with short hair) = .01 Out of probability of 1 P(woman with long hair) = .01 P(man with short hair) = .94 P(man with long hair) = .04
  • 25. Joint probabilities P(A and B) is the probability that both A and B are the case. Also written P(A, B) or P(A ∩ B) P(A and B) is the same as P(B and A) The probability that I am having a jelly donut with my milk is the same as the probability that I am having milk with my jelly donut. P(donut and milk) = P(milk and donut)
  • 26. Marginal probabilities P(long hair) = P(woman with long hair) + P(man with long hair) = .01 + .04 = .05 P(man) = .98 P(woman) = .02 P(woman with short hair) = .01 Out of probability of 1 P(woman with long hair) = .01 P(man with short hair) = .94 P(man with long hair) = .04
  • 27. Marginal probabilities P(short hair) = P(woman with short hair) + P(man with short hair) = .01 + .94 = .95 P(man) = .98 P(woman) = .02 P(woman with short hair) = .01 Out of probability of 1 P(woman with long hair) = .01 P(man with short hair) = .94 P(man with long hair) = .04
  • 28. What we really care about We know the person has long hair. Are they a man or a woman? P(man | long hair) We don’t know this answer yet.
  • 29. Thomas Bayes noticed something cool P(man with long hair) = P(long hair) * P(man | long hair)
  • 30. Thomas Bayes noticed something cool P(man with long hair) = P(long hair) * P(man | long hair) P(long hair and man) = P(man) * P(long hair | man)
  • 31. Thomas Bayes noticed something cool P(man with long hair) = P(long hair) * P(man | long hair) P(long hair and man) = P(man) * P(long hair | man) Because P(man and long hair) = P(long hair and man)
  • 32. Thomas Bayes noticed something cool P(man with long hair) = P(long hair) * P(man | long hair) P(long hair and man) = P(man) * P(long hair | man) Because P(man and long hair) = P(long hair and man) P(long hair) * P(man | long hair) = P(man) * P(long hair | man)
  • 33. Thomas Bayes noticed something cool P(man with long hair) = P(long hair) * P(man | long hair) P(long hair and man) = P(man) * P(long hair | man) Because P(man and long hair) = P(long hair and man) P(long hair) * P(man | long hair) = P(man) * P(long hair | man) P(man | long hair) = P(man) * P(long hair | man) / P(long hair)
  • 34. Thomas Bayes noticed something cool P(man with long hair) = P(long hair) * P(man | long hair) P(long hair and man) = P(man) * P(long hair | man) Because P(man and long hair) = P(long hair and man) P(long hair) * P(man | long hair) = P(man) * P(long hair | man) P(man | long hair) = P(man) * P(long hair | man) / P(long hair) P(A | B) = P(B | A) * P(A) / P(B)
  • 35. Bayes’ Theorem P(A | B) = P(B | A) P(A) P(B)
  • 36. Back to the movie theater, this time with Bayes P(man | long hair) = P(man) * P(long hair | man) P(long hair) P(man) = .5 P(woman) = .5 P(long hair | woman) = .5 P(long hair | man) = .04
  • 37. Back to the movie theater, this time with Bayes P(man | long hair) = P(man) * P(long hair | man) P(long hair) = P(man) * P(long hair | man) P(woman with long hair) + P(man with long hair) P(man) = .5 P(woman) = .5 P(long hair | woman) = .5 P(long hair | man) = .04
  • 38. Back to the movie theater, this time with Bayes P(man | long hair) = P(man) * P(long hair | man) P(long hair) = P(man) * P(long hair | man) P(woman with long hair) + P(man with long hair) P(man | long hair) = .5 * .04 = .02 / .27 = .07 .25 + .02 P(man) = .5 P(woman) = .5 P(long hair | woman) = .5 P(long hair | man) = .04
  • 39. P(long hair | man) = .04 P(man) = .98 P(woman) = .02 Back to the movie theater, this time with Bayes P(man | long hair) = P(man) * P(long hair | man) P(long hair) = P(man) * P(long hair | man) P(woman with long hair) + P(man with long hair) P(long hair | woman) = .5
  • 40. P(long hair | man) = .04 P(man) = .98 P(woman) = .02 Back to the movie theater, this time with Bayes P(man | long hair) = P(man) * P(long hair | man) P(long hair) = P(man) * P(long hair | man) P(woman with long hair) + P(man with long hair) P(man | long hair) = .98 * .04 = .04 / .05 = .80 .01 + .04 P(long hair | woman) = .5
  • 41. Probability distributions Probability is like a pot with just one cup of coffee left in it.
  • 42. Probability distributions If you only have one cup, you can fill it completely. 100%
  • 43. Probability distributions If you have two cups, you have to decide how to share (distribute) it. 27% 73%
  • 44. Probability distributions Our people are distributed between two groups, women and men. 50% 50% Women Men
  • 45. Probability distributions We can distribute them more. 2% Women with long hair Men with long hair 48% 25% Women with short hair Men with short hair 25%
  • 46. Probability distributions 2% Women with long hair Men with long hair 48% 25% Women with short hair Men with short hair 25% P(woman with short hair) = .25 P(woman with long hair) = .25 P(man with short hair) = .48 P(man with long hair) = .02
  • 47. Probability distributions 2% Women with long hair Men with long hair 48% 25% Women with short hair Men with short hair 25%
  • 48. Probability distributions .02 Women with long hair Men with long hair .48 .25 Women with short hair Men with short hair .25
  • 49. Probability distributions .02 Women with long hair Men with long hair .48 .25 Women with short hair Men with short hair .25 It’s helpful to think of probabilities as beliefs Probability
  • 51. Probability distributions 3 Rolling a fair die .17 2 .17 1 .17 6 .17 5 .17 4 .17 Probability
  • 52. Probability distributions Lose .000000001 Win Playing for the Powerball jackpot .99999999 Probability
  • 53. Probability distributions Height of adults in cm <150 .06 150 to 160 .09 160 to 170 .17 170 to 180 .24 180 to 190 .28 190 to 200 .12 200 to 210 .03 >210 .01 Probability
  • 54. 205 to 210 185 to 190 165 to 170 Probability distributions Height of adults in cm <150 .06 150 to 155 .07 160 to 165 .05 170 to 175 .13 180 to 185 .16 190 to 195 .05 200 to 205 .01 >210 .01 155 to 160 175 to 180 195 to 200 .04 .10 .11 .12 .07 .02 Probability
  • 55. 200 210 Probability distributions Height of adults in cm Probability 150 160 170 180 190
  • 56. Probability distributions Height of adults in cm Probability 200 210 150 160 170 180 190
  • 57. Probability distributions Height of adults in cm Probability 200 210 150 160 170 180 190
  • 58. Probability distributions Height of adults in cm 150 160 170 180 190 200 210 Probability
  • 59. Probability distributions Height of adults in cm 150 160 170 180 190 200 210 Probability Average (mean)
  • 60. Probability distributions Height of adults in cm 150 160 170 180 190 200 210 Probability Middle (median)
  • 61. Probability distributions Height of adults in cm 150 160 170 180 190 200 210 Probability Most common (mode)
  • 62. Weighing my dog My dog is named Reign of Terror. When we go to the veterinarian, Reign squirms on the scale. Each time we get a different weight measurement. 13.9 lb 17.5 lb 14.1 lb
  • 63. How much does she weigh? Take the average. mean = (13.9 + 17.5 + 14.1) / 3 = 15.2 lb Calculate the standard deviation. std dev = sqrt((13.9 - 15.1)^2 + (17.5 - 15.1)^2 + (14.1 - 15.1)^2) / 2 = 2.0 lb Calculate the standard error. std err = std dev / sqrt(3) = 1.16
  • 64. How much does she weigh? The estimate of the mean is a Normal distribution with a mean of 15.2 lb and a standard deviation of 1.2 lb. 12 13 14 15 16 17 18 Probability Reign’s weight in pounds
  • 65. Bayes’ Theorem P(A | B) = P(B | A) P(A) P(B)
  • 66. Bayes’ Theorem P(w | m) = P(m | w) P(w) P(m)
  • 67. Bayes’ Theorem P(w | m) = P(m | w) P(w) P(m) prior
  • 68. Bayes’ Theorem P(w | m) = P(m | w) P(w) P(m) likelihood
  • 69. Bayes’ Theorem P(w | m) = P(m | w) P(w) P(m) posterior
  • 70. Bayes’ Theorem P(w | m) = P(m | w) P(w) P(m) marginal likelihood
  • 71. Bayes’ Theorem P(w) = uniform Start with
  • 72. Bayes’ Theorem P(w | m) = P(m | w) C1 C2
  • 73. Assumes that the mean of the weight is equally likely to be anything. Bayes’ Theorem P(w | m) = P(m | w)
  • 74. P(w = 17 | m = [13.9, 14.1, 17.5]) = P(m = [13.9, 14.1, 17.5] | w = 17) P(w | m) = P(m | w) 12 13 14 15 16 17 18 Probability Reign’s weight in pounds
  • 75. P(w = 17 | m = [13.9, 14.1, 17.5]) = P(m = [13.9, 14.1, 17.5] | w = 17) = P(m = 13.9 | w = 17) * P(m = 14.1 | w = 17) * P(m = 17.5 | w = 17) P(w | m) = P(m | w) 12 13 14 15 16 17 18 Probability Reign’s weight in pounds
  • 76. P(w = 17 | m = [13.9, 14.1, 17.5]) = P(m = [13.9, 14.1, 17.5] | w = 17) = P(m = 13.9 | w = 17) * P(m = 14.1 | w = 17) * P(m = 17.5 | w = 17) P(w | m) = P(m | w) 12 13 14 15 16 17 18 Probability Reign’s weight in pounds
  • 77. P(w = 17 | m = [13.9, 14.1, 17.5]) = P(m = [13.9, 14.1, 17.5] | w = 17) = P(m = 13.9 | w = 17) * P(m = 14.1 | w = 17) * P(m = 17.5 | w = 17) P(w | m) = P(m | w) 12 13 14 15 16 17 18 Probability Reign’s weight in pounds
  • 78. P(w = 16 | m = [13.9, 14.1, 17.5]) = P(m = [13.9, 14.1, 17.5] | w = 16) = P(m = 13.9 | w = 16) * P(m = 14.1 | w = 16) * P(m = 17.5 | w = 16) P(w | m) = P(m | w) 12 13 14 15 16 17 18 Probability Reign’s weight in pounds
  • 79. P(w = 16 | m = [13.9, 14.1, 17.5]) = P(m = [13.9, 14.1, 17.5] | w = 16) = P(m = 13.9 | w = 16) * P(m = 14.1 | w = 16) * P(m = 17.5 | w = 16) P(w | m) = P(m | w) 12 13 14 15 16 17 18 Probability Reign’s weight in pounds
  • 80. P(w = 15 | m = [13.9, 14.1, 17.5]) = P(m = [13.9, 14.1, 17.5] | w = 15) = P(m = 13.9 | w = 15) * P(m = 14.1 | w = 15) * P(m = 17.5 | w = 15) P(w | m) = P(m | w) 12 13 14 15 16 17 18 Probability Reign’s weight in pounds
  • 81. mean = 15.2 lb Also known as a Maximum Likelihood Estimate (MLE) P(w | m) = P(m | w) 12 13 14 15 16 17 18 Probability Reign’s weight in pounds
  • 82. What would Thomas do? Start with what we know. Reign was 14.2 lb the last time we came in. She doesn’t seem noticeably more heavy to me. I can start with a prior belief--a bias toward what I think the answer will be.
  • 83. How much does she weigh? My prior is a normal curve with a mean at 14.2 lb and a standard error of .5 lb. 12 13 14 15 16 17 18 Probability Reign’s weight in pounds
  • 84. How much does she weigh? My prior is a normal curve with a mean at 14.2 lb and a standard error of .5 lb. 12 13 14 15 16 17 18 Probability P(w) Reign’s weight in pounds
  • 85. Bayes’ Theorem P(w | m) = P(m | w) P(w) P(m) This time I don’t neglect the P(w) term. I still assume the P(m) term is constant.
  • 86. P(w = 17 | m = [13.9, 14.1, 17.5]) = P(m = [13.9, 14.1, 17.5] | w = 17) = P(m = 13.9 | w = 17) * P(m = 14.1 | w = 17) * P(m = 17.5 | w = 17) 12 13 14 15 16 17 18 Probability P(w) P(w | m) = P(m | w) * P(w) Reign’s weight in pounds
  • 87. P(w = 17 | m = [13.9, 14.1, 17.5]) = P(m = [13.9, 14.1, 17.5] | w = 17) * P(w=17) = P(m = 13.9 | w = 17) * P(w=17) * P(m = 14.1 | w = 17) * P(w=17) * P(m = 17.5 | w = 17) * P(w=17) P(w | m) = P(m | w) * P(w) 12 13 14 15 16 17 18 Probability P(w) Reign’s weight in pounds
  • 88. P(w = 17 | m = [13.9, 14.1, 17.5]) = P(m = [13.9, 14.1, 17.5] | w = 17) * P(w=17) = P(m = 13.9 | w = 17) * P(w=17) * P(m = 14.1 | w = 17) * P(w=17) * P(m = 17.5 | w = 17) * P(w=17) 12 13 14 15 16 17 18 Probability P(w) P(m | w) P(w | m) = P(m | w) * P(w) Reign’s weight in pounds
  • 89. P(w = 16 | m = [13.9, 14.1, 17.5]) = P(m = [13.9, 14.1, 17.5] | w = 16) * P(w=16) = P(m = 13.9 | w = 16) * P(w=16) * P(m = 14.1 | w = 16) * P(w=16) * P(m = 17.5 | w = 16) * P(w=16) 12 13 14 15 16 17 18 Probability P(w) P(m | w) P(w | m) = P(m | w) * P(w) Reign’s weight in pounds
  • 90. P(w = 15 | m = [13.9, 14.1, 17.5]) = P(m = [13.9, 14.1, 17.5] | w = 15) * P(w=15) = P(m = 13.9 | w = 15) * P(w=15) * P(m = 14.1 | w = 15) * P(w=15) * P(m = 17.5 | w = 15) * P(w=15) 12 13 14 15 16 17 18 Probability P(w) P(m | w) P(w | m) = P(m | w) * P(w) Reign’s weight in pounds
  • 91. P(w = 14 | m = [13.9, 14.1, 17.5]) = P(m = [13.9, 14.1, 17.5] | w = 14) * P(w=14) = P(m = 13.9 | w = 14) * P(w=14) * P(m = 14.1 | w = 14) * P(w=14) * P(m = 17.5 | w = 14) * P(w=14) 12 13 14 15 16 17 18 Probability P(w) P(m | w) P(w | m) = P(m | w) * P(w) Reign’s weight in pounds
  • 92. Our new estimate of Reign’s weight, P(w | m), is a normal distribution with a mean at about 14.1 lb and a std err of .4 lb. Also known as Maximum A Posteriori (MAP). 12 13 14 15 16 17 18 Probability P(w) P(w|m) P(w | m) = P(m | w) * P(w) Reign’s weight in pounds
  • 93. The Bayesian estimate ignores 17.5 lb like an outlier. The distribution is narrower. Confidence is greater. The answer is probably much closer to correct. 12 13 14 15 16 17 18 Probability Bayesian estimate Bayesian vs. not non-Bayesian estimate Reign’s weight in pounds
  • 94. Why we might want to use Bayesian inference We know things Age is more than zero Temperature is greater than -273 Celsius Height is probably less than 2.4 meters (8 feet) Starting with a belief helps us get to a confident answer with fewer data points.
  • 95. Why Bayesian inference makes us nervous We’re not always aware of what we believe. Putting what we believe into a distribution correctly is tricky. We want to be able to be surprised by our data. Inaccurate beliefs can make it hard or impossible to learn. “It ain't what you don't know that gets you into trouble. It's what you know for sure that just ain't so.” - Mark Twain
  • 96. Believe the impossible, at least a little bit Leave room for believing the unlikely. Leave a non- zero probability unless you are absolutely certain. “When you have excluded the impossible, whatever remains, however improbable, must be the truth” - Sherlock Holmes (Sir Arthur Conan Doyle)
  • 97. Believe the impossible, at least a little bit "Alice laughed: "There's no use trying," she said; "one can't believe impossible things." "I daresay you haven't had much practice," said the Queen. "When I was younger, I always did it for half an hour a day. Why, sometimes I've believed as many as six impossible things before breakfast." - Lewis Carroll (Alice’s Adventures in Wonderland)
  • 98. Questions? Here’s how you can get in touch with me. brohrer@gmail.com Blog (Data Science and Robots) LinkedIn Twitter YouTube Facebook GitHub Link to these slides: https://docs.google.com/presentation/d/1325yenZP_VdHoVj-tU0AnbQUxFwb8Fl1VdyAAUxEzfg/edit?usp=sharing
  • 99. Acknowledgements Businessman Consulting Glowing Crystal Ball, InfoWire.dk, Public domain Equation images from The Conjugate Prior for the Normal Distribution, Michael I. Jordan, Teodor Mihai Moldovan, February 8 th, 2010 Portrait of an unknown 19th-century Presbyterian clergyman. Identified as Thomas Bayes, Public domain Woman blond hair, face long hair laleyla5, pixabay, Public Domain hairfreaky long hair, Creative Commons 2.0 Amber Rose at the "PEOPLE Magazine Awards”, Creative Commons Attribution-Share Alike 2.0 Generic Neil Armstrong, Public Domain A blond long-haired young lady-woman, "Mike" Michael L. Baird, Creative Commons Attribution 2.0 Generic White Long Coated Puppy, Creative Commons Zero Long Beach Comic & Horror Con 2011, Creative Commons 2.0 Donuts and milk, Creative Commons Zero Photo of Reign of Terror, Diane Rohrer under Creative Commons Zero Mark Twain, Public domain Sherlock Holmes, Public domain Red Queen with Alice, Public domain
  • 100. How Bayesian Inference Works by Brandon Rohrer 12 13 14 15 16 17 18 Probability Bayesian estimate non-Bayesian estimate Weight in pounds P(A | B) = P(B | A) P(A)