# Probability distribution of $\frac{1}{\sigma^2}Y'AY$

If $A_{p\times p}$ is a non-random matrix, symmetric and idempotent matrix with $\mu_{p\times 1}=0$ and $\Sigma=\sigma^2 I_{p\times p}$, then $$V=\frac{1}{\sigma^2}Y'AY\sim \chi_r^2$$ where $Y_{p\times 1}\sim N(\mu,\Sigma)$ and $r=rank(A)$.

First I used the matrix properties of $A$, so $$V=\frac{1}{\sigma^2}Y'AY=\frac{1}{\sigma^2}Y'AAY=\frac{1}{\sigma^2}(AY)'AY$$

Let $Z_{p\times 1}=AY$ then $$V=\frac{1}{\sigma^2}Z'Z=\frac{1}{\sigma^2}\sum_{i=1}^pZ_i^2 \quad(*)$$

To find the distribution of $Z$ I used moment generating function

$$M_Z(t)=E[\exp(t'(AY)]=E[\exp(A't)'Y]=M_Y(t)(A't)$$ $$=\exp\Big(\frac{1}{2}t'(A\Sigma A')t\Big)$$ so $Z\sim N_p(0,A\Sigma A')$ and from marginalization propertie I know that each $Z_i$ have Normal distribution also.

The problem is that I don't find a way to link it with $(*)$

I'm not understanding well the relationsheep between the rank of $A$ and the degree of freedom in the chi-squared distribution. Why when I have $A=I_{p\times p}$ (identity matrix) I get that $V\sim \chi_p^2$?

• in first line you wrote ...matrix with rank=p, is it rank?? Commented Aug 13, 2017 at 17:59
• I think $Y_{p\times 1}\sim N(\mu, \sigma^2 I)$ Commented Aug 13, 2017 at 18:00

$V=\dfrac{1}{\sigma^2}Y'AY=\dfrac{1}{\sigma^2}Y'A'AY=\Big(\dfrac{AY}{\sigma}\Big)'\Big(\dfrac{AY}{\sigma}\Big)=Z'Z$
Now, $Z=\Big(\dfrac{AY}{\sigma}\Big)\sim N_p(0,A)$
So $V=Z'Z\sim {\chi_r}^2$
• I just don't understood well the degree of freedom in the chi-squared distribution. Why when $A=I$ (identity matrix) I have $p$ degree of freedom? Commented Aug 13, 2017 at 20:57
• @Roland furthermore, suppose $Z\sim N_p(0,I_{p\times p})$, where $Z=(Z_1,Z_2,\dots,Z_p)'$, then $Z_i\sim N(0,1)$. Then $Z^2_i\sim {\chi_1}^2$, then by additive nature of Gamma Distribution, $$\sum_{i=1}^{p}Z^2_i \sim {\chi_p}^2$$, Now note that $\sum_{i=1}^{p}Z^2_i=Z'Z$ Commented Aug 14, 2017 at 3:17