1. Learn
  2. /
  3. Courses
  4. /
  5. Mixture Models in R

Connected

Exercise

Mixture of three Gaussian distributions

What will change if we incorporate another distribution into our simulation? You will see that increasing the number of components will spread the mass density to include the extra distribution, but the logic still follows from the previous exercise.

Instructions

100 XP
  • Create assignments, which takes the values 0, 1 and 2 with a probability of 0.3, 0.4 and 0.3, respectively.
  • The data frame mixture samples from a Gaussian with a mean of 5 and sd of 2, when assignments is 1. If assignments is 2, the mean is 10 and sd is 1. Otherwise, is a standard normal distribution.
  • Plot the histogram with 50 bins.