Sale!

# Homework 1 Introduction & Single Parameter Models

\$30.00

Category:
Rate this product

Homework 1
Introduction & Single Parameter Models

Practice of Bayes Formula (3 × 10 points). Suppose that if θ = 1, then y has a
normal distribution with mean 1 and standard deviation σ, and if θ = 2, then y has
a normal distribution with mean 2 and standard deviation σ. Also, suppose Pr(θ =
1) = 0.5 and Pr(θ = 2) = 0.5.
1. For σ = 2, derive the formula for the marginal probability density for y, p(y),
and sketch/visualize it in R.
2. What is P r(θ = 1|y = 1), again supposing σ = 2?
3. Describe how the posterior density of θ changes in shape as σ is increased and
as it is decreased.
Guideline for Submission: submit a hard copy (handwritten or printed).
Normal distribution with unknown mean (3 × 10 points). A random sample
of n students is drawn from a large population, and their weights are measured. The
average weight of the n sampled students is ¯y = 150 pounds. Assume the weights in
the population are normally distributed with unknown mean θ and known standard
deviation 20 pounds. Suppose your prior distribution for θ is normal with mean 180
and standard deviation 40.
2. A new student is sampled at random from the same population and has a weight
of ˜y pounds. Give a posterior predictive distribution for ˜y. (Your answer will
still be a function of n.)
1
STATS 551, Unversity of Michigan Instructor: Yang Chen
3. For n = 10, give a 95% posterior interval for θ and a 95% posterior predictive
interval for ˜y. Do the same for n = 100.
Guideline for Submission: submit a hard copy (handwritten or printed).
Nonconjugate single parameter model (2 × 20 points). Suppose you observe
y = 285 from the model Binomial(500, θ), where θ is an unknown parameter. Assume
the prior on θ has the following form
p(θ) =



8θ, 0 ≤ θ < 0.25
8
3 −
8
3
θ, 0.25 ≤ θ ≤ 1
0, otherwise.
1. Compute the unnormalized posterior density function on a grid of m points
for some large integer m. Using the grid approximation, compute and plot the
normalized posterior density function p(θ|y), as a function of θ.
2. Sample 10000 draws of θ from the posterior density and plot a histogram of
the draws.
Guideline for Submission: submit R markdown (or jupyter notebook) with annotated
code followed by results. Discussions about the results should follow the results.