Multivariate analysis
Consider a regression problem with $X\in \mathcal{X}$ and $Y\in \set{0,1}$. Assume $X\mid Y = 0$ has density $f_0$ and $X\mid Y = 1$ has density $f_1$. Suppose $π$ is prior on $Y$, with $π_0 = \prob[Y = 0]$ and $π_1 = \prob[Y = 1]$.
The regression function is $$ \begin{align*} η(x) := \prob[Y = 1 \mid X = x] = \frac{π_1 f_1(x)}{π_0 f_0(x) + π_1 f_1(x)}. \end{align*} $$
A classifier is a decision rule $δ: \mathcal{X} \to \set{0,1}$.
The 0-1 loss is $$ \begin{align*} L(δ(X), Y) = \mathbb{1}_{\set{δ(X) \neq Y}}. \end{align*} $$
A classifier $δ$ is a Bayes classifier if it is a $π$-Bayes rule, i.e. it minimises the $π$-Bayes risk $$ \begin{align*} R_π(δ) = \prob[δ(X) \neq Y]. \end{align*} $$
A Bayes classifier is given by $$ \begin{align*} δ_π(x) = \begin{cases} 1, &\text{if $\frac{π_1 f_1(x)}{π_0 f_0(x)}>1$}, \\ 0, &\text{otherwise}. \end{cases} \end{align*} $$
If $\prob[\frac{π_1 f_1(X)}{π_0 f_0(X)} = 1] = 0$, then any Bayes classifier $δ$ satisfies $δ(X) = δ_π(X)$ almost surely.
The correlation of two square-integrable random variables $X,Y$ is $$ \begin{align*} \op{corr}(X,Y) = \frac{\cov(X,Y)}{\sqrt{\var(X)}\sqrt{\var(Y)}}. \end{align*} $$
Let $X_1, \ldots, X_n$ be iid copies of a square integrable random vector $X = (X^{(1)}, \ldots, X^{(p)})$ in $\R^p$. Form the matrix $\mathbf{X} = \pmat{X_1^T \\ \vdots \\ X_n^T}$.
Define the sample variance $$ \begin{align*} \hat Σ := \frac{1}{n} \sum_{i=1}^{n} (X_i - \overline{X_n})(X_i - \overline{X_n})^T = \frac{1}{n}((I - P)\mathbf{X})^T((I-P)\mathbf{X}) = \frac{1}{n}\mathbf{X}^T (I-P) \mathbf{X} \end{align*} $$ where $P = \frac{1}{n} \v 1 \v 1^T$ is the projection matrix onto $\mathbf{1} = (1, \ldots, 1)^T\in \R^p$.
Define the sample correlation $$ \begin{align*} \hat ρ_{jk} := \frac{\hat Σ_{jk}}{\sqrt{\hat Σ_{jj} \hat Σ_{kk}}} = \frac{((I-P)\mathbf{X}^{(j)})^T((I-P) \mathbf{X}^{(k)})}{\|(I-P) \mathbf{X}^{(j)}\| \|(I-P) \mathbf{X}^{(k)}\|} = \frac{\sum_{i} (X_i^{(j)} - \overline{X_n}^{(j)})(X_i^{(k)} - \overline{X_n}^{(k)})}{\sqrt{\sum_{i} (X_i^{(j)} - \overline{X_n}^{(j)})^2 \cdot \sum_{i} (X_i^{(k)} - \overline{X_n}^{(k)})^2}}. \end{align*} $$
In a model $X \sim N(μ, Σ)$, $\hat Σ$ is the maximum likelihood estimator of $Σ$, and $\hat ρ_{jk}$ is the maximum likelihood estimator of $\op{corr}(X^{(j)}, X^{(k)})$.
In general, $\hat Σ \xrightarrow{p} \var(X)$ by the strong law of large numbers, and $\sqrt{n}(\hat Σ - \var(X))$ converges in distribution to a normal by the central limit theorem.
Given random vectors $X, Y, Z$, we say that $X$ and $Y$ are conditionally independent given $Z$ (or $X \perp\!\!\!\perp Y \mid Z$) if $$ \begin{align*} f_{XY\mid Z}(x,y\mid z) = f_{X\mid Z}(x \mid z) f_{Y\mid Z}(y\mid z). \end{align*} $$ Equivalently, $$ \begin{align*} X \perp\!\!\!\perp Y \mid Z \iff f_{X\mid Y, Z}(x\mid y,z) = m(x,z) \end{align*} $$ for some function $m$, whenever $f_{Y,Z}(y,z) > 0$.
The partial correlation of $X$ and $Y$ given $Z$ is the correlation of $X$ and $Y$ in the conditional density $f_{X,Y\mid Z}(\cdot ,\cdot \mid z)$: $$ \begin{align*} ρ_{X,Y\mid Z}(z) = \frac{\cov(X,Y\mid Z = z)}{\sqrt{\var(X\mid Z=z) \var(Y\mid Z = z)}}. \end{align*} $$
If $X,Y$ are conditionally independent given $Z$, then $ρ_{X,Y\mid Z} \equiv 0$.
Let $Y\in \R^m, W\in \R^n$ be jointly Gaussian $$ \begin{align*} \pmat{Y \\ W} \sim N\left(\pmat{μ_1 \\ μ_2}, \pmat{Σ_{11} & Σ_{12} \\ Σ_{21} & Σ_{22}}\right) \end{align*} $$ where $Σ = \pmat{Σ_{11} & Σ_{12} \\ Σ_{21} & Σ_{22}}$ is positive definite. Then $$ \begin{align*} Y \mid W = w \sim N(μ_1 + Σ_{12} Σ_{22}\inv(w - μ_2),\; Σ_{11} - Σ_{12} Σ_{22}\inv Σ_{21}). \end{align*} $$
Therefore $$ \begin{align*} Y = μ_1 + Σ_{12} Σ_{22}\inv(W - μ_2) + ε \end{align*} $$ where $ε\sim N(0, Σ_{11} - Σ_{12} Σ_{22}\inv Σ_{21})$ and $W$ are independent.
Note $\var(Y \mid Z) = Σ_{11} - Σ_{12} Σ_{22}\inv Σ_{21}$ does not depend on $Z$.
Let $(W_i, Z_i)_{i=1}^n$ be iid copies of $(W, Z)$, with $W\in \R^m, Z \in \R^n$. Form the matrices $\mathbf{W} = \pmat{W_1^T \\ \vdots \\ W_n^T}, \mathbf{Z} = \pmat{Z_1^T \\ \vdots \\Z_n^T}$.
The sample conditional variance of $W$ given $Z$ is $$ \begin{align*} \hat Ω = \frac{1}{n}((I - P) \mathbf{W})^T ((I - P) \mathbf{W}) = \frac{1}{n}\mathbf{W}^T (I-P) \mathbf{W} \end{align*} $$ where $P$ is the projection matrix onto the columns space of $\pmat{\v 1 & \mathbf{Z}}$.
The sample partial correlation of $W^{(j)}$ and $W^{(k)}$ given $Z$ is $$ \begin{align*} \hat ρ_{W^{(j)}, W^{(k)}\mid Z} = \frac{\hat Ω_{jk}}{\sqrt{\hat Ω_{jj} \hat Ω_{kk}}} = \frac{((I - P)\mathbf{W}^{(j)})^T ((I-P) \mathbf{W}^{(k)})}{\|(I-P)\mathbf{W}^{(j)}\| \|(I - P) \mathbf{W}^{(k)}\|}. \end{align*} $$
If $(W,Z)$ is jointly Gaussian, then $\hat Ω$ is the maximum likelihood estimator of $\var(W\mid Z)$ and $\hat ρ_{W^{(j)}, W^{(k)}\mid Z}$ is the maximum likelihood estimator of $ρ_{W^{(j)},W^{(k)}\mid Z}$. (Proof)
Let $(X_i, Y_i, Z_i)_{i=1}^n$ be iid copies of $(X,Y,Z)$ where $X\in \R$, $Y\in \R$, $Z\in \R^p$. Form the matrices $\mathbf{X} = \pmat{X_1 \\ \vdots \\X_n}$, $\mathbf{Y} = \pmat{Y_1 \\ \vdots \\ Y_n}$, $\mathbf{Z} = \pmat{Z_1^T \\ \vdots \\Z_n^T}$.
Assuming $\pmat{\v 1 & \mathbf{X} & \mathbf{Z}}$ has full column rank, let $P_0$, $P$ be the orthogonal projection matrices onto $\op{Col}\pmat{1 & \mathbf{Z}}$ and $\op{Col}\pmat{1 & \mathbf{X} & \mathbf{Z}}$.
Then the sample partial correlation is given by $$ \begin{align*} \hat ρ_{X,Y\mid Z} = \frac{\|(P - P_0) \mathbf{Y}\|}{\|(I-P_0) \mathbf{Y}\|}. \end{align*} $$
The $F$-statistic is then $$ \begin{align*} \frac{\|(P - P_0) \mathbf{Y}\|^2}{\|(I-P)\mathbf{Y}\|^2/(n-p-2)} = (n-p-2)\frac{\hat ρ_{X,Y\mid Z}^2}{1 - \hat ρ_{X,Y\mid Z}^2}. \end{align*} $$
Let $X_1, \ldots, X_n$ be iid copies of a random vector $X\in \R^p$.
-
Construct $\hat Σ = \frac{1}{n} \sum_{i=1}^{n} (X_i - \overline{X_n}) (X_i - \overline{X_n})^T$.
-
Find the first $k$ eigenvectors $\hat v_1, \ldots, \hat v_k$ of $\hat Σ$ with largest magnitude of eigenvalue.
-
Project the samples onto these vectors $$ \begin{align*} \pmat{X_1^T \\ \vdots \\ X_n^T}\pmat{\hat v_1 & \ldots &\hat v_k}. \end{align*} $$