SlideShare ist ein Scribd-Unternehmen logo
1 von 3
Downloaden Sie, um offline zu lesen
Conditional probability and Bayesian inference
Steven L. Scott
March 9 2018
Bayesian inference really is a different way of thinking about statistical problems than standard “classical”
(or “frequentist”) statistics. Bayes uses probability to represent a decision maker’s belief about an unknown
quantity, such as the parameters of a statistical model. The “decision maker” in this case might be you, it
might be a hypothetical other person, or it might be an articial agent such as a computer program that
you’re authorizing to make decisions on your behalf. In this tutorial we will call the unknown quantity θ
and the data y.
Conditional probability
Conditional probability plays a vital role in Bayes’ rule, so let’s start off by making sure we know what it
means. Imagine the unknown quantities θ and y have joint distribution p(θ, y). Now suppose the value of y
is revealed to you (like it would be if you’d observed a data set from which you hope to learn about θ). The
marginal distribution of θ changes from p(θ) = p(θ, y) dy to
p(θ|y) =
p(θ, y)
p(y)
.
The vertical bar is read as “given,” or “conditional on,” so the verbal expression of p(θ|y) is “the distribution
of θ given y.”
Conceptually, conditional probability looks at all instances of (θ, y) in the sample space where the random
variable y obtains its observed numerical value. The individual values of θ in this restricted sample space
have the same relative likelihoods as before (relative to one another), conditional on being in the reduced
space. The role of p(y) in the denominator is simply to renormalize the expression so that it integrates to 1
as a function of θ. Figure 1 illustrates the relationship between a hypothetical joint distribution p(θ, y) and
the conditional distribution p(θ|y = 3).
Practically, the denition of conditional probability tells us that joint distributions factor into a condi-
tional distribution times a marginal. Of course the factorization can go in either direction.
p(θ, y) = p(θ|y)p(y) = p(y|θ)p(θ).
Rearranging terms gives us Bayes’ rule
p(θ|y) =
p(y|θ)p(θ)
p(y)
. (1)
Because p(y), the marginal distribution of the data, is often hard to compute, Bayes’ rule is sometimes
written as
p(θ|y) ∝ p(y|θ)p(θ). (2)
The distribution p(θ) is called the prior distribution, or just “the prior,” p(y|θ) is the likelihood function,
and p(θ|y) is the posterior distribution. Thus Bayes’ rule is often verbalized as “the posterior is proportional
to the likelihood times the prior.”
1
y
−4
−2
0
2
4
6
8
theta
−4
−2
0
2
4
6
8
Density
0.00
0.02
0.04
0.06
yθ
0.005
0.01
0.015
0.02
0.025
0.03
0.035
0.04
−4 −2 0 2 4 6 8
−4−202468
(a) (b)
−4 −2 0 2 4 6 8
0.0000.0050.0100.0150.020
θ
jointdensity
−4 −2 0 2 4 6 8
0.00.10.20.30.4
θ
conditionaldensity
(c) (d)
Figure 1: Panels (a) and (b) show two different views of the joint density of θ and y. Panel (c) shows the vertical
slice of the joint density where y = 3. Panel (d) shows the conditional density p(θ|y = 3), which differs from panel
(c) only in the vertical axis labels.
2
Interpretation
Perhaps even more important than how to compute these probability distributions is how to interpret them.
Both the prior and posterior distribution measure one’s belief about the value of θ. The prior describes your
belief before seeing y. The posterior describes your belief after seeing y. Bayes’ theorem tells us the process
of learning about θ when y is observed.
If we think of a particular numerical value of θ as the parameters of a statistical model, then distributions
over θ are describing which sets of models are more and less likely to be correct. This is different than
frameworks that seek to identify “the model” by optimizing some criterion (such as likelihood). By working
with distributions over the space of models, Bayes handles the notion of “model uncertainty” gracefully, in
a way that classical methods struggle with. For example, both Bayesian and classical inference can describe
the uncertainty about a scalar parameter using an interval, and these intervals often agree. However, Bayes
specifies which parts of that interval are more or less likely, which confidence intervals don’t do. But that’s
just about reporting uncertainty. Bayes also allows you to average over a large group of models (represented
by the posterior distribution) in order to make better predictions than you could with a single model. The
advantages of Bayes can be hard to see in simple examples where Bayesian and classical approaches tend
to agree, but Bayes’ ability to handle model uncertainty is increasingly helpful as models become more
complicated.
The next section illustrates Bayes rule with a worked (simple) example.
3

Weitere ähnliche Inhalte

Ähnlich wie 01.conditional prob

For this assignment, use the aschooltest.sav dataset.The d
For this assignment, use the aschooltest.sav dataset.The dFor this assignment, use the aschooltest.sav dataset.The d
For this assignment, use the aschooltest.sav dataset.The d
MerrileeDelvalle969
 
Machine learning (4)
Machine learning (4)Machine learning (4)
Machine learning (4)
NYversity
 
MSL 5080, Methods of Analysis for Business Operations 1 .docx
MSL 5080, Methods of Analysis for Business Operations 1 .docxMSL 5080, Methods of Analysis for Business Operations 1 .docx
MSL 5080, Methods of Analysis for Business Operations 1 .docx
AASTHA76
 
Probabilistic decision making
Probabilistic decision makingProbabilistic decision making
Probabilistic decision making
shri1984
 

Ähnlich wie 01.conditional prob (20)

Statistics for deep learning
Statistics for deep learningStatistics for deep learning
Statistics for deep learning
 
Frequentist inference only seems easy By John Mount
Frequentist inference only seems easy By John MountFrequentist inference only seems easy By John Mount
Frequentist inference only seems easy By John Mount
 
Statistics symposium talk, Harvard University
Statistics symposium talk, Harvard UniversityStatistics symposium talk, Harvard University
Statistics symposium talk, Harvard University
 
Frequentist Statistics as a Theory of Inductive Inference (2/27/14)
Frequentist Statistics as a Theory of Inductive Inference (2/27/14)Frequentist Statistics as a Theory of Inductive Inference (2/27/14)
Frequentist Statistics as a Theory of Inductive Inference (2/27/14)
 
An overview of Bayesian testing
An overview of Bayesian testingAn overview of Bayesian testing
An overview of Bayesian testing
 
chap4_Parametric_Methods.ppt
chap4_Parametric_Methods.pptchap4_Parametric_Methods.ppt
chap4_Parametric_Methods.ppt
 
Statistics
StatisticsStatistics
Statistics
 
Statistics
StatisticsStatistics
Statistics
 
Cs229 notes4
Cs229 notes4Cs229 notes4
Cs229 notes4
 
On the vexing dilemma of hypothesis testing and the predicted demise of the B...
On the vexing dilemma of hypothesis testing and the predicted demise of the B...On the vexing dilemma of hypothesis testing and the predicted demise of the B...
On the vexing dilemma of hypothesis testing and the predicted demise of the B...
 
Demystifying the Bias-Variance Tradeoff
Demystifying the Bias-Variance TradeoffDemystifying the Bias-Variance Tradeoff
Demystifying the Bias-Variance Tradeoff
 
Part1: Quest for DataScience 101
Part1: Quest for DataScience 101Part1: Quest for DataScience 101
Part1: Quest for DataScience 101
 
Describing and exploring data
Describing and exploring dataDescribing and exploring data
Describing and exploring data
 
Bayesian statistics using r intro
Bayesian statistics using r   introBayesian statistics using r   intro
Bayesian statistics using r intro
 
For this assignment, use the aschooltest.sav dataset.The d
For this assignment, use the aschooltest.sav dataset.The dFor this assignment, use the aschooltest.sav dataset.The d
For this assignment, use the aschooltest.sav dataset.The d
 
Calculus in Machine Learning
Calculus in Machine Learning Calculus in Machine Learning
Calculus in Machine Learning
 
Bayesian statistics for biologists and ecologists
Bayesian statistics for biologists and ecologistsBayesian statistics for biologists and ecologists
Bayesian statistics for biologists and ecologists
 
Machine learning (4)
Machine learning (4)Machine learning (4)
Machine learning (4)
 
MSL 5080, Methods of Analysis for Business Operations 1 .docx
MSL 5080, Methods of Analysis for Business Operations 1 .docxMSL 5080, Methods of Analysis for Business Operations 1 .docx
MSL 5080, Methods of Analysis for Business Operations 1 .docx
 
Probabilistic decision making
Probabilistic decision makingProbabilistic decision making
Probabilistic decision making
 

Mehr von Steven Scott (7)

Mixture conditional-density
Mixture conditional-densityMixture conditional-density
Mixture conditional-density
 
Bayesian inference and the pest of premature interpretation.
Bayesian inference and the pest of premature interpretation.Bayesian inference and the pest of premature interpretation.
Bayesian inference and the pest of premature interpretation.
 
Introduction to Bayesian Inference
Introduction to Bayesian InferenceIntroduction to Bayesian Inference
Introduction to Bayesian Inference
 
“I. Conjugate priors”
“I. Conjugate priors”“I. Conjugate priors”
“I. Conjugate priors”
 
01.ConditionalProb.pdf in the Bayes_intro folder
01.ConditionalProb.pdf in the Bayes_intro folder01.ConditionalProb.pdf in the Bayes_intro folder
01.ConditionalProb.pdf in the Bayes_intro folder
 
00Overview PDF in the Bayes_intro folder
00Overview PDF in the Bayes_intro folder00Overview PDF in the Bayes_intro folder
00Overview PDF in the Bayes_intro folder
 
Using Statistics to Conduct More Efficient Searches
Using Statistics to Conduct More Efficient SearchesUsing Statistics to Conduct More Efficient Searches
Using Statistics to Conduct More Efficient Searches
 

KĂźrzlich hochgeladen

Nelamangala Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Nelamangala Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Nelamangala Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Nelamangala Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
amitlee9823
 
Call Girls In Majnu Ka Tilla 959961~3876 Shot 2000 Night 8000
Call Girls In Majnu Ka Tilla 959961~3876 Shot 2000 Night 8000Call Girls In Majnu Ka Tilla 959961~3876 Shot 2000 Night 8000
Call Girls In Majnu Ka Tilla 959961~3876 Shot 2000 Night 8000
dlhescort
 
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...
lizamodels9
 
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai KuwaitThe Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
daisycvs
 
Call Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
amitlee9823
 
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
amitlee9823
 

KĂźrzlich hochgeladen (20)

It will be International Nurses' Day on 12 May
It will be International Nurses' Day on 12 MayIt will be International Nurses' Day on 12 May
It will be International Nurses' Day on 12 May
 
Falcon Invoice Discounting: Empowering Your Business Growth
Falcon Invoice Discounting: Empowering Your Business GrowthFalcon Invoice Discounting: Empowering Your Business Growth
Falcon Invoice Discounting: Empowering Your Business Growth
 
Nelamangala Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Nelamangala Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Nelamangala Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Nelamangala Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
 
BAGALUR CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRL
BAGALUR CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRLBAGALUR CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRL
BAGALUR CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRL
 
Call Girls In Majnu Ka Tilla 959961~3876 Shot 2000 Night 8000
Call Girls In Majnu Ka Tilla 959961~3876 Shot 2000 Night 8000Call Girls In Majnu Ka Tilla 959961~3876 Shot 2000 Night 8000
Call Girls In Majnu Ka Tilla 959961~3876 Shot 2000 Night 8000
 
Marel Q1 2024 Investor Presentation from May 8, 2024
Marel Q1 2024 Investor Presentation from May 8, 2024Marel Q1 2024 Investor Presentation from May 8, 2024
Marel Q1 2024 Investor Presentation from May 8, 2024
 
Falcon Invoice Discounting: The best investment platform in india for investors
Falcon Invoice Discounting: The best investment platform in india for investorsFalcon Invoice Discounting: The best investment platform in india for investors
Falcon Invoice Discounting: The best investment platform in india for investors
 
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...
 
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
 
Organizational Transformation Lead with Culture
Organizational Transformation Lead with CultureOrganizational Transformation Lead with Culture
Organizational Transformation Lead with Culture
 
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai KuwaitThe Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
 
How to Get Started in Social Media for Art League City
How to Get Started in Social Media for Art League CityHow to Get Started in Social Media for Art League City
How to Get Started in Social Media for Art League City
 
Business Model Canvas (BMC)- A new venture concept
Business Model Canvas (BMC)-  A new venture conceptBusiness Model Canvas (BMC)-  A new venture concept
Business Model Canvas (BMC)- A new venture concept
 
Call Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Hebbal Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
 
RSA Conference Exhibitor List 2024 - Exhibitors Data
RSA Conference Exhibitor List 2024 - Exhibitors DataRSA Conference Exhibitor List 2024 - Exhibitors Data
RSA Conference Exhibitor List 2024 - Exhibitors Data
 
Call Girls Service In Old Town Dubai ((0551707352)) Old Town Dubai Call Girl ...
Call Girls Service In Old Town Dubai ((0551707352)) Old Town Dubai Call Girl ...Call Girls Service In Old Town Dubai ((0551707352)) Old Town Dubai Call Girl ...
Call Girls Service In Old Town Dubai ((0551707352)) Old Town Dubai Call Girl ...
 
JAYNAGAR CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRL
JAYNAGAR CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRLJAYNAGAR CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRL
JAYNAGAR CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRL
 
Malegaon Call Girls Service ☎ ️82500–77686 ☎️ Enjoy 24/7 Escort Service
Malegaon Call Girls Service ☎ ️82500–77686 ☎️ Enjoy 24/7 Escort ServiceMalegaon Call Girls Service ☎ ️82500–77686 ☎️ Enjoy 24/7 Escort Service
Malegaon Call Girls Service ☎ ️82500–77686 ☎️ Enjoy 24/7 Escort Service
 
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best ServicesMysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
 
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
Call Girls Jp Nagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Bang...
 

01.conditional prob

  • 1. Conditional probability and Bayesian inference Steven L. Scott March 9 2018 Bayesian inference really is a different way of thinking about statistical problems than standard “classical” (or “frequentist”) statistics. Bayes uses probability to represent a decision maker’s belief about an unknown quantity, such as the parameters of a statistical model. The “decision maker” in this case might be you, it might be a hypothetical other person, or it might be an articial agent such as a computer program that you’re authorizing to make decisions on your behalf. In this tutorial we will call the unknown quantity θ and the data y. Conditional probability Conditional probability plays a vital role in Bayes’ rule, so let’s start off by making sure we know what it means. Imagine the unknown quantities θ and y have joint distribution p(θ, y). Now suppose the value of y is revealed to you (like it would be if you’d observed a data set from which you hope to learn about θ). The marginal distribution of θ changes from p(θ) = p(θ, y) dy to p(θ|y) = p(θ, y) p(y) . The vertical bar is read as “given,” or “conditional on,” so the verbal expression of p(θ|y) is “the distribution of θ given y.” Conceptually, conditional probability looks at all instances of (θ, y) in the sample space where the random variable y obtains its observed numerical value. The individual values of θ in this restricted sample space have the same relative likelihoods as before (relative to one another), conditional on being in the reduced space. The role of p(y) in the denominator is simply to renormalize the expression so that it integrates to 1 as a function of θ. Figure 1 illustrates the relationship between a hypothetical joint distribution p(θ, y) and the conditional distribution p(θ|y = 3). Practically, the denition of conditional probability tells us that joint distributions factor into a condi- tional distribution times a marginal. Of course the factorization can go in either direction. p(θ, y) = p(θ|y)p(y) = p(y|θ)p(θ). Rearranging terms gives us Bayes’ rule p(θ|y) = p(y|θ)p(θ) p(y) . (1) Because p(y), the marginal distribution of the data, is often hard to compute, Bayes’ rule is sometimes written as p(θ|y) ∝ p(y|θ)p(θ). (2) The distribution p(θ) is called the prior distribution, or just “the prior,” p(y|θ) is the likelihood function, and p(θ|y) is the posterior distribution. Thus Bayes’ rule is often verbalized as “the posterior is proportional to the likelihood times the prior.” 1
  • 2. y −4 −2 0 2 4 6 8 theta −4 −2 0 2 4 6 8 Density 0.00 0.02 0.04 0.06 yθ 0.005 0.01 0.015 0.02 0.025 0.03 0.035 0.04 −4 −2 0 2 4 6 8 −4−202468 (a) (b) −4 −2 0 2 4 6 8 0.0000.0050.0100.0150.020 θ jointdensity −4 −2 0 2 4 6 8 0.00.10.20.30.4 θ conditionaldensity (c) (d) Figure 1: Panels (a) and (b) show two different views of the joint density of θ and y. Panel (c) shows the vertical slice of the joint density where y = 3. Panel (d) shows the conditional density p(θ|y = 3), which differs from panel (c) only in the vertical axis labels. 2
  • 3. Interpretation Perhaps even more important than how to compute these probability distributions is how to interpret them. Both the prior and posterior distribution measure one’s belief about the value of θ. The prior describes your belief before seeing y. The posterior describes your belief after seeing y. Bayes’ theorem tells us the process of learning about θ when y is observed. If we think of a particular numerical value of θ as the parameters of a statistical model, then distributions over θ are describing which sets of models are more and less likely to be correct. This is different than frameworks that seek to identify “the model” by optimizing some criterion (such as likelihood). By working with distributions over the space of models, Bayes handles the notion of “model uncertainty” gracefully, in a way that classical methods struggle with. For example, both Bayesian and classical inference can describe the uncertainty about a scalar parameter using an interval, and these intervals often agree. However, Bayes species which parts of that interval are more or less likely, which condence intervals don’t do. But that’s just about reporting uncertainty. Bayes also allows you to average over a large group of models (represented by the posterior distribution) in order to make better predictions than you could with a single model. The advantages of Bayes can be hard to see in simple examples where Bayesian and classical approaches tend to agree, but Bayes’ ability to handle model uncertainty is increasingly helpful as models become more complicated. The next section illustrates Bayes rule with a worked (simple) example. 3