Hej,

I’d like two random variables, one that samples from a mixture of Gaussians and along with that a dependent OneHotCategorical random variable that represents that individual Gaussian from the mixture of Gaussians.

Let’s give it a try and first build a mixture of Gaussians:

```
from edward.models import Normal, Categorical, Mixture, Dirichlet, OneHotCategorical
mu = np.array([0.,1.,2.,3.], dtype=np.float32)
k=4
n=1000
d = Dirichlet(np.ones(k, dtype=np.float32))
c = Categorical(probs = d, sample_shape=(n))
components = [Normal(loc=mu[kk], scale=1., sample_shape=(n)) for kk in range(k)]
x = Mixture(cat=c, components=components, sample_shape=(n))
```

and another mixture of “deterministic” OneHotCategorical random variables

```
oneHotProbs = np.eye(k, k, dtype=np.float32)
oneHotProbs[oneHotProbs==0]=-1000
oneHotProbs[oneHotProbs==1]=1000
oneHotComponents = [OneHotCategorical(logits=oneHotProbs[kk,:], sample_shape=(n)) for kk in range(k)]
y = Mixture(cat=c, components=oneHotComponents, sample_shape=(n))
```

Are `x`

and `y`

coherently using the identical samples from `c`

?

Is there any way to check this? Or is there a simpler way to do this?

Cheers, Rasmus