# Gibbs sampling from full conditionals

I have the following joint density:

$p(x_1,x_2,y_1,y_2) \propto \exp\left(−\left(x_1^2+x_2^2+c_1(y_2-y_1)^2+c_2(y_2-y_1)^4\right)\right)$

Can I use Gibbs sampling to sample from that? How can I get the full conditional distributions, and how can I draw samples from those conditional distributions which are quite complicated I think?

• Note that $p(x_1,x_2,y_1,y_2)=f(x_1)g(x_2)h(y_1,y_2)$. What does this tell us about the independence of the random variables? – Zen Feb 20 '13 at 3:13
• Also: are you sure about that $4$ in the exponent? – Zen Feb 20 '13 at 3:18
• would you know how to sample from $p(y) \propto \exp\left(−\left(c_1 y^2+c_2 y^4\right)\right)$ or more generally from $p(y;\mu) \propto \exp\left(−\left(c_1(y-\mu)^2+c_2(y-\mu)^4\right)\right)$? – Glen_b Feb 20 '13 at 4:44
• Thank you both, this is just a toy example from a more complex system, and I don't know how to sample from: p(y;μ)∝exp(−(c1(y−μ)2+c2(y−μ)4)). – user21048 Feb 20 '13 at 13:31
• It happens that $X_1$, $X_2$ and $(Y_1,Y_2)$ are independent. Hence, sampling $X_1$ and $X_2$ is easy: they are independent normals. You can sample $(Y_1, Y_2)$ using random walk metropolis. It is difficult to believe that your model has that $4$ in the exponent of the density. – Zen Feb 20 '13 at 23:44