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

Q1. (10 pts)

Simulate the Mean and Variance of samples from a uniform(0,1) distribution.

Q2 (15 pts)

Recall the mixture distribution from HW1

a (5 pts)

Estimate the 95% HDI for this distribution.

b (10 pts)

Use the code below to take samples and estimate the mean and variance of this distribution.

num.samples <- 1000
samples <- ifelse(runif(1000) < .5, 0, 1)
samples[samples == 1] <- rgamma(sum(samples),5,1.5)