Exercises
Next is a series of short exercises. They start easy and increase in difficulty. Answers to all the exercises are given in the Answers_to_Exercises_Chap2.ipynb
Jupyter notebook in the GitHub repository. The exercises are a mix of code exercises and mathematical derivation exercises – this is designed to get you to start flexing your mathematical muscles. Give them a go and have fun:
- Use the
numpy
package to sample 1,000 random values from a Beta distribution with α = 2, β = 5, and plot a histogram of the resulting 1,000 values. - A mixture distribution is a distribution where the random variable has a certain specified probability of coming from one distribution, a certain specified probability of coming from a second distribution, a certain specified probability of coming from a third distribution, and so on. The number of different distributions is called the number of components in the mixture. We have a two-component mixture distribution,...