Session 12: Random Vectors and Covariance

Movement IV: Gaussian Vectors and Linear Estimation

EE 520: Random Processes (Fall 2026). Instructor: John Lipor.

The course thesis, once more. A probability model answers three questions: What is uncertain? What is observed? How should observation change belief and action? Movement IV keeps all three but lets the uncertain thing be a vector: several coupled quantities at once, whose shared uncertainty is the new object of study.

Launch

Two hydrophones listen for one whale. Each reading is the whale’s call plus noise, and the noise is not private to each sensor: a passing boat, a swell, a thermal layer all push both readings the same way at once. So the two numbers are entangled, and the entanglement is exactly what we must model to fuse them well. A single variance cannot capture it, because variance describes one quantity in isolation. What we need is a matrix whose off-diagonal entries record how each pair of quantities moves together. Today we build that matrix, the covariance matrix, learn the one property that makes it legal, and learn how it transforms when we combine or filter the measurements. Everything from here to the end of the course (Gaussian inference, sensor fusion, filtered noise) runs on the two formulas we prove today.

Development

A linear-algebra refresher

Everything today is written with vectors and matrices, so we begin with a brief review of the linear algebra we will use. We write a matrix A∈ℝm×nA \in \mathbb{R}^{m \times n} as A=[a11a12…a1na21a22…a2n⋮⋮⋮am1am2…amn].\begin{equation*} A = \begin{bmatrix} a_{11} & a_{12} & \dots & a_{1n} \\ a_{21} & a_{22} & \dots & a_{2n} \\ \vdots & \vdots & & \vdots \\ a_{m1} & a_{m2} & \dots & a_{mn} \end{bmatrix}. \end{equation*} By convention, any vector x∈ℝnx \in \mathbb{R}^n is a column vector, x=(x1,x2,…,xn)Tx = (x_1, x_2, \dots, x_n)^T.

Transpose and symmetry.

Definition 1 (Transpose). The transpose of a matrix A∈ℝm×nA \in \mathbb{R}^{m \times n} is the n×mn \times m matrix AT∈ℝn×mA^T \in \mathbb{R}^{n \times m} whose (i,j)(i, j)th entry is the (j,i)(j, i)th entry of AA.

For example, A=[102312]hasAT=[121032].\begin{equation*} A = \begin{bmatrix} 1 & 0 \\ 2 & 3 \\ 1 & 2 \end{bmatrix} \qquad\text{has}\qquad A^T = \begin{bmatrix} 1 & 2 & 1 \\ 0 & 3 & 2 \end{bmatrix}. \end{equation*} We say that AA is symmetric if A=ATA = A^T. Some properties of the transpose operation are as follows.

  1. (AT)T=A(A^T)^T = A.

  2. (A+B)T=AT+BT(A + B)^T = A^T + B^T.

  3. (AB)T=BTAT(AB)^T = B^T A^T whenever the product ABAB is defined (A∈ℝm×nA \in \mathbb{R}^{m \times n}, B∈ℝn×pB \in \mathbb{R}^{n \times p}). The order reverses, and that reversal is why the transposes in today’s formula ΣY=AΣXAT\Sigma_Y = A \Sigma_X A^T sit where they do.

Inner and outer products.

Definition 2 (Inner and outer products). The inner product (or dot product) of two vectors x,y∈ℝnx, y \in \mathbb{R}^n is ⟨x,y⟩=xTy=[x1x2…xn][y1y2⋮yn]=∑i=1nxiyi.\begin{equation*} \left\langle x,y \right\rangle = x^T y = \begin{bmatrix} x_1 & x_2 & \dots & x_n \end{bmatrix} \begin{bmatrix} y_1 \\ y_2 \\ \vdots \\ y_n \end{bmatrix} = \sum_{i=1}^{n} x_i y_i . \end{equation*} The outer product of x∈ℝmx \in \mathbb{R}^m and y∈ℝny \in \mathbb{R}^n is the m×nm \times n matrix xyT=[x1x2⋮xm][y1y2…yn]=[x1y1x1y2…x1ynx2y1x2y2…x2yn⋮⋮⋮xmy1xmy2…xmyn].\begin{equation*} x y^T = \begin{bmatrix} x_1 \\ x_2 \\ \vdots \\ x_m \end{bmatrix} \begin{bmatrix} y_1 & y_2 & \dots & y_n \end{bmatrix} = \begin{bmatrix} x_1 y_1 & x_1 y_2 & \dots & x_1 y_n \\ x_2 y_1 & x_2 y_2 & \dots & x_2 y_n \\ \vdots & \vdots & & \vdots \\ x_m y_1 & x_m y_2 & \dots & x_m y_n \end{bmatrix}. \end{equation*}

Note that the inner product xTyx^T y is a scalar, while the outer product xyTx y^T is a matrix. Both appear today: the covariance matrix will be an expected outer product, and every variance we compute from it will be a scalar of the form aTΣaa^T \Sigma a.

Matrix times vector: two views.

We sometimes use Matlab notation for pieces of a matrix: A:,jA_{:,j} is the jjth column of AA and Aj,:A_{j,:} is its jjth row. Let A∈ℝm×nA \in \mathbb{R}^{m \times n} and x∈ℝnx \in \mathbb{R}^n. We can think of the product AxAx in two ways. In the first, each entry of AxAx is an inner product between the corresponding row of AA and the vector xx, Ax=[A1,:xA2,:x⋮Am,:x].\begin{equation*} Ax = \begin{bmatrix} A_{1,:}\, x \\ A_{2,:}\, x \\ \vdots \\ A_{m,:}\, x \end{bmatrix}. \end{equation*} Alternatively, AxAx is a sum of scaled columns of AA, Ax=A:,1x1+A:,2x2+…+A:,nxn.\begin{equation*} Ax = A_{:,1}\, x_1 + A_{:,2}\, x_2 + \dots + A_{:,n}\, x_n . \end{equation*} Deciding which view is most useful is a skill that is acquired over time, and I encourage you to begin by always writing both views when working on a problem.

Matrix times matrix: two views.

For A∈ℝm×nA \in \mathbb{R}^{m \times n} and B∈ℝn×pB \in \mathbb{R}^{n \times p}, the standard definition of the product sets its (i,j)(i, j)th entry to (AB)ij=∑k=1nAikBkj.\begin{equation*} (AB)_{ij} = \sum_{k=1}^{n} A_{ik} B_{kj} . \end{equation*} This is not an intuitive definition, so we instead consider two alternative views.

View 1: inner products. Think of AA as a stack of rows and BB as a row of columns. Then ABAB is the matrix of inner products between the rows of AA and the columns of BB, AB=[A1,:⋮Am,:][B:,1…B:,p]=[A1,:B:,1…A1,:B:,p⋮⋮Am,:B:,1…Am,:B:,p].\begin{equation*} AB = \begin{bmatrix} A_{1,:} \\ \vdots \\ A_{m,:} \end{bmatrix} \begin{bmatrix} B_{:,1} & \dots & B_{:,p} \end{bmatrix} = \begin{bmatrix} A_{1,:} B_{:,1} & \dots & A_{1,:} B_{:,p} \\ \vdots & & \vdots \\ A_{m,:} B_{:,1} & \dots & A_{m,:} B_{:,p} \end{bmatrix}. \end{equation*} Taking B=ATB = A^T gives AATAA^T, the matrix of inner products between the rows of AA, called the Gram matrix of those rows.

View 2: outer products. Think of AA in terms of its columns and BB in terms of its rows. Then ABAB is a sum of outer products, AB=[A:,1…A:,n][B1,:⋮Bn,:]=∑k=1nA:,kBk,:.\begin{equation*} AB = \begin{bmatrix} A_{:,1} & \dots & A_{:,n} \end{bmatrix} \begin{bmatrix} B_{1,:} \\ \vdots \\ B_{n,:} \end{bmatrix} = \sum_{k=1}^{n} A_{:,k}\, B_{k,:} . \end{equation*} This view is the one behind the sample covariance matrix: if the columns of AA are NN centered data vectors x1,…,xNx_1, \dots, x_N, then 1NAAT=1N∑k=1NxkxkT\frac{1}{N} A A^T = \frac{1}{N} \sum_{k=1}^{N} x_k x_k^T is an average of outer products, the data version of the expected outer product defined below.

Inverses, definiteness, and length.

Definition 3 (Inverse; positive (semi)definite). A square matrix A∈ℝn×nA \in \mathbb{R}^{n \times n} is invertible if there exists a matrix A−1∈ℝn×nA^{-1} \in \mathbb{R}^{n \times n} such that AA−1=A−1A=IA A^{-1} = A^{-1} A = I, where II is the n×nn \times n identity matrix. A symmetric matrix A∈ℝn×nA \in \mathbb{R}^{n \times n} is positive semidefinite (PSD, written A≽0A \succeq 0) if xTAx≥0for all x∈ℝn,\begin{equation*} x^T A x \ge 0 \quad \text{for all } x \in \mathbb{R}^n, \end{equation*} and positive definite (PD, written A≻0A \succ 0) if xTAx>0x^T A x > 0 for all x≠0x \ne 0.

One fact we will lean on in Session 13: a positive semidefinite matrix is invertible if and only if it is positive definite. Today’s main result is that every covariance matrix is PSD; whether it is also PD decides whether it can be inverted.

Finally, the Euclidean or 2-norm of a vector x∈ℝnx \in \mathbb{R}^n is ∥x∥2=xTx\left\|x\right\|_2 = \sqrt{x^T x}. The norm is a notion of length, so it is nonnegative. The Cauchy–Schwarz inequality for vectors states that |⟨x,y⟩|≤∥x∥2∥y∥2.\begin{equation*} \left\lvert \left\langle x,y \right\rangle \right\rvert \le \left\|x\right\|_2 \left\|y\right\|_2 . \end{equation*} Its random-variable version, in which 𝔼[UV]\mathbb{E}[UV] plays the role of the inner product, is what bounds the correlation coefficient later today.

Mean vector and covariance matrix

A random vector X=(X1,…,Xn)T∈ℝnX = (X_1, \dots, X_n)^T \in \mathbb{R}^n is a vector whose entries are random variables. Its mean vector stacks the componentwise means, μX=𝔼[X]=(𝔼[X1],…,𝔼[Xn])T,\begin{equation} \mu_X = \mathbb{E}[X] = (\mathbb{E}[X_1], \dots, \mathbb{E}[X_n])^T, \end{equation} and expectation of a random vector or matrix is entrywise. The single number “variance” is replaced by a whole matrix of pairwise second moments.

Definition 4 (Covariance matrix). The covariance matrix of X∈ℝnX \in \mathbb{R}^n is ΣX=𝔼[(X−μX)(X−μX)T],\begin{equation} \Sigma_X = \mathbb{E}\left[(X - \mu_X)(X - \mu_X)^T\right], \end{equation} an n×nn \times n matrix whose (i,j)(i,j) entry is cov⁡(Xi,Xj)=𝔼[(Xi−μXi)(Xj−μXj)]\operatorname{cov}(X_i, X_j) = \mathbb{E}[(X_i - \mu_{X_i})(X_j - \mu_{X_j})]. Its diagonal holds the variances var⁡(Xi)\operatorname{var}(X_i), and it is symmetric because cov⁡(Xi,Xj)=cov⁡(Xj,Xi)\operatorname{cov}(X_i, X_j) = \operatorname{cov}(X_j, X_i).

The off-diagonal entries are the point of the object: they record the shared motion the launch described. A positive cov⁡(Xi,Xj)\operatorname{cov}(X_i, X_j) means the two tend to rise and fall together; a negative one, in opposition; zero, no linear co-movement (but read the warning in Subsection 2.6 before reading “zero” as “unrelated”).

Legality: no portfolio may have negative variance

Not every symmetric matrix is a covariance matrix. The constraint comes from one computation: the variance of any linear combination.

Proposition 1 (Variance of a linear combination). For any fixed a∈ℝna \in \mathbb{R}^n, var⁡(aTX)=aTΣXa.\begin{equation} \operatorname{var}(a^T X) = a^T \Sigma_X\, a. \label{eq:quadform} \end{equation}

Proof. The scalar aTXa^T X has mean aTμXa^T \mu_X, so var⁡(aTX)=𝔼[(aTX−aTμX)2]=𝔼[(aT(X−μX))2]=𝔼[aT(X−μX)(X−μX)Ta]=aT𝔼[(X−μX)(X−μX)T]a=aTΣXa,\begin{align} \operatorname{var}(a^T X) &= \mathbb{E}\left[\left(a^T X - a^T \mu_X\right)^2\right] = \mathbb{E}\left[\left(a^T (X - \mu_X)\right)^2\right] \\ &= \mathbb{E}\left[a^T (X - \mu_X)(X - \mu_X)^T a\right] = a^T\, \mathbb{E}\left[(X - \mu_X)(X - \mu_X)^T\right]\, a = a^T \Sigma_X\, a, \end{align} pulling the constant aa outside the expectation. ◻

Corollary 1 (Covariance matrices are positive semidefinite). ΣX≽0\Sigma_X \succeq 0: for every aa, aTΣXa≥0a^T \Sigma_X\, a \ge 0.

Proof. By [eq:quadform], aTΣXa=var⁡(aTX)≥0a^T \Sigma_X a = \operatorname{var}(a^T X) \ge 0, since a variance is never negative. ◻

Read the corollary as a modeling law: a proposed covariance matrix is legal only if no linear combination (no “portfolio”) of the variables it describes has negative variance. That single requirement, positive semidefiniteness, is the complete legality test. For a 2×22 \times 2 matrix it reduces to a check you can do by eye: [d1ccd2]≽0\left[\begin{smallmatrix} d_1 & c \\ c & d_2 \end{smallmatrix}\right] \succeq 0 iff d1,d2≥0d_1, d_2 \ge 0 and c2≤d1d2c^2 \le d_1 d_2, i.e. the off-diagonal cannot exceed the geometric mean of the diagonals.

Example 1 (Two quick legality checks). [10.90.91]\left[\begin{smallmatrix} 1 & 0.9 \\ 0.9 & 1 \end{smallmatrix}\right] is legal, since 0.9<1⋅1=10.9 < \sqrt{1 \cdot 1} = 1 (eigenvalues 1.91.9 and 0.10.1). But [11.21.21]\left[\begin{smallmatrix} 1 & 1.2 \\ 1.2 & 1 \end{smallmatrix}\right] is illegal: 1.2>11.2 > 1, and the portfolio a=(1,−1)a = (1, -1) exposes it, aTΣa=1−2(1.2)+1=−0.4<0,\begin{equation} a^T \Sigma\, a = 1 - 2(1.2) + 1 = -0.4 < 0, \end{equation} claiming a variance of −0.4-0.4 for X1−X2X_1 - X_2, which is impossible.

Affine propagation: the workhorse

We rarely observe the raw vector; we observe linear combinations of it (sums, differences, filtered versions). How does the covariance transform?

Proposition 2 (Affine propagation). For a fixed matrix AA and vector bb, the vector Y=AX+bY = AX + b has μY=AμX+b,ΣY=AΣXAT.\begin{equation} \mu_Y = A \mu_X + b, \qquad \Sigma_Y = A\, \Sigma_X\, A^T. \end{equation}

Proof. The mean follows from linearity of expectation. For the covariance, the shift bb cancels in the centering, Y−μY=A(X−μX)Y - \mu_Y = A(X - \mu_X), so ΣY=𝔼[A(X−μX)(X−μX)TAT]=A𝔼[(X−μX)(X−μX)T]AT=AΣXAT.\begin{equation} \Sigma_Y = \mathbb{E}\left[A(X - \mu_X)(X - \mu_X)^T A^T\right] = A\, \mathbb{E}\left[(X - \mu_X)(X - \mu_X)^T\right]\, A^T = A\, \Sigma_X\, A^T. \end{equation} ◻

Key idea. The pair μY=AμX+b\mu_Y = A\mu_X + b and ΣY=AΣXAT\Sigma_Y = A \Sigma_X A^T is the workhorse of the rest of the course. Gaussian closure (Session 13), sensor fusion (Session 14), and filtered noise (Session 17, in its continuous form) are all this one pair of lines. Keep the transpose habit: AΣXATA \Sigma_X A^T is the only arrangement whose dimensions match, and writing ATΣXAA^T \Sigma_X A or AΣXAA \Sigma_X A is the most common slip.

Correlation coefficient

To compare co-movements across different scales we normalize covariance into a unitless correlation coefficient, ρXY=cov⁡(X,Y)var⁡(X)var⁡(Y)=cov⁡(X,Y)σXσY.\begin{equation} \rho_{XY} = \frac{\operatorname{cov}(X, Y)}{\sqrt{\operatorname{var}(X)\,\operatorname{var}(Y)}} = \frac{\operatorname{cov}(X, Y)}{\sigma_X \sigma_Y}. \end{equation} The Cauchy–Schwarz inequality |𝔼[UV]|≤𝔼[U2]𝔼[V2]\left\lvert \mathbb{E}[UV] \right\rvert \le \sqrt{\mathbb{E}[U^2]\,\mathbb{E}[V^2]}, applied to the centered variables U=X−μXU = X - \mu_X and V=Y−μYV = Y - \mu_Y, gives |cov(X,Y)|≤σXσY\left\lvert \operatorname{cov}(X,Y) \right\rvert \le \sigma_X \sigma_Y and hence |ρXY|≤1\left\lvert \rho_{XY} \right\rvert \le 1. Worked example 3.2 proves the same bound a second way, from the corollary above, and collects the two facts Session 8 left for today: |ρ|=1\left\lvert \rho \right\rvert = 1 exactly when one variable is an affine function of the other, and ρ\rho is the cosine of an angle.

Uncorrelated is not independent

Zero covariance says the two variables carry no linear co-movement. It does not say they are unrelated.

Example 2 (Uncorrelated but dependent: the unit circle). Let (X,Y)(X, Y) be uniform on the unit circle {x2+y2=1}\left\{x^2 + y^2 = 1\right\}. By symmetry μX=μY=0\mu_X = \mu_Y = 0 and cov⁡(X,Y)=𝔼[XY]=0\operatorname{cov}(X, Y) = \mathbb{E}[XY] = 0 (writing X=cos⁡ΘX = \cos\Theta, Y=sin⁡ΘY = \sin\Theta with Θ∼Unif[0,2π]\Theta \sim \mathrm{Unif}[0, 2\pi], we get 𝔼[cos⁡Θsin⁡Θ]=12𝔼[sin⁡2Θ]=0\mathbb{E}[\cos\Theta \sin\Theta] = \tfrac{1}{2}\mathbb{E}[\sin 2\Theta] = 0). So ρXY=0\rho_{XY} = 0. Yet the two are as dependent as can be: X2+Y2=1X^2 + Y^2 = 1 forces Y=±1−X2Y = \pm\sqrt{1 - X^2}, so knowing XX pins YY to two values. Zero correlation, total dependence.

Correlation is blind to any relationship that is not straight-line. Session 13 identifies the one distinguished family, the Gaussian, in which zero correlation does imply independence, and that convenience is half the reason the Gaussian owns the rest of this course.

Cross-covariance, and one word about axes

For two random vectors X∈ℝmX \in \mathbb{R}^m and Y∈ℝnY \in \mathbb{R}^n, the cross-covariance matrix is ΣXY=𝔼[(X−μX)(Y−μY)T]∈ℝm×n,ΣXY=ΣYXT.\begin{equation} \Sigma_{XY} = \mathbb{E}\left[(X - \mu_X)(Y - \mu_Y)^T\right] \in \mathbb{R}^{m \times n}, \qquad \Sigma_{XY} = \Sigma_{YX}^T. \end{equation} It records how the components of one vector co-move with those of the other; it need not be square and is not required to be positive semidefinite (that property belongs to the symmetric matrices ΣX\Sigma_X alone). This block is the raw material of fusion in Session 14.

Finally, one sentence for the record: because ΣX\Sigma_X is symmetric and positive semidefinite, it diagonalizes as ΣX=VΛVT\Sigma_X = V \Lambda V^T with nonnegative eigenvalues, so there is always a rotated coordinate system in which the components are uncorrelated; the systematic use of that fact (decorrelation, whitening, principal components) belongs to a later machine-learning course and we will not pursue it here.

Worked examples

Build a covariance from a description

A source emits an amplitude AA with mean 00 and var⁡(A)=σA2=4\operatorname{var}(A) = \sigma_A^2 = 4. Two hydrophones report Y1=A+W1,Y2=A+W2,\begin{equation} Y_1 = A + W_1, \qquad Y_2 = A + W_2, \end{equation} with zero-mean noises of unequal quality: var⁡(W1)=1\operatorname{var}(W_1) = 1 (the good sensor) and var⁡(W2)=3\operatorname{var}(W_2) = 3 (the noisy one), correlated with each other through cov⁡(W1,W2)=ρw\operatorname{cov}(W_1, W_2) = \rho_w, and both uncorrelated with the source AA. We assemble the covariance of Z=(A,Y1,Y2)TZ = (A, Y_1, Y_2)^T entry by entry, straight from the description:

Hence ΣZ=[444454+ρw44+ρw7].\begin{equation} \Sigma_Z = \begin{bmatrix} 4 & 4 & 4 \\ 4 & 5 & 4 + \rho_w \\ 4 & 4 + \rho_w & 7 \end{bmatrix}. \end{equation}

Rather than expand a 3×33 \times 3 determinant, use affine propagation backwards. Writing U=(A,W1,W2)TU = (A, W_1, W_2)^T, we have Z=MUZ = M U with the invertible matrix M=[100110101],ΣU=[40001ρw0ρw3].\begin{equation} M = \begin{bmatrix} 1 & 0 & 0 \\ 1 & 1 & 0 \\ 1 & 0 & 1 \end{bmatrix}, \qquad \Sigma_U = \begin{bmatrix} 4 & 0 & 0 \\ 0 & 1 & \rho_w \\ 0 & \rho_w & 3 \end{bmatrix}. \end{equation} Since MM is invertible, ΣZ=MΣUMT≽0\Sigma_Z = M \Sigma_U M^T \succeq 0 if and only if ΣU≽0\Sigma_U \succeq 0. The source block (4>04 > 0) is fine, so legality rests entirely on the 2×22 \times 2 noise block, which is positive semidefinite iff ρw2≤1⋅3,that is,|ρw|≤3≈1.732.\begin{equation} \rho_w^2 \le 1 \cdot 3, \qquad\text{that is,}\qquad \left\lvert \rho_w \right\rvert \le \sqrt{3} \approx 1.732. \end{equation} The legal range for the noise cross-covariance is capped by var⁡(W1)var⁡(W2)\sqrt{\operatorname{var}(W_1)\,\operatorname{var}(W_2)}, the geometric mean of the two noise variances. That is this session’s pitfall, landing on the worked example itself: push ρw\rho_w past 3\sqrt{3} and you have written down noise whose stated co-movement is impossible for its stated strengths. At the boundary ρw=3\rho_w = \sqrt{3} the matrix is singular (one eigenvalue is exactly 00), so some nonzero linear combination of AA, Y1Y_1, Y2Y_2 carries no variance at all. It is not a combination of the readings alone: their 2×22 \times 2 block [54+34+37]\left[\begin{smallmatrix} 5 & 4 + \sqrt 3 \\ 4 + \sqrt 3 & 7 \end{smallmatrix}\right] has determinant 16−83≈2.14>016 - 8\sqrt{3} \approx 2.14 > 0. The vanishing combination must involve the source itself. This exact source-plus-two-sensors setup returns in Session 14, where we fuse Y1Y_1 and Y2Y_2 into a best estimate of AA, one reading at a time; keep it in mind.

The 2×22 \times 2 legality test, proved both ways

The Development stated a test you can do by eye: with positive diagonal entries, Σ=[d1ccd2]\Sigma = \left[\begin{smallmatrix} d_1 & c \\ c & d_2 \end{smallmatrix}\right] is a legal covariance matrix iff c2≤d1d2c^2 \le d_1 d_2, that is, iff the would-be correlation ρ=c/d1d2\rho = c/\sqrt{d_1 d_2} lies in [−1,1][-1, 1]. We prove both directions. The proofs settle two debts: Session 8 deferred to today the reason |ρ|=1\left\lvert \rho \right\rvert = 1 means an exact line, and the Development called positive semidefiniteness the complete legality test without showing that a matrix passing it actually belongs to some random vector.

Necessity, and what ρ=±1\rho = \pm 1 means.

Suppose Σ\Sigma is the covariance of X=(X1,X2)TX = (X_1, X_2)^T, and write σi=di\sigma_i = \sqrt{d_i}. The standardized variables U=(X1−μX1)/σ1U = (X_1 - \mu_{X_1})/\sigma_1 and V=(X2−μX2)/σ2V = (X_2 - \mu_{X_2})/\sigma_2 have mean 00, variance 11, and cov⁡(U,V)=c/(σ1σ2)=ρ\operatorname{cov}(U, V) = c/(\sigma_1 \sigma_2) = \rho. Apply the corollary to the portfolios U−VU - V and U+VU + V, that is, a=(1,∓1)a = (1, \mp 1) on (U,V)(U, V): 0≤var⁡(U∓V)=var⁡(U)+var⁡(V)∓2cov⁡(U,V)=2(1∓ρ).\begin{equation} 0 \le \operatorname{var}(U \mp V) = \operatorname{var}(U) + \operatorname{var}(V) \mp 2\operatorname{cov}(U, V) = 2(1 \mp \rho). \label{eq:upmv} \end{equation} Hence −1≤ρ≤1-1 \le \rho \le 1, which is c2≤d1d2c^2 \le d_1 d_2: the Cauchy–Schwarz bound again, now as a consequence of “no portfolio has negative variance.” The equality cases come with it. A random variable with zero variance equals its mean with probability one (its squared deviation is never negative and has mean zero). So ρ=1\rho = 1 iff var⁡(U−V)=0\operatorname{var}(U - V) = 0 iff U=VU = V, that is, X2=μX2+σ2σ1(X1−μX1),\begin{equation} X_2 = \mu_{X_2} + \frac{\sigma_2}{\sigma_1}\,(X_1 - \mu_{X_1}), \end{equation} an exact line of positive slope; and ρ=−1\rho = -1 iff U+V=0U + V = 0, a line of negative slope. Conversely, if X2=αX1+βX_2 = \alpha X_1 + \beta with α≠0\alpha \ne 0, then cov⁡(X1,X2)=αvar⁡(X1)\operatorname{cov}(X_1, X_2) = \alpha \operatorname{var}(X_1) and σ2=|α|σ1\sigma_2 = \left\lvert \alpha \right\rvert\sigma_1, so ρ=α/|α|=±1\rho = \alpha/\left\lvert \alpha \right\rvert = \pm 1.

Equation [eq:upmv] also says why ρ\rho is a cosine. Read standard deviation as length, so that UU and VV are unit vectors. Then var⁡(U−V)=1+1−2ρ\operatorname{var}(U - V) = 1 + 1 - 2\rho is the law of cosines, ∥u−v∥2=∥u∥2+∥v∥2−2∥u∥∥v∥cos⁡θ\left\|u - v\right\|^2 = \left\|u\right\|^2 + \left\|v\right\|^2 - 2\left\|u\right\|\left\|v\right\|\cos\theta, with ρ\rho in the place of cos⁡θ\cos\theta. Correlation ±1\pm 1 is angle 00 or π\pi (parallel vectors, an exact line); correlation 00 is a right angle. Session 14 turns this geometry into estimation.

Sufficiency, by construction.

Now suppose only that d1>0d_1 > 0 and c2≤d1d2c^2 \le d_1 d_2. Take Z=(Z1,Z2)TZ = (Z_1, Z_2)^T with mean 00 and ΣZ=I\Sigma_Z = I (two uncorrelated unit-variance variables), and set X=BZ,B=[d10c/d1d2−c2/d1].\begin{equation} X = B Z, \qquad B = \begin{bmatrix} \sqrt{d_1} & 0 \\[2pt] c/\sqrt{d_1} & \sqrt{d_2 - c^2/d_1} \end{bmatrix}. \end{equation} The square root is real precisely because c2≤d1d2c^2 \le d_1 d_2. By affine propagation, ΣX=BIBT=[d1ccc2/d1+(d2−c2/d1)]=[d1ccd2].\begin{equation} \Sigma_X = B\, I\, B^T = \begin{bmatrix} d_1 & c \\ c & c^2/d_1 + (d_2 - c^2/d_1) \end{bmatrix} = \begin{bmatrix} d_1 & c \\ c & d_2 \end{bmatrix}. \end{equation} So every matrix that passes the test is the covariance of an actual random vector, and is legal. Read BB as a recipe for building correlated variables: X2X_2 is a shared part (c/d1)Z1(c/\sqrt{d_1})\, Z_1, a multiple of X1X_1’s own source, plus a private part of variance d2−c2/d1d_2 - c^2/d_1. The legality test says exactly that the private variance cannot be negative. At the boundary c2=d1d2c^2 = d_1 d_2 the private part vanishes and X2=(c/d1)X1X_2 = (c/d_1)\, X_1 exactly: the ρ=±1\rho = \pm 1 line of the necessity half. For the legal matrix of the Development the recipe reads X1=Z1X_1 = Z_1, X2=0.9Z1+0.19Z2≈0.9Z1+0.436Z2X_2 = 0.9\, Z_1 + \sqrt{0.19}\, Z_2 \approx 0.9\, Z_1 + 0.436\, Z_2; for the illegal one it asks for 1−1.44=−0.44\sqrt{1 - 1.44} = \sqrt{-0.44}, and breaks exactly where legality does. The lower-triangular BB is how correlated noise is simulated in practice, and it returns in Session 15, for any nn, as the Cholesky factor that draws random functions. (The pitfall below explains why, beyond 2×22 \times 2, no pairwise check can stand in for aTΣa≥0a^T \Sigma a \ge 0.)

Consolidation

Because the midterm is next meeting, we keep this short; the remaining time is for your questions on Sessions 1–9 (this session, like Sessions 10 and 11, is not on the midterm).

  1. (Affine propagation.) Let X=(X1,X2)TX = (X_1, X_2)^T be zero-mean with ΣX=[2001]\Sigma_X = \left[\begin{smallmatrix} 2 & 0 \\ 0 & 1 \end{smallmatrix}\right]. Form the sum and difference Y1=X1+X2Y_1 = X_1 + X_2, Y2=X1−X2Y_2 = X_1 - X_2, i.e. Y=AXY = A X with A=[111−1]A = \left[\begin{smallmatrix} 1 & 1 \\ 1 & -1 \end{smallmatrix}\right]. Compute ΣY\Sigma_Y, and note that the sum and difference are correlated even though X1,X2X_1, X_2 are not. (Answer: ΣY=AΣXAT=[3113]\Sigma_Y = A \Sigma_X A^T = \left[\begin{smallmatrix} 3 & 1 \\ 1 & 3 \end{smallmatrix}\right].)

  2. (Uncorrelated or independent?) The hydrophone description assumed only that the noises are uncorrelated with AA. Would any entry of ΣZ\Sigma_Z change if they were independent of AA instead? Then what does independence add? (Answer: no entry changes, because ΣZ\Sigma_Z is built from second moments alone and uncorrelatedness is exactly the second-moment statement; today’s calculus needs nothing more. Independence adds control of every function of the variables, not just linear ones. On the unit circle, for instance, XX and YY are uncorrelated, yet Y2=1−X2Y^2 = 1 - X^2 makes X2X^2 and Y2Y^2 perfectly anti-correlated, ρX2Y2=−1\rho_{X^2 Y^2} = -1, which independence would forbid.)

Synthesis

Movement IV asks the three questions of the thesis about a vector of coupled unknowns, and today supplied the grammar. The covariance matrix is the geometry of shared uncertainty: its diagonal is the old per-variable variance, its off-diagonals are the entanglement a single number could not hold, and its one law, positive semidefiniteness, is not a technicality but the statement that no combination of the variables can have negative variance (and, for a pair, it is also exactly what lets us build the variables from uncorrelated pieces). Two formulas carry that geometry through every linear operation, μY=AμX+b\mu_Y = A\mu_X + b and ΣY=AΣXAT\Sigma_Y = A\Sigma_X A^T, and one warning guards the reader: zero correlation is not independence. Next session hands one distinguished distribution, the Gaussian, to this same covariance matrix, and belief-updating becomes two matrix formulas.

Self-check questions

  1. Why must a covariance matrix be positive semidefinite, and what real quantity would a violation claim to be negative?

  2. You transform XX by Y=AX+bY = AX + b. Write ΣY\Sigma_Y, and say in one phrase why the constant bb does not appear.

  3. Give a pair of variables with ρ=0\rho = 0 that are nonetheless completely dependent, and name the family in which this cannot happen.

Pitfall. Three slips recur. (i) Illegal off-diagonals: a 2×22 \times 2 covariance needs |off-diagonal|≤d1d2\left\lvert \text{off-diagonal} \right\rvert \le \sqrt{d_1 d_2}, the geometric mean of the diagonals; the hydrophone bound |ρw|≤3\left\lvert \rho_w \right\rvert \le \sqrt{3} is this same rule on the noise block. Beware that this pairwise check is the whole story only for 2×22 \times 2 (worked example 3.2 proved that much): in three or more dimensions a matrix can pass every pairwise check and still fail to be positive semidefinite, so the complete test is always aTΣa≥0a^T \Sigma a \ge 0 for all aa (equivalently, all eigenvalues nonnegative). (ii) Reading ρ=0\rho = 0 as independence: it means no linear co-movement only (the unit circle). (iii) Dropping the transpose: covariance propagates as AΣATA \Sigma A^T; make the dimension check a habit.