SlideShare a Scribd company logo
1 of 22
Bayesian Data Analysis 
and 
Beta Distribution 
Venkatesh Vinayakarao 
IIIT Delhi, India. 
Thomas Bayes, 1701 to 1761 
IIIT Delhi – Technical Talk, Ketchup Series. 12th Nov 2014.
Agenda 
Updating Beliefs using Probability Theory 
Role of Beta Distributions 
Will Discuss 
Concepts 
Illustrations 
Intuitions 
Purpose 
Properties 
Will not Discuss 
Details 
Definitions 
Formalism 
Derivations 
Proofs 
11/12/2014 Venkatesh Vinayakarao 2
The Case of Coin Flips 
General Assumption: If a coin is fair! Heads 
(H) and Tails (T) are equally likely. But, coin 
need not be fair  
Experiment with Coin - 1 
Venkatesh Vinayakarao 3 
HHHTTTHTHT 
Experiment with Coin - 2 
HHHHHHHHHT 
Coin-1 more likely to be fair when compared to coin-2.
Our Beliefs 
• Can we find a structured way to determine 
coin’s nature? 
Venkatesh Vinayakarao 4 
Coin-1 
Data 
Observed 
None H T H T 
Belief Fair Skewed Fair Skewed Fair 
Coin-2 
Data 
Observed 
None H H H H 
Belief Fair Skewed More 
Skewed 
Even 
More… 
Even Even 
More… 
Prior Belief 
Belief Updates
Strong Prior 
Priors 
• Priors can be strong or weak 
Coin is lab tested for 1 Million Tosses. 
50% H, 50% T observed. 
One more observation will 
not change our belief 
significantly. 
Venkatesh Vinayakarao 5 
Weak Prior 
New Coin 
A few observations 
sufficient to change our 
belief significantly.
HyperParameter 
• Prior probability (of Heads) could be 
anything: 
• O.5  Fair Coin 
• 0.25  Skewed towards Tails 
• 0.75  Skewed towards Heads 
• 1  Head is guaranteed! 
• 0  Both sides are Tails. 
We use θ as a HyperParameter to visualize 
what happens for different values. 
Venkatesh Vinayakarao 6
World of Distributions 
Discrete Distribution of Prior. Since I 
typically perceive coins as fair, Prior belief 
peaks at 0.5. 
Venkatesh Vinayakarao 7
Another Possibility 
I may also choose to be unbiased! i.e., θ may 
take any value equally likely. 
A Continuous Uniform Distribution! 
Venkatesh Vinayakarao 8
Observations 
Let’s flip the coin (N) 5 times. We observe (z) 
3 Heads. 
Venkatesh Vinayakarao 9
Impact of Data 
Belief is influenced by Observations. But, 
note that: 
Belief ≠ observation 
Bayes’ Rule 
Eeks… what’s in the denominator? 
Venkatesh Vinayakarao 10
Numerator is easy 
• p(θ) was uniform. So, nothing to calculate. 
• How to calculate p(D|θ)? 
Venkatesh Vinayakarao 11 
Jacob Bernoulli 
1655 – 1705. 
θ푧 1 − θ 푛−푧 
If D observed is HHHTT and θ is 0.5, 
We have: 
p(D|θ) = (0.5)3 1 − 0.5 5−3 
Remember, two things: 1)we are interested in the 
distribution 2) Order of H,T does not matter.
Bayesian Update 
Venkatesh Vinayakarao 12
Painful Denominator 
• Recall, for discrete distributions: 
• And, for continuous distributions: 
Venkatesh Vinayakarao 13
A Simpler Way 
Form, Functions and Distributions 
Normal (or Gaussian) Poisson 
Venkatesh Vinayakarao 14
What form will suit us? 
Venkatesh Vinayakarao 15
Beta Distribution 
Vadivelu, a famous Tamil comedian. 
This is one of his great expression 
- terrified and confused. 
Venkatesh Vinayakarao 16
Beta Distribution 
• Takes two parameters Beta(a,b) 
• For now, assume a = #H + 1 and b = #T + 1. 
• After 10 flips, we may end up in one of these 
three: 
Venkatesh Vinayakarao 17
Prior and Posterior 
Let’s say we have a Strong Prior – Beta (11,11). 
What should happen if we see 10 more 
observations with 5H and 5T? 
Venkatesh Vinayakarao 18
Prior and Posterior… 
What if we have not seen any data? 
Venkatesh Vinayakarao 19
Conjugate Prior 
So, we see that: 
Such Priors that have same form are called 
Conjugate Priors 
Venkatesh Vinayakarao 20 
Prior 
beta(a,b) 
Posterior 
beta(a+z,b+N-z) 
z Heads in 
N trials
Summary 
Prior 
Likelihood 
Posterior 
Bayes’ Rule 
Bernoulli 
Distribution 
Beta 
Distribution 
Venkatesh Vinayakarao 21
References 
Book on Doing 
Bayesian Data 
Analysis – John K. 
Kruschke. 
YouTube Video on 
Statistics 101: The 
Binomial Distribution 
– Brandon Foltz. 
Venkatesh Vinayakarao 22

More Related Content

What's hot

CC282 Unsupervised Learning (Clustering) Lecture 7 slides for ...
CC282 Unsupervised Learning (Clustering) Lecture 7 slides for ...CC282 Unsupervised Learning (Clustering) Lecture 7 slides for ...
CC282 Unsupervised Learning (Clustering) Lecture 7 slides for ...
butest
 
Logistic regression
Logistic regressionLogistic regression
Logistic regression
saba khan
 
KNN Algorithm - How KNN Algorithm Works With Example | Data Science For Begin...
KNN Algorithm - How KNN Algorithm Works With Example | Data Science For Begin...KNN Algorithm - How KNN Algorithm Works With Example | Data Science For Begin...
KNN Algorithm - How KNN Algorithm Works With Example | Data Science For Begin...
Simplilearn
 
K Means Clustering Algorithm | K Means Clustering Example | Machine Learning ...
K Means Clustering Algorithm | K Means Clustering Example | Machine Learning ...K Means Clustering Algorithm | K Means Clustering Example | Machine Learning ...
K Means Clustering Algorithm | K Means Clustering Example | Machine Learning ...
Simplilearn
 

What's hot (20)

Gradient Boosting
Gradient BoostingGradient Boosting
Gradient Boosting
 
Stock price prediction using Neural Net
Stock price prediction using Neural NetStock price prediction using Neural Net
Stock price prediction using Neural Net
 
Prescriptive Analytics
Prescriptive AnalyticsPrescriptive Analytics
Prescriptive Analytics
 
K mean-clustering algorithm
K mean-clustering algorithmK mean-clustering algorithm
K mean-clustering algorithm
 
Reinforcement learning:policy gradient (part 1)
Reinforcement learning:policy gradient (part 1)Reinforcement learning:policy gradient (part 1)
Reinforcement learning:policy gradient (part 1)
 
Introduction to Bayesian Statistics
Introduction to Bayesian StatisticsIntroduction to Bayesian Statistics
Introduction to Bayesian Statistics
 
CC282 Unsupervised Learning (Clustering) Lecture 7 slides for ...
CC282 Unsupervised Learning (Clustering) Lecture 7 slides for ...CC282 Unsupervised Learning (Clustering) Lecture 7 slides for ...
CC282 Unsupervised Learning (Clustering) Lecture 7 slides for ...
 
Logistic regression
Logistic regressionLogistic regression
Logistic regression
 
Introduction to Maximum Likelihood Estimator
Introduction to Maximum Likelihood EstimatorIntroduction to Maximum Likelihood Estimator
Introduction to Maximum Likelihood Estimator
 
Predictive analytics
Predictive analytics Predictive analytics
Predictive analytics
 
Spss as a research tool
Spss  as a research tool Spss  as a research tool
Spss as a research tool
 
KNN Algorithm - How KNN Algorithm Works With Example | Data Science For Begin...
KNN Algorithm - How KNN Algorithm Works With Example | Data Science For Begin...KNN Algorithm - How KNN Algorithm Works With Example | Data Science For Begin...
KNN Algorithm - How KNN Algorithm Works With Example | Data Science For Begin...
 
Multivariate Analysis
Multivariate AnalysisMultivariate Analysis
Multivariate Analysis
 
Implement principal component analysis (PCA) in python from scratch
Implement principal component analysis (PCA) in python from scratchImplement principal component analysis (PCA) in python from scratch
Implement principal component analysis (PCA) in python from scratch
 
Predictive Analytics - An Introduction
Predictive Analytics - An IntroductionPredictive Analytics - An Introduction
Predictive Analytics - An Introduction
 
Random forest algorithm
Random forest algorithmRandom forest algorithm
Random forest algorithm
 
Bayesian intro
Bayesian introBayesian intro
Bayesian intro
 
Unsupervised learning: Clustering
Unsupervised learning: ClusteringUnsupervised learning: Clustering
Unsupervised learning: Clustering
 
K Means Clustering Algorithm | K Means Clustering Example | Machine Learning ...
K Means Clustering Algorithm | K Means Clustering Example | Machine Learning ...K Means Clustering Algorithm | K Means Clustering Example | Machine Learning ...
K Means Clustering Algorithm | K Means Clustering Example | Machine Learning ...
 
Policy gradient
Policy gradientPolicy gradient
Policy gradient
 

Recently uploaded

Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
Bertram Ludäscher
 
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
gajnagarg
 
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
nirzagarg
 
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
vexqp
 
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
nirzagarg
 
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi ArabiaIn Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
ahmedjiabur940
 
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...
nirzagarg
 
Lecture_2_Deep_Learning_Overview-newone1
Lecture_2_Deep_Learning_Overview-newone1Lecture_2_Deep_Learning_Overview-newone1
Lecture_2_Deep_Learning_Overview-newone1
ranjankumarbehera14
 
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
gajnagarg
 

Recently uploaded (20)

Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
 
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
 
20240412-SmartCityIndex-2024-Full-Report.pdf
20240412-SmartCityIndex-2024-Full-Report.pdf20240412-SmartCityIndex-2024-Full-Report.pdf
20240412-SmartCityIndex-2024-Full-Report.pdf
 
Kings of Saudi Arabia, information about them
Kings of Saudi Arabia, information about themKings of Saudi Arabia, information about them
Kings of Saudi Arabia, information about them
 
Ranking and Scoring Exercises for Research
Ranking and Scoring Exercises for ResearchRanking and Scoring Exercises for Research
Ranking and Scoring Exercises for Research
 
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
 
Dubai Call Girls Peeing O525547819 Call Girls Dubai
Dubai Call Girls Peeing O525547819 Call Girls DubaiDubai Call Girls Peeing O525547819 Call Girls Dubai
Dubai Call Girls Peeing O525547819 Call Girls Dubai
 
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
 
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
 
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi ArabiaIn Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
 
SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...
SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...
SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...
 
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...
 
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
 
Gulbai Tekra * Cheap Call Girls In Ahmedabad Phone No 8005736733 Elite Escort...
Gulbai Tekra * Cheap Call Girls In Ahmedabad Phone No 8005736733 Elite Escort...Gulbai Tekra * Cheap Call Girls In Ahmedabad Phone No 8005736733 Elite Escort...
Gulbai Tekra * Cheap Call Girls In Ahmedabad Phone No 8005736733 Elite Escort...
 
Aspirational Block Program Block Syaldey District - Almora
Aspirational Block Program Block Syaldey District - AlmoraAspirational Block Program Block Syaldey District - Almora
Aspirational Block Program Block Syaldey District - Almora
 
Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...
Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...
Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...
 
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24  Building Real-Time Pipelines With FLaNKDATA SUMMIT 24  Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
 
High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...
High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...
High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...
 
Lecture_2_Deep_Learning_Overview-newone1
Lecture_2_Deep_Learning_Overview-newone1Lecture_2_Deep_Learning_Overview-newone1
Lecture_2_Deep_Learning_Overview-newone1
 
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
 

Bayesian data analysis

  • 1. Bayesian Data Analysis and Beta Distribution Venkatesh Vinayakarao IIIT Delhi, India. Thomas Bayes, 1701 to 1761 IIIT Delhi – Technical Talk, Ketchup Series. 12th Nov 2014.
  • 2. Agenda Updating Beliefs using Probability Theory Role of Beta Distributions Will Discuss Concepts Illustrations Intuitions Purpose Properties Will not Discuss Details Definitions Formalism Derivations Proofs 11/12/2014 Venkatesh Vinayakarao 2
  • 3. The Case of Coin Flips General Assumption: If a coin is fair! Heads (H) and Tails (T) are equally likely. But, coin need not be fair  Experiment with Coin - 1 Venkatesh Vinayakarao 3 HHHTTTHTHT Experiment with Coin - 2 HHHHHHHHHT Coin-1 more likely to be fair when compared to coin-2.
  • 4. Our Beliefs • Can we find a structured way to determine coin’s nature? Venkatesh Vinayakarao 4 Coin-1 Data Observed None H T H T Belief Fair Skewed Fair Skewed Fair Coin-2 Data Observed None H H H H Belief Fair Skewed More Skewed Even More… Even Even More… Prior Belief Belief Updates
  • 5. Strong Prior Priors • Priors can be strong or weak Coin is lab tested for 1 Million Tosses. 50% H, 50% T observed. One more observation will not change our belief significantly. Venkatesh Vinayakarao 5 Weak Prior New Coin A few observations sufficient to change our belief significantly.
  • 6. HyperParameter • Prior probability (of Heads) could be anything: • O.5  Fair Coin • 0.25  Skewed towards Tails • 0.75  Skewed towards Heads • 1  Head is guaranteed! • 0  Both sides are Tails. We use θ as a HyperParameter to visualize what happens for different values. Venkatesh Vinayakarao 6
  • 7. World of Distributions Discrete Distribution of Prior. Since I typically perceive coins as fair, Prior belief peaks at 0.5. Venkatesh Vinayakarao 7
  • 8. Another Possibility I may also choose to be unbiased! i.e., θ may take any value equally likely. A Continuous Uniform Distribution! Venkatesh Vinayakarao 8
  • 9. Observations Let’s flip the coin (N) 5 times. We observe (z) 3 Heads. Venkatesh Vinayakarao 9
  • 10. Impact of Data Belief is influenced by Observations. But, note that: Belief ≠ observation Bayes’ Rule Eeks… what’s in the denominator? Venkatesh Vinayakarao 10
  • 11. Numerator is easy • p(θ) was uniform. So, nothing to calculate. • How to calculate p(D|θ)? Venkatesh Vinayakarao 11 Jacob Bernoulli 1655 – 1705. θ푧 1 − θ 푛−푧 If D observed is HHHTT and θ is 0.5, We have: p(D|θ) = (0.5)3 1 − 0.5 5−3 Remember, two things: 1)we are interested in the distribution 2) Order of H,T does not matter.
  • 12. Bayesian Update Venkatesh Vinayakarao 12
  • 13. Painful Denominator • Recall, for discrete distributions: • And, for continuous distributions: Venkatesh Vinayakarao 13
  • 14. A Simpler Way Form, Functions and Distributions Normal (or Gaussian) Poisson Venkatesh Vinayakarao 14
  • 15. What form will suit us? Venkatesh Vinayakarao 15
  • 16. Beta Distribution Vadivelu, a famous Tamil comedian. This is one of his great expression - terrified and confused. Venkatesh Vinayakarao 16
  • 17. Beta Distribution • Takes two parameters Beta(a,b) • For now, assume a = #H + 1 and b = #T + 1. • After 10 flips, we may end up in one of these three: Venkatesh Vinayakarao 17
  • 18. Prior and Posterior Let’s say we have a Strong Prior – Beta (11,11). What should happen if we see 10 more observations with 5H and 5T? Venkatesh Vinayakarao 18
  • 19. Prior and Posterior… What if we have not seen any data? Venkatesh Vinayakarao 19
  • 20. Conjugate Prior So, we see that: Such Priors that have same form are called Conjugate Priors Venkatesh Vinayakarao 20 Prior beta(a,b) Posterior beta(a+z,b+N-z) z Heads in N trials
  • 21. Summary Prior Likelihood Posterior Bayes’ Rule Bernoulli Distribution Beta Distribution Venkatesh Vinayakarao 21
  • 22. References Book on Doing Bayesian Data Analysis – John K. Kruschke. YouTube Video on Statistics 101: The Binomial Distribution – Brandon Foltz. Venkatesh Vinayakarao 22