# Correlation between non-central chi squared & Gaussian

Is there an analytical result for the correlation between a (non-central) chi-squared distribution (parameters $d, \lambda$) and a standard Gaussian?

More practically, I'm looking to sample two datasets - one from a non-central $\chi^2$ and another from a standard Gaussian, and I need the two datasets to have correlation $\rho$. Is there a way to do this?

Denote $Z$ the standard normal with $\mu_z=1,\;\; \sigma_z =1$ and $Y$ the non-central chi-square, which is the sum of $d$ independent normals with unit means, but with non-zero means, $\mu_1,...,\mu_d$ (note that since the means may differ, we just need one of them to be non-zero, in order to obtain a non-central chi-square). In general we have

$$\lambda = \sum_{i=1}^d\mu_i^2, \;\;\; \sigma_y = \sqrt {2(d+2\lambda)}$$

The correlation coefficient is

$$\rho = \frac {{\rm Cov}(Z,Y)}{\sigma_z\cdot \sigma_y} = \frac {E(ZY)-\mu_z\mu_y}{\sigma_z\cdot \sigma_y}$$

$$\implies E(ZY) = \rho\sigma_y$$

So you are fixing the expected value $E(ZY)$. Decomposing $Y$,

$$E(ZY) = E(ZX_1^2) + ...+ E(ZX_d^2) = \rho\sigma_y$$

We can do with only one of the products being non-zero, say the first one so

$$E(ZY) = E(ZX_1^2) = \rho\sigma_y$$

So you need to start by a bivariate normal distribution in order to generate $Z$ and $X_1$, (both with unitary variances), and so characterized by a correlation coefficient $r$.

Now, by the Law of Iterated Expectations,

$$E(ZX_1^2) = E[X_1^2E(Z\mid X_1)]$$

Since $Z,X_1$ have a joing bivariate normal (where more over $Z$ is standard normal and $X_1$ has unitary variance), we have that

$$E(Z\mid X_1) = r(X_1 - \mu_1)$$

So

$$E(ZX_1^2) = E[X_1^2E(Z\mid X_1)] = E[X_1^2r(X_1 - \mu_1)] = rE(X_1^3) - r\mu_1E(X_1^2)$$

Since $X_1$ is a non-zero mean normal with unitary variance, we have that

$$E(X_1^3) = \mu_1^3 + 3\mu_1,\;\;\; E(X_1^2) = \mu_1^2 +1$$

Substituting, we get

$$E(ZX_1^2) = r[\mu_1^3 + 3\mu_1] - r\mu_1[\mu_1^2 +1]$$

$$\implies E(ZX_1^2) = 2r\mu_1$$

Therefore we want that

$$2r\mu_1 = \rho\sigma_y$$

(Attempt to) simplify your life by assuming that all other normals that form the non-central chi-square have zero mean and so are standard normals. This means that $\lambda = \mu_1^2$ and

$$\sigma_y = \sqrt {2(d+2\mu_1^2)}$$

The parameters $d,\mu_1, \rho$ are predetermined. So you can determine $r$ by

$$2r\mu_1 = \rho\sqrt {2(d+2\mu_1^2)} \implies r^* = \frac {\rho\sqrt {2(d+2\mu_1^2)}}{2\mu_1}$$

What is the price to pay for this oversimplified procedure? A bound is implicitly imposed on the value of $d$ since we want

$$r^* < 1 \implies \rho\sqrt {2(d+2\mu_1^2)} < {2\mu_1} \implies d < \frac {4(1-\rho^2)}{2\rho^2} \mu_1^2$$

This is interesting, for what it reveals (it comes from the fact that we generate the "non-central" character from just one of all the rv's that form $Y$).

If this constraint does not destroy it for you, then:

1) Generate samples from two correlated normal random variables, that have a bivariate normal distribution, the one standard normal $Z$, the other $X_1$ with unit variance, mean $\mu_1 = \sqrt {\lambda}$, and with correlation coefficient $r^*$. This is a well-known procedure.

2) Square $X_1$.

3) Generate $d-1$ independent (from $X_1$ and $Z$, and between them) standard normals and square them.

4) Add these squared $d-1$ rv's to the $X_1^2$ to obtain $Y$.

5) $Y$ and $Z$ are the variables you want.

I wrote all these in a bit of a hurry, so please simulate and verify.

• Thanks for the comprehensive answer. I'll run the simulation and get back to you. Sep 27, 2015 at 22:29
• I've run the simulation and it works as predicted. It appears that $r^*$ is usually very close to $\rho$ for the cases I run, as $\mu_1 \gt \gt d$. For the cases where $|r^*| > 1$, I've just set $r^* := \pm 1$ Oct 1, 2015 at 17:07
• Indeed, if $\mu_1 \gt \gt d$ then $r^* \approx \rho$. Good that I did not make any silly mistake. Oct 1, 2015 at 17:11
• For $d \lt 1$ though, there's an issue - we would not be able to write $\chi^2_d(\lambda) = \chi^2_1(\lambda) + \chi^2_{d-1}$, as is the case here. In fact, when $d \lt 1$, we would have to use $\chi^2_d(\lambda) \sim \chi^2_{d + 2N}$, where $N \sim Poisson(\frac{\lambda}{2})$. This complicates matters even further, unfortunately. Oct 1, 2015 at 17:42
• As you write, a chi-square random variable with degrees of freedom less than one, no longer corresponds to a squared normal in the way the generating algorithm in my answer relies on. Oct 1, 2015 at 17:45