# 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?

• How does this example differ from the answers to stats.stackexchange.com/questions/210741? (I'd vote to close this as a duplicate but on the other hand @Glen_b suggested in comments that the OP posts the specific example as a separate question) – Juho Kokkala May 4 '16 at 9:38
• More precisely there are 2 questions : Are they some conditions in order to use Gibbs sampling? Does the variables in the example fulfill these conditions? – Anthony Hauser May 4 '16 at 13:48

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.