# Gibbs sampling for mixed variables [duplicate]

Let X a continous variable and Y a binary variable with joint distribution : $$p(x,y;\beta,\rho_1,\rho_2,\phi_1,\phi_2)=\frac{1}{Z(\beta,\rho_1,\rho_2,\phi_1,\phi_2)}\exp(-0.5 \beta x^2+1_{y=0}\rho_1 x+1_{y=1} \rho_2 x+1_{y=0} \phi_1+1_{y=1} \phi_2)$$ with Z a normalising constant.

The conditional of X given Y is a Gaussian depending on Y and the conditional of Y given X is a Bernoulli variable whose probability $P(Y=1)$ is depending on X.

Is it possible to use Gibbs sampling?

## marked as duplicate by Juho Kokkala, Greenparker, kjetil b halvorsen, mpiktas, Christoph HanckMay 5 '16 at 8:50

Plainly you could use Gibbs sampling to generate from $(X,Y)$; there's nothing about the structure here that's out of the ordinary.
By inspection, the conditional distribution of $X|Y=y$ is normal; the conditional distribution of $Y|X=x$ is Bernoulli.