Question

Question 2 a. Show that, for the exponential model with gamma prior, the posterior Π(9121m) under n observations can be computed as the posterior given a single observation xn using the prior q(の는 1101r1:n-1). Give the formula for the parameters (an,ßn) of the posterior ll(θ|X1:n, α0,Ao) as a function of (an-1, Bn-1). b. Visualize the gradual change of shape of the posterior II(01:n, ao, Bo) with increasing n: . Generate n 256 exponentially distributed samples with parameter θ-1. . Use the values ao -2, βο 0.2 for the hyperparameters of the prior. . Visualize the updated posterior distribution after n--{4,8, 16, 256), in the range θ e [0,4]. Plot all curves into the same figure and label each curve. Hint: The gamma function Г, which occurs in the definition of the gamma density, is implemented in R as gamma. When you have to compute a product over several data points, you might run into numerical problems with this function. One possible workaround to first compute the log-likelihood and then take its exponential exp(log(p(ziI:n; a, B))). The logarithm of the gamma function is implemented in R as a separate function lgamma. . Comment on the behavior of the posterior distribution as n increases.

0 0
Add a comment Improve this question Transcribed image text
Know the answer?
Add Answer to:
Question 2 a. Show that, for the exponential model with gamma prior, the posterior Π(9121m) under...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT