\appendix
\chapter{The multivariate normal distribution}\label{A:multivariate_normal}
In this chapter we recall basic concepts regarding the normal distribution for random vectors. We mention properties and results specifically related to our application, see Chapter \ref{C:da_bayesian}.

% ----------------- ------------------
\section{Probability density function (PDF)}
The multivariate normal distribution is a generalization to dimensions $d\geq 2$ of the univariate normal distribution. For the univariate case, a Gaussian random variable $X$ with mean $\mu$ and variance $\sigma^2$ has probabiltiy density function (PDF) 
\begin{equation}
f(x) = \dfrac{1}{\sqrt{2\pi\sigma^2}} exp\left\{-\dfrac{(x-\mu)^2}{2\sigma^{2}}\right\}\;\;\forall\;x\in(\infty,\,\infty),
\end{equation}
and it is denoted $X\sim\mathcal{N}(\mu,\,\sigma^2)$. 

In the multivariate case the formula is generalized to a vector $\xx\in\mathbb{R}^d$; in particular, the exponent has the form
\begin{equation}
(\xx - \boldsymbol{\mu})^{\TT}\Sigma^{-1}(\xx-\boldsymbol{\mu})
\end{equation}
where $\boldsymbol{\mu}\in\mathbb{R}^d$ represents the expected value of $X$ and $\Sigma$ is the covariance matrix of $X$, i.e. $\Sigma_{i,i} = var(X_i)$ and $\Sigma_{i,j} = \Sigma_{j,i} = cov(X_i,\,X_j)$ for $i,\,j= 1,\,...,\,d$. The matrix $\Sigma$ is assumed to be symmetric and positive definite (s.p.d.). The normalizing constant $1/\sqrt{2\pi \sigma^2}$ has to be generalized to a constant such that the volume under the density surface is unitary. It can be shown, see \cite{john_wich} that such constant is
\begin{equation}
\dfrac{1}{\sqrt{(2\pi)^{d} det(\Sigma)}}.
\end{equation}
Thus, the multivariate normal PDF has the form
\begin{equation}
f(\xx) = \dfrac{1}{\sqrt{(2\pi)^{d} det(\Sigma)}} exp\left\{-(\xx - \boldsymbol{\mu})^{\TT}\Sigma^{-1}(\xx-\boldsymbol{\mu})\right\}\;\;\forall\;x_i\in(\infty,\,\infty),\; i = 1,\,...,\,d
\end{equation}
and we say $X\sim\mathcal{N}(\boldsymbol{\mu},\,\Sigma)$. It is easy to show that $\boldsymbol{\mu}$ is the point of maximum density, mode and expected value.

\paragraph{Contour lines} Contours of constant density $c$ for the $d$-dimensional distribution are ellipsoids generated by the equation
\begin{equation}
(\xx - \boldsymbol{\mu})^{\TT}\Sigma^{-1}(\xx-\boldsymbol{\mu}) = c^2;
\end{equation}
these ellipsoids are centered in $\boldsymbol{\mu}$ and have axes $\pm c\sqrt{\lambda_j}{\bf e}_j$, where $\lambda_j$ are the eigen values of $\Sigma$ and ${\bf e}_j$ the associated eigenvectors for $j = 1,\,...,\,d$.
%%%%%%%%%%%%%%%%%%%%%%
\section{Properties of the multivariate normal distribution}\label{S:multivariate_properties}
In this section we introduce the chi-squared, $\chi^2$, distribution and we report a few properties which are relevant for results discussed in this chapter.
%%%%%%%%%%%%%%%%%%%%%%
\paragraph{The chi-squared distribution}  The chi-squared distribution with $d$ degrees of freedom is the distribution of a sum of the squares of $d$ independent standard normal random variables. If $X_1,\, ...,\, X_d$ are independent, standard, normal random variables, then the sum of their squares,
\begin{equation}\label{E:chi_sq}
Z = \sum\limits_{i=1}^d X_i^2,
\end{equation}
is distributed according to the chi-squared distribution with $d$ degrees of freedom. This is usually denoted as
\begin{equation}\label{E:chi_sq_notation}
Z\sim\ \chi^2_d.
\end{equation} 
The PDF of $Z$ is given by
\begin{equation}\label{E:chi_sq_pdf}
f(x;\,d) = \left\{\begin{array}{ll}
\dfrac{1}{2^{d/2}\Gamma(k/2)}\,x^{k/2 - 1} e^{-x/2},  	& x \geq 0;\\
[3mm]
0, 														& \text{otherwise}
\end{array}\right.
\end{equation}
where $\Gamma(\cdot)$ denotes the Gamma function defined as $\Gamma_{n} = (n-1)!$. 

For a normal random variable $X\sim\mathcal{N}(\boldsymbol{\mu},\,\Sigma)$ we have the following properties:
\begin{description}
\item[P1] Affine transformations of $X$ are normally distributed. In particular, given ${\rm A}\in\mathbb{R}^{q\times d}$ and ${\bf b}\in\mathbb{R}^q$, then $Y = {\rm A}X+{\bf b}\sim \mathcal{N}_q(A\boldsymbol{\mu} + {\bf b},\, {\rm A}\Sigma A^{\TT})$.

\item[P2] All subsets of the components of $X$ have normal distribution. If we rearrange the vector as
\begin{equation}
X = \left[\begin{array}{c}
X_1\\
X_2 
\end{array}\right], \quad 
\boldsymbol{\mu} = \left[\begin{array}{c}
\boldsymbol{\mu}_1\\
\boldsymbol{\mu}_2 
\end{array}\right], \quad
\Sigma = \left[\begin{array}{cc}
\Sigma_{1,1} & \Sigma_{1,2}\\
\Sigma_{2,1} & \Sigma_{2,2}   
\end{array}\right],
\end{equation}  
where $X_1\in\mathbb{R}^{q}$ and $X_2\in\mathbb{R}^{d-q}$; then, $X_1\sim\mathcal{N}_q(\boldsymbol{\mu}_1,\,\Sigma_{1,1})$ and $X_2\sim\mathcal{N_{d-q}(\boldsymbol{\mu}_2,\,\Sigma_{2,2})$.

\item[P3] If $\det(\Sigma)>0$; then, 
\begin{itemize}
\item $(X - \boldsymbol{\mu})^{\TT}\Sigma^{-1}(X-\boldsymbol{\mu})$ is distributed as $\chi_d^2$, where $\chi_d^2$ denotes the chi-squared distribution \cite{} with $d$ DOFs.
\item The $\mathcal{N}(\boldsymbol{\mu},\,\Sigma)$ distribution assigns probability $(1-\alpha)$ to the ellipsoid $\{\xx:\; (\xx - \boldsymbol{\mu})^{\TT}\Sigma^{-1}(\xx-\boldsymbol{\mu})\leq \chi^2_d(\alpha)\}$ where $\chi^2_d(\alpha)$ denotes the upper $(100\,\alpha)$-th percentile of the $\chi^2_d$ distribution.
\end{itemize}
\end{description}












