Part IV: Advanced Topics | Chapter 2

Multivariate Analysis

Joint distributions, multivariate inference, and dimensionality reduction

Historical Context

Multivariate analysis emerged from Francis Galton's and Karl Pearson's work on correlation and regression in the late 19th century. Pearson introduced the correlation matrix, while his student R. A. Fisher developed discriminant analysis in 1936 to classify Iris species from multiple measurements simultaneously. Harold Hotelling generalized Student's t-test to the multivariate setting in 1931 and introduced canonical correlation analysis.

The Wishart distribution, derived by John Wishart in 1928 as the multivariate generalization of the chi-squared distribution, became the cornerstone of multivariate hypothesis testing. S. S. Wilks, Pillai, Lawley, and Hotelling developed the four classical test statistics for MANOVA. Factor analysis originated with Charles Spearman's 1904 work on general intelligence, and was formalized by Thurstone and later placed on rigorous statistical footing by Lawley and Maxwell. Modern computational advances have made these methods practical for high-dimensional data analysis in genomics, neuroimaging, and finance.

2.1 The Multivariate Normal Distribution

The multivariate normal (MVN) distribution is the fundamental building block of multivariate analysis, serving as both a practical model and a theoretical reference distribution.

Definition: Multivariate Normal

A random vector $\mathbf{X} = (X_1, \ldots, X_p)' \sim N_p(\boldsymbol{\mu}, \boldsymbol{\Sigma})$has density:

$$f(\mathbf{x}) = \frac{1}{(2\pi)^{p/2}|\boldsymbol{\Sigma}|^{1/2}} \exp\!\left(-\frac{1}{2}(\mathbf{x} - \boldsymbol{\mu})'\boldsymbol{\Sigma}^{-1}(\mathbf{x} - \boldsymbol{\mu})\right)$$

where $\boldsymbol{\mu} \in \mathbb{R}^p$ is the mean vector and$\boldsymbol{\Sigma}$ is the $p \times p$ positive definite covariance matrix.

A key property of the MVN is closure under linear transformations: if$\mathbf{X} \sim N_p(\boldsymbol{\mu}, \boldsymbol{\Sigma})$ and$\mathbf{Y} = A\mathbf{X} + \mathbf{b}$, then$\mathbf{Y} \sim N_q(A\boldsymbol{\mu} + \mathbf{b}, A\boldsymbol{\Sigma}A')$.

Conditional Distributions

Partition $\mathbf{X} = (\mathbf{X}_1', \mathbf{X}_2')'$ with corresponding partitions of $\boldsymbol{\mu}$ and $\boldsymbol{\Sigma}$. Then:

$$\mathbf{X}_1 \mid \mathbf{X}_2 = \mathbf{x}_2 \sim N\!\left(\boldsymbol{\mu}_1 + \boldsymbol{\Sigma}_{12}\boldsymbol{\Sigma}_{22}^{-1}(\mathbf{x}_2 - \boldsymbol{\mu}_2),\; \boldsymbol{\Sigma}_{11} - \boldsymbol{\Sigma}_{12}\boldsymbol{\Sigma}_{22}^{-1}\boldsymbol{\Sigma}_{21}\right)$$

The conditional mean is a linear function of $\mathbf{x}_2$, and the conditional covariance does not depend on the conditioning value. This property is the basis for multivariate regression and kriging.

For the MVN, uncorrelatedness implies independence: if$\boldsymbol{\Sigma}_{12} = \mathbf{0}$, then $\mathbf{X}_1$ and$\mathbf{X}_2$ are independent. The Mahalanobis distance$D^2 = (\mathbf{x} - \boldsymbol{\mu})'\boldsymbol{\Sigma}^{-1}(\mathbf{x} - \boldsymbol{\mu})$follows a $\chi^2_p$ distribution and provides the natural metric for measuring how far a point is from the center of the distribution.

2.2 The Wishart Distribution

Just as the chi-squared distribution arises from sums of squared normals, the Wishart distribution describes the sampling distribution of the scatter matrix from multivariate normal data.

Definition: Wishart Distribution

If $\mathbf{X}_1, \ldots, \mathbf{X}_n \overset{iid}{\sim} N_p(\boldsymbol{\mu}, \boldsymbol{\Sigma})$, then the sample scatter matrix:

$$\mathbf{S} = \sum_{i=1}^{n} (\mathbf{X}_i - \bar{\mathbf{X}})(\mathbf{X}_i - \bar{\mathbf{X}})' \sim W_p(n-1, \boldsymbol{\Sigma})$$

where $W_p(m, \boldsymbol{\Sigma})$ denotes the Wishart distribution with$m$ degrees of freedom and scale matrix $\boldsymbol{\Sigma}$. The Wishart distribution exists when $m \geq p$.

Key properties include: $\mathbb{E}[\mathbf{S}] = m\boldsymbol{\Sigma}$, additivity ($W_p(m_1, \Sigma) + W_p(m_2, \Sigma) \sim W_p(m_1 + m_2, \Sigma)$for independent summands), and the Bartlett decomposition which represents a Wishart matrix as $\mathbf{S} = \mathbf{L}\mathbf{A}\mathbf{A}'\mathbf{L}'$ where$\boldsymbol{\Sigma} = \mathbf{L}\mathbf{L}'$ is the Cholesky factor and$\mathbf{A}$ is lower triangular with chi-squared diagonal entries and standard normal off-diagonal entries.

The inverse Wishart distribution, $\mathbf{S}^{-1} \sim W_p^{-1}(m, \boldsymbol{\Sigma}^{-1})$, serves as the conjugate prior for the covariance matrix in Bayesian multivariate analysis, with density:

$$f(\boldsymbol{\Psi}) \propto |\boldsymbol{\Psi}|^{-(m+p+1)/2} \exp\!\left(-\frac{1}{2}\text{tr}(\boldsymbol{\Lambda}\boldsymbol{\Psi}^{-1})\right)$$

2.3 Hotelling's T-Squared and MANOVA

Hotelling's $T^2$ generalizes the univariate t-test to the multivariate setting, testing whether a mean vector equals a hypothesized value.

Hotelling's T-Squared Test

For $H_0: \boldsymbol{\mu} = \boldsymbol{\mu}_0$ based on a sample of size $n$:

$$T^2 = n(\bar{\mathbf{X}} - \boldsymbol{\mu}_0)'\mathbf{S}^{-1}(\bar{\mathbf{X}} - \boldsymbol{\mu}_0)$$

Under $H_0$, $\frac{n-p}{p(n-1)} T^2 \sim F_{p, n-p}$. For two-sample problems, $T^2 = \frac{n_1 n_2}{n_1 + n_2}(\bar{\mathbf{X}}_1 - \bar{\mathbf{X}}_2)'\mathbf{S}_{\text{pool}}^{-1}(\bar{\mathbf{X}}_1 - \bar{\mathbf{X}}_2)$.

Multivariate Analysis of Variance (MANOVA) extends this to $k$groups. The total sum of squares and cross-products decomposes as$\mathbf{T} = \mathbf{B} + \mathbf{W}$, where $\mathbf{B}$ and$\mathbf{W}$ are the between-group and within-group matrices. Four classical test statistics exist:

Wilks' Lambda: $\Lambda = |\mathbf{W}|/|\mathbf{T}| = \prod_i (1 + \lambda_i)^{-1}$

Pillai's Trace: $V = \text{tr}(\mathbf{B}\mathbf{T}^{-1}) = \sum_i \lambda_i/(1+\lambda_i)$

Hotelling-Lawley Trace: $U = \text{tr}(\mathbf{B}\mathbf{W}^{-1}) = \sum_i \lambda_i$

Roy's Largest Root: $\theta = \lambda_1 / (1 + \lambda_1)$ where $\lambda_i$ are eigenvalues of $\mathbf{W}^{-1}\mathbf{B}$.

Pillai's trace is most robust to departures from assumptions (normality, equal covariance matrices), while Roy's largest root is most powerful when group differences are concentrated in a single dimension.

2.4 Discriminant Analysis

Discriminant analysis constructs classification rules from multivariate data. Under the assumption that each class $k$ has distribution$N_p(\boldsymbol{\mu}_k, \boldsymbol{\Sigma}_k)$ with prior probability$\pi_k$, the Bayes-optimal classifier assigns observation $\mathbf{x}$to the class maximizing the posterior probability.

Linear Discriminant Analysis (LDA)

When all classes share a common covariance $\boldsymbol{\Sigma}$, the log-posterior is linear in $\mathbf{x}$. The discriminant function for class $k$ is:

$$\delta_k(\mathbf{x}) = \mathbf{x}'\boldsymbol{\Sigma}^{-1}\boldsymbol{\mu}_k - \frac{1}{2}\boldsymbol{\mu}_k'\boldsymbol{\Sigma}^{-1}\boldsymbol{\mu}_k + \log \pi_k$$

Assign to $\arg\max_k \delta_k(\mathbf{x})$. The decision boundary between classes $j$ and $k$ is a hyperplane.

Quadratic Discriminant Analysis (QDA)

When covariance matrices differ across classes, the discriminant function becomes quadratic:

$$\delta_k(\mathbf{x}) = -\frac{1}{2}\log|\boldsymbol{\Sigma}_k| - \frac{1}{2}(\mathbf{x} - \boldsymbol{\mu}_k)'\boldsymbol{\Sigma}_k^{-1}(\mathbf{x} - \boldsymbol{\mu}_k) + \log \pi_k$$

QDA is more flexible but requires estimating $O(p^2)$ parameters per class, making it prone to overfitting in high dimensions.

Fisher's approach to LDA seeks directions $\mathbf{w}$ that maximize the ratio of between-class to within-class variance:$J(\mathbf{w}) = \mathbf{w}'\mathbf{B}\mathbf{w} / \mathbf{w}'\mathbf{W}\mathbf{w}$. The optimal $\mathbf{w}$ is the eigenvector of $\mathbf{W}^{-1}\mathbf{B}$corresponding to the largest eigenvalue. For $K$ classes, at most$\min(K-1, p)$ discriminant directions exist.

2.5 Factor Analysis

Factor analysis models observed variables as linear combinations of a smaller number of unobserved latent factors, explaining correlations among observed variables through shared underlying causes.

The Factor Model

The $m$-factor model for a $p$-dimensional observation is:

$$\mathbf{X} - \boldsymbol{\mu} = \mathbf{L}\mathbf{f} + \boldsymbol{\epsilon}$$

where $\mathbf{L}$ is the $p \times m$ factor loading matrix, $\mathbf{f} \sim N_m(\mathbf{0}, \mathbf{I})$ are the common factors, and $\boldsymbol{\epsilon} \sim N_p(\mathbf{0}, \boldsymbol{\Psi})$are the specific factors with $\boldsymbol{\Psi} = \text{diag}(\psi_1, \ldots, \psi_p)$. This implies:

$$\boldsymbol{\Sigma} = \mathbf{L}\mathbf{L}' + \boldsymbol{\Psi}$$

The communality of variable $j$ is$h_j^2 = \sum_{k=1}^m l_{jk}^2$, representing the proportion of variance explained by the common factors. The uniqueness is $\psi_j = \sigma_{jj} - h_j^2$.

Estimation proceeds by maximum likelihood or principal factor methods. The loading matrix is not uniquely determined: for any orthogonal matrix $\mathbf{T}$,$\mathbf{L}^* = \mathbf{L}\mathbf{T}$ gives the same covariance structure. Factor rotation (varimax, promax) exploits this invariance to obtain interpretable loadings. The number of factors is chosen by scree plots, parallel analysis, or likelihood ratio tests comparing $m$ vs. $m+1$ factors.

2.6 Computational Lab

We sample from multivariate normals, estimate covariance matrices, perform linear discriminant analysis, and demonstrate factor analysis with rotation.

Multivariate Analysis: MVN, LDA, and Factor Analysis

Python
script.py171 lines

Click Run to execute the Python code

Code will be executed with Python 3 on the server

2.7 Summary and Key Takeaways

Multivariate Normal

The MVN is characterized by its mean vector and covariance matrix. Conditional distributions are normal with linear conditional means, and uncorrelated components are independent.

Wishart Distribution

The Wishart distribution is the sampling distribution of the scatter matrix from MVN data, serving as the foundation of multivariate hypothesis testing.

Hotelling's T-Squared and MANOVA

$T^2$ generalizes the t-test to vector means. MANOVA decomposes multivariate variability into between- and within-group components with four classical test statistics.

Discriminant Analysis

LDA assumes equal covariance matrices yielding linear boundaries; QDA allows unequal covariances yielding quadratic boundaries. Fisher's criterion maximizes class separation.

Factor Analysis

Factor analysis explains correlations through latent factors. The loading matrix is rotationally non-unique; varimax rotation enhances interpretability by seeking simple structure.

Rate this chapter: