The algorithm can use three different variants on MCMC random walks: Gibbs sampling, the Metropolis algorithm, and the Metropolis-Hastings algorithms to move through univariate anm.mc.norm
and bivariate normal probability space. The jumping distribution is also bivariate normal with a mean vector at the current bivariate coordinates. The jumping kernel modifies the jumping distribution through multiplying the variance covariance of this distribution by the specified constant.
anm.mc.bvn(start = c(-4, -4), mu = c(0, 0), sigma = matrix(2, 2, data = c(1, 0,
0, 1)), length = 1000, sim = "M", jump.kernel = 0.2, xlim = c(-4, 4),
ylim = c(-4, 4), interval = 0.01, show.leg = TRUE, cex.leg = 1, ...)anm.mc.norm(start = -4, mu = 0, sigma = 1, length = 2000, sim = "M",
jump.kernel = 0.2, xlim = c(-4, 4), ylim = c(0, 0.4), interval = 0.01,
show.leg = TRUE,...)
anm.mc.bvn.tck()
The function returns two plots. These are: 1) the proposal bivariate normal distribution in which darker shading indicates higher density, and 2) an animated plot showing the MCMC algorithm walking through the probability space.
A two element vector specifying the bivariate starting coordinates.
A two element vector specifying the mean vector for the proposal distribution.
A 2 x 2 matrix specifying the variance covariance matrix for the proposal distribution.
The length of the MCMC chain.
Simulation method used. Must be one of "G"
indicating Gibbs sampling, "M"
indicating the Metropolis algorithm, or "MH"
indicating the Metropolis-Hastings algorithm (Gibbs sampling is not implemented for anm.mc.norm
).
A number > 0 that will serve as a (squared) multiplier for the proposal variance covariance. The result of this multiplication will be used as the variance covariance matrix for the jumping distribution.
A two element vector describing the upper and lower limits of the x-axis.
A two element vector describing the upper and lower limits of the y-axis.
Animation interval
Logical. Indicating whether or not the chain length should be shown.
Character expansion for legend.
Additional arguments from plot
.
Ken Aho
Gelman, A., Carlin, J. B., Stern, H. S., and D. B. Rubin (2003) Bayesian Data Analysis, 2nd edition. Chapman and Hall/CRC.