How do I calculate the parameters of a non-central chi-squared distribution if I know everything about my original Gaussian distribution?

282 Views Asked by At

I generate some Gaussian data (10,000 points) with (for example):

mean = 3.0

std = 1.0

And I fit a Gaussian function to it:

enter image description here

So far so good. Next I square each of my 10,000 data points. I believe that gives me a non-central chi-squared distribution:

enter image description here

I was told that I need 2 parameters for the non-central chi-squared PDF:

degrees of freedom (df).

non-centality parameter (nc).

I believe my degree of freedom is just 1?

I was also told that I can get the non-centrality parameter by just squaring the mean of the original Gaussian distribution. So my nc=9 and this PDF nicely fits the histogram again:

enter image description here

However, I am realizing that the fit only works when my original Gaussian data has a standard deviation of 1. If I change the standard deviation in the Gaussian data (away from 1), the non-central chi-squared PDF no longer fits the data (with df=1 and nc=9).

This makes sense - of course the shape of the non-central chi-squared histogram will change if the standard deviation of the Gaussian data changes. But standard deviation currently doesn't feature in the parameters for my non-central chi-squared PDF.

My questions:

Is the degree of freedom 1?

How do I calculate the non-centrality parameter if I know everything about my original Gaussian distribution?

I don't know if it is important, but I am using scipy for my non-central chi-squared PDF: https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.ncx2.html

1

There are 1 best solutions below

0
On

Let $X_1,\ldots,X_n$ be independent random variables and $X_i \sim N(\mu_i,\sigma^2))$, $i=1,\ldots,n$. The distribution of the random variable $$Y =\frac{X^2_1+\ldots+X^2_n}{\sigma^2}$$ is called the noncentral chi-square distribution. It is typically denoted by $\chi^2_n(\delta)$, where $$ \delta:= \frac{\mu^2_1 + \ldots + \mu^2_n}{\sigma^2}$$ is the noncentrality parameter. The usual chi-square distribution $\chi^2_n$ corresponds to thespecial case of the noncentral chi-square distribution $\chi^2_n(\delta)$ with $\delta= 0$.

It can be shown that $Y$ has a an absolutely continuous distribution (relative to Lebesgue measure) with density

\begin{align} f_{\delta,n}(x):= e^{-\delta/2}\sum_{j\geq0}\frac{\delta^j}{2^j\,j!}\phi_{2j+n}(x) \end{align} where $\phi_\ell$ is the density (with respect to Lebesgue measure) of the standard chi-square distribution $\chi^2_\ell$.

In the case of the OP, $\mu_j=3$ for all $1\leq j\leq 10^4$, and $\sigma=1$. Then, each $X^2_j\sim\chi^2_1(9)$