
The python code for the rejection sampling simulation can be found below.
The python code for the Gibbs sampling simulation can be found below.
The python code for the Metropolis-Hastings sampling simulation can be found below.
Let us assume that there are only three colors that a person can in principle choose from: blue, yellow and green.
The python code for the rejection sampling simulation can be found below.
The python code for the Metropolis-Hastings sampling simulation can be found below.
The procedure of iteratively calculating responsibilities and updating the distribution parameters is called Expectation-Maximization. For further details, please refer to the resources below.
Bayesian Statistics is a fascinating field and today the centerpiece of many statistical applications in data science and machine learning. In this course, we will cover the main concepts of Bayesian Statistics including among others Bayes Theorem, Bayesian networks, Enumeration & Elimination for inference in such networks, sampling methods such as Gibbs sampling and the Metropolis-Hastings algorithm, Bayesian inference and the relation to machine learning.
This course is designed around examples and exercises that provide plenty of opportunities to build intuition and apply your gathered knowledge. Many examples come from real-world applications in science, business or engineering or are taken from data science job interviews.
While this is not a programming course, I have included multiple references to programming resources relevant to Bayesian statistics. The course is specifically designed for students without many years of formal mathematical education. The only prerequisite is high-school level mathematics, ideally a first-year university mathematics course and a basic understanding of probability.