Y <- mvrnorm(n, mu, Sig) # sample mvn data
z.z <- mahalanobis(Y, mu, Sig)
hist(z.z, probability = TRUE, xlab="z'z",
main="Multivariate Normal to Chi-square Distribution")
lines(seq(0, 20, .01), dchisq(seq(0, 20, .01), ncol(Sig)), col='red', lwd=2)
legend("topright", c("Chi-sq Dist w/ df=5"), lty=1, col='red')
@
\LARGE
\subsection{Marginal Distribution of Multivariate Normal}
If $\mathbf{y} \sim N_p(\boldsymbol\mu, \boldsymbol\Sigma)$, then
\begin{enumerate}
\item The marginal of any element of $\mathbf y$ is univariate normal. That is, $y_j \sim N(\mu_j, \sigma_{jj}), \;\;j=1, 2, \ldots, p$.
\item If $\sigma_{jk}=0 \iff$ $y_j$ and $y_k$ are independent.\footnote{Note that, this is not necessarily true for non-normal random variables.}
\end{enumerate}
Similarly, if we consider any arbitrary partition of $\mathbf{y}$ into two subvectors such as
$$
\mathbf y = \begin{pmatrix}
\mathbf y_1 \\
\mathbf y_2
\end{pmatrix}, \;\;\; \boldsymbol \mu=
\begin{pmatrix}
\boldsymbol \mu_1 \\
\boldsymbol \mu_2
\end{pmatrix}, \;\;\; \boldsymbol \Sigma=
\begin{pmatrix}
\boldsymbol \Sigma_{11} & \boldsymbol \Sigma_{12}\\
\boldsymbol \Sigma_{21} & \boldsymbol \Sigma_{22}
\end{pmatrix},
$$
where $\mathbf y_1$ and $\boldsymbol \mu_1$ are $r \times 1$ and $\boldsymbol \Sigma_{11}$ is $r \times r$, then,
\begin{enumerate}
\item The marginal of any subset of $\mathbf y$ is multivariate normal. That is, $\mathbf y_1 \sim N_r (\boldsymbol \mu_1, \boldsymbol \Sigma_{11}).$
\item If $\boldsymbol \Sigma_{12}=\mathbf{O} \iff$ $\mathbf y_1$ and $\mathbf y_2$ are independent.\footnotemark[1]
\end{enumerate}