Solution

ID: past-exam-of-the-mathematics-course-of-the-university-of-cambridge/2003/iii/paper-43/3/a/ii/solution

Hold all parameters except fixed and propose with . This random-walk Metropolis algorithm has a symmetric proposal distribution. Define
Cancellation of unchanged likelihood and prior factors gives the Metropolis–Hastings acceptance probability
Draw an independent uniform and accept if it is at most ; otherwise retain the old value. Update each component in turn, recomputing the needed mixture contributions. On a logarithmic scale, compare with to avoid numerical underflow.

New to topics? Read the docs here!