MTH5540 Applied Class 8 Problem Set
Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit
MTH5540 Applied Class 8 Problem Set
1. Suppose we want to sample a distribution p(x) using the Metropolis-Hastings (MH) sampler with a proposal distribution, q(x, x\ ). Complete the following tasks:
(a) Derive the transition kernel k(x, x\ ) of the Markov chain defined by the MH sampler. (b) Show that the detailed balance condition
p(x)k(x, x\ ) = p(x\ )k(x\ , x)
hold for the transition kernel in (a).
(c) Assume irreducibility, recurrence and aperiodicity hold. Supposing a transition kernel k(x, x\ ) satisfies the detailed balance, show that p(x) is the limit distribution of the Markov chain generated by k(x, x\ ).
2. Let X = (X1 , . . . , Xn) be n integer observations. The zero-inflated Poisson (ZIP) model is defined as follows:
p ~ U (0, 1)
λlp ~ Γ(a, b)
rilp, λ ~ Ber(p)
xilr, λ ~ Pois(λri)
where a, b are known and i = 1, . . . , n. Use a = b = 1 in the following.
(a) Derive the (unnormalised) joint posterior distribution for p and λ, given n independent draws from a
ZIP model.
(b) Simulate drawing n = 100 integers from a ZIP data model with p = 0.1 and λ = 10.
(c) Implement an adaptive Metropolis sampler to sample N = 1000 values of p and λ from the posterior distribution you derived in part (a), given the data generated in part (b).
(d) Plot time-series and a scatterplot for p and λ drawn from the Markov chain. Also plot approximate posterior marginal densities of p and λ, plot auto-covariance functions for the two parameters and assess sampler performance.
2023-06-01