I am trying to figure out the distribution of

$$

(n-1) \sum_{i=1}^n Z_i^2 – \left( \sum_{i=1}^n Z_i \right)^2 \qquad (*)

$$

where $Z_i \sim \mathcal{N}(0,1)$, i.i.d. I know that, taking each of the terms separately,

$$

\sum_{i=1}^n Z_i^2 \sim \chi^2(n)

$$

and

$$

\frac{1}{n}\left( \sum_{i=1}^n Z_i \right)^2 \sim \chi^2(1).

$$

But I am unsure about the distribution of (*)

**Answer**

Here is an *attempt*:

Consider $Z=X-Y$ such that $X \sim \chi^2(\alpha)$ and $Y \sim \chi^2(\beta)$

with $\alpha \geq \beta$

$$

\mathcal{M}_X(t) = \left(1-2 \, t\right)^{-\alpha/2}

$$

$$

\mathcal{M}_Y(t) = \left(1-2 \, t\right)^{-\beta/2}

$$

$$

\mathcal{M}_Z(t) = M_X(t)M_Y(-t) = \left(1-2 \, t\right)^{-\alpha/2}\left(1+2 \, t\right)^{-\beta/2} = (1-4t^2)^{-\beta/2}

$$

$$

\mathcal{M}_Z(t) = (1-2t)^{-n/2}(1+2t)^{-1/2} = (1-4t^2)^{-1/2} (1-2t)^{-(n-1)/2}

$$

I am not sure if it can be reduced to a fathomable MGF.

**Attribution***Source : Link , Question Author : Zailei Chen , Answer Author : rightskewed*