[R] Metropolis-within-Gibbs algorithm

Maram SAlem marammagdysalem at gmail.com
Thu Feb 4 11:31:21 CET 2016


Hi all,

I'm trying to write a code that performs the Metropolis-within-Gibbs
algorithm, to draw values of a 2x1 parameter vector from a posterior
distribution that doesn't have a well known form.

So one of the parameters, theta1, has a well known full conditional
distribution( for which the gibbs sampler can be used), but the other,
theta2, doesn't have a well known full conditional (for which a random walk
Metropolis-Hastings algorithm should be used). But theta1 depends on the
generated value of theta 2.

I know this code can be hand-written, but is there any package that can
perform such update of the Metropolis-within-gibbs algorithm and provide me
with acceptance rates or different scaling for the proposal distribution?
 I've checked the gibbs.met package but it used an independent proposal
distribution. I went through the MCMCpack but couldn't find a function that
performs what I want.

So is there any other packages that you recommend or do I have to write my
own functions?

Thanks for helping,
Maram Salem

	[[alternative HTML version deleted]]



More information about the R-help mailing list