11 Markov Chain Monte Carlo Methods
Q11.1
Repeat Example 11.1 for the target distribution Rayleigh(
Q11.2
Repeat Example 11.1 using the proposal distribution
Q11.3
Use the Metropolis-Hastings sampler to generate random variables from a standard Cauchy distribution. Discard the first 1000 of the chain, and compare the deciles of the generated observations with the deciles of the standard Cauchy distribution (see qcauchy
or qt
with df=1). Recall that a Cauchy(
The standard Cauchy has the Cauchy(
Q11.4
Refer to the Bayesian prediction application in Example 11.3, with the Geometric(
Q11.5
Refer to the Metropolis-Hastings sampler implemented in Examples 11.3 - 11.5. Data from a test on a second batch of parts is obtained. Again,
Q11.6
Implement a random walk Metropolis-Hastings sampler for generating the standard Laplace distribution (see Exercise 3.3.2). For the increment, simulate from a normal distribution. Compare the chains generated when different variances are used for the proposal distribution. Also, compute the acceptance rates of each chain.
Q11.7
What effect, if any, does the width
Q11.8
Rao presented an example on genetic linkage of 197 animals in four categories. The group sizes are (125, 18, 20, 34). Assume that the probabilities of the corresponding multinomial distribution are
Estimate the posterior distribution of
Q11.9
Implement a Gibbs sampler to generate a bivariate normal chain (
Q11.10
This example appears in [41]. Consider the bivariate density
It can be shown that for fixed
Q11.11
Modify the Gelman-Rubin convergence monitoring given in Example 11.11 so that only the final value of
Q11.12
Refer to Example 11.1. Use the Gelman-Rubin method to monitor convergence of the chain, and run the chain until the chain has converged approxiamtely to the target distribution according to coda
package to check for convergence of the chain ty the Gelman-Rubin method. Hints: See the help topics for the coda
functions gelman.diag
, gelman.plot
, as.mcmc
, and mcmc.list
.
Q11.13
Refer to Example 11.8. Use the Gelman-Rubin method to monitor convergence of the chain, and run the chain until the chain has converged approxiamtely to the target distribution according to coda
package to check for convergence of the chain ty the Gelman-Rubin method. (See Exercises 11.11 and 11.12.)
Q11.14
Refer to Example 11.9. Use the Gelman-Rubin method to monitor convergence of the chain, and run the chain until the chain has converged approxiamtely to the target distribution according to coda
package to check for convergence of the chain ty the Gelman-Rubin method. (See Exercises 11.11 and 11.12.)
Q11.15
Refer to the change point application in Section 11.5. Compute a 95% highest posterior density interval (HPDI) for each of the parameters HPDi
function in this chapter. Compare the results obtained by converting the chains into an mcmc
object, and use the coda::HPDinterval
method on that object.