# Generate a finite mixture distribution by sampling mixture component parameters

Assume I have a some mixture distribution, $$H$$, with mean $$\mu$$ and variance $$\sigma^2$$. $$H$$ is a mixture of $$n$$ component distributions where all component weights are equal. Let $$\mu_i$$ be the mean of component distribution $$H_i$$ and $$\sigma^2_i$$ the variance of component distribution $$H_i$$.

Let $$X$$ be a random variable drawn from $$H$$. We then know that:

$$\text{E}[X]=\mu=\sum_{i=1}^n\frac{1}{n}\mu_i$$ and $$\text{E}[(X-\mu)^2]=\sigma^2=\sum_{i=1}^n[\frac{1}{n}(\mu_i^2+\sigma^2_i)]-\mu^2$$

Given the parameters $$\mu$$ and $$\sigma^2$$, is there a way to randomly sample a set of $$\mu_i$$ and $$\sigma_i^2$$ for each of the $$n$$ component distributions such that the above two constraints are met?

Sampling a set of means such that the first constraint is met is trivial, however, how to simultaneously sample the means and variances of all components to meet both constraints is not obvious to me.

• I'm not following this question because the two formulas you give don't say anything about any particular sample: they are both properties of $H$ alone. Could you therefore clarify what you mean by "the above two constraints are met"? (If perhaps you want the arithmetic mean and variance of the numbers in the sample to equal predetermined values, that can be done in myriad ways--you would need to stipulate many more properties of the intended sample for this question to be answerable in that case.) – whuber Nov 30 '18 at 21:27
• I want to break $H$ into $n$ component distributions. I want to specify each of the component distributions using using two parameters, mean and variance. In order for $H$ to be a "valid" mixture distribution, those two properties should hold. I think this is what you are suggesting by arithmetic mean and variance. Ideally, the parameters could be drawn from a Dirichlet distribution and then scaled as needed. This would allow me to control the amount of dispersion of the component means and variances. I'm trying to create a generative model for building a hierarchy/tree of mixtures. – Collin Nov 30 '18 at 21:53