# Sum of squares of IID normal distributions (arbitrary mean and variance)

If I have n IID normal random variables, and I sum their squares, what does the resulting cummulative distribution (cdf) look like?

This is where I've gotten so far:

$Y = \sum_{i=1}^nX_i^2$ where $X_i \sim \mathcal{N}(\mu, \sigma^2)$

$Y = \sigma^2\sum_{i=1}^n\frac{X_i^2}{\sigma^2}$

$Y = \sigma^2\sum_{i=1}^nZ_i^2$ where $\frac{X_i}{\sigma} = Z_i \sim \mathcal{N}(\frac{\mu}{\sigma}, 1)$

$\therefore Y = \sigma^2B$ where $B \sim \chi^2(k = n, \lambda = n\frac{\mu^2}{\sigma^2})$ (non-central chi squared)

Now I want to find the cdf, so I started with the pdf:

$f_Y(y) = f_B(g^{-1}(y))|\frac{d}{dy}g^{-1}(y)|$ where $g(b) = \sigma^2b \implies g^{-1}(b) = \frac{b}{\sigma^2}$

$\therefore f_Y(y) = f_B(\frac{b}{\sigma^2})\frac{1}{\sigma^2}$

$F_y(y) = \int_{-\infty}^yf_Y(t)dt = \frac{1}{\sigma^2}\int_{-\infty}^yf_B(\frac{t}{\sigma^2})dt$

Let $u = \frac{t}{\sigma^2} \implies dt = \sigma^2du$

$F_y(y) = \frac{1}{\sigma^2}\int_{-\infty}^y\sigma^2f_B(u)du$

$\therefore F_Y(y) = F_B(y)$

Unfortunately, this doesn't seem to be correct. I used matlab to attempt to find the percentile of a particular value by doing cdf('ncx2', value, n, n*mu^2/sigma^2);, and I get 0.

The data is all physical, so I know I should get something that makes sense. My distribution $X_i$ is a distribution of square roots of the delay of a circuit, and I want to find the cdf of the total delay of n circuits in series.

There is a mistake in $$F_Y(y) = \frac{1}{\sigma^2}\int_{-\infty}^y\sigma^2f_B(u)\text{u}$$as it should be$$F_Y(y) = \frac{1}{\sigma^2}\int_{-\infty}^{y/\sigma^2}\sigma^2f_B(u)\text{d}u$$resulting in$$F_Y(y)=F_B(y/\sigma^2)$$