Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

4. Bayesian inference using Metropolis-Hastings algorithm. (25 points) Implement the Metropolis algorithm. Parameter for binomial distribution is probability of success o ( [0, 1], n

image text in transcribed
4. Bayesian inference using Metropolis-Hastings algorithm. (25 points) Implement the Metropolis algorithm. Parameter for binomial distribution is probability of success o ( [0, 1], n = 20. Assume the observed data vector gives S, = 5. (a) (5 points) Assume the prior distribution as in our lecture, (() = 2 cos-(4TO). Gener- ate samples from the posterior distribution (#|Y). Discretize / to be a uniform grid of points [0, 1/10, ..., 1]. Run the chain for n = 100, 500, 1000, and 5000 time steps, respectively. For each time step, compare the empirical distributions with the desired posterior distribution (0|Y). (Hint: you may use ergodicity: hence the distribution of states can be estimated from one sample path when the number of time steps is large (e.g. 500).) (b) (10 points) Following from the previous question, evaluate the mean of the poste- rior distribution (this gives an estimator for the parameter value), and E"(){[e - 1/212} = S(0 - 1/2)2n ( 0 |Y ) de. (c) (10 points) Now assume the the prior distribution is given by (@) is a uniform distribution over [0, 1]. Repeat the above questions, (a) and (b)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Algebra And Trigonometry, Enhanced

Authors: Cynthia Y Young

4th Edition

1119320860, 9781119320869

More Books

Students also viewed these Mathematics questions