# Generating random values from non-normal and correlated distributions

I have a random variable X that is a mixture of a binomial and two normals (see what the probability density function would look like (first chart))
and I have another random variable Y of similar shape but with different values for each normally distributed side.

X and Y are also correlated, here's an example of data that could be plausible :

    X     Y
1.  0    -20
2. -5     2
3. -30    6
4.  7    -2
5.  7     2


As you can see, that was simply to represent that my random variables are either a small positive (often) or a large negative (rare) and have a certain covariance.

My problem is : I would like to be able to sample correlated and random values from these two distributions.

I could use Cholesky decomposition for generating correlated normally distributed random variables, but the random variables we are talking here are not normal but rather a mixture of a binomial and two normals.

Many thanks!

-
is the same bernoulli trial used to generate X and Y - or are they different? and if the latter - are they also correlated in some way? –  ronaf Dec 17 '10 at 4:01
@ronaf No it is not the same bernoulli trial. Each variable has a different % to choose between 2 normal distribution (of course for each variable, these % equal to 1 but it might be 80-20 or 70-30, etc.) I would say that each's variable bernoulli trial are not correlated but maybe I am wrong...I am not sure because can't we say that 'everything' is correlated somehow? How could I be sure if they are correlated or not? Kind regards –  ibiza Dec 17 '10 at 13:49
Seeing that there is no more answers and comments, I suggest moving this question to stats.stackexchange.com –  mpiktas Dec 20 '10 at 9:18

If you want to sample $(X,Y)$ you need to find out what is their distribution function. If you know the the conditional densities $p(X|Y)$ and $p(Y|X)$ you can use Gibbs sampling.

-
Thanks for your answer, that might well be what I need. I will have a more thorough look tonight, but I am not sure how to calculate p(X|Y) and p(Y|X), maybe you could provide me a small heads-up for processing this meanwhile? Kind regards –  ibiza Dec 17 '10 at 13:42
What is the relationship between $X$ and $Y$? Sometimes if you know the relationship the conditional density is very easy to construct. For example if you know that $X$ is normal with mean $Y$ and standard error $\sigma$, then $p(X|Y)~N(Y,\sigma^2)$. –  mpiktas Dec 17 '10 at 14:44
It is important to note that X and Y are neither normal...this is what complicates the problem I believe. How can I find the relationship between X and Y if they are not normal? I am able to compute their covariance (and correlation) though, from the sample data that I have on hand at least –  ibiza Dec 17 '10 at 14:53