Please use D2L to turn in both the HTML output and your R Markdown file in.

### Q1. (8 pts)

The probability density function of the beta distribution can be written as: $p(x|\alpha, \beta) = x^{\alpha -1} (1-x)^{\beta -1} \frac{\Gamma(\alpha) \Gamma(\beta)}{\Gamma(\alpha + \beta)},$ for $$x \in [0,1]$$.

Plot the density function for a beta distribution with:

• $$\alpha = 1,$$ $$\beta = 1$$
• $$\alpha = 15,$$ $$\beta = 3$$
• $$\alpha = 150,$$ $$\beta = 30$$.

How do the values of $$\alpha$$ and $$\beta$$ change the distribution?

### Q2. (8 pts)

Simulate 1000 observations from each of the distributions below:

• Normal(7,9)
• Uniform(0,1)
• Beta(1,1)
• Beta(15,3)

Use the samples from each distribution to calculate the mean and variance. How do your calculations compare with the known mean and variance from these distributions?

### Q3. (4 pts)

A main emphasis in Bayesian statistics is to think about the entire distribution of possibilities, rather than a point interval.

• Discuss how inferences could be different for two distributions with the same mean, but different variances.
• Discuss how inferences could be different for two distributions with the same mean and variance, but different HDI.