The uppercase Greek letter sigma used for the covariance matrix of a random vector r∈Rp. Entry Σij=Cov(ri,rj). The diagonal entries are variances; off-diagonal entries are covariances. Not to be confused with the summation ∑ (lowercase indices) — context and font distinguish them.
$\mathbf{x}^T A \mathbf{x}$x transpose A x — quadratic form
A quadratic form in x defined by matrix A. The result is a scalar — a degree-2 polynomial in the components of x. For symmetric A, the quadratic form uniquely determines A. Portfolio variance wTΣw is the fundamental financial quadratic form.
$\bar{\mathbf{x}}$x bar — sample mean vector
The sample mean vector: xˉ=n1∑t=1nxt. Each component xˉj is the sample mean of the j-th variable. The mean-centered data matrix has rows (xt−xˉ)T — translating the data cloud to the origin before computing scatter.
$S$S — sample covariance matrix
The unbiased sample covariance matrix: S=n−11∑t=1n(xt−xˉ)(xt−xˉ)T. Dividing by n−1 (Bessel's correction) rather than n makes S an unbiased estimator of the population covariance Σ. Always symmetric PSD; PD when n>p.
$\rho_{ij}$rho i j — correlation
The Pearson correlation between assets i and j: ρij=ΣiiΣjjΣij. Always in [−1,1]. The correlation matrix C has Cij=ρij and ones on the diagonal. Σ=DCD where D=diag(Σ11,…,Σpp).
01 · Quadratic Forms
A quadratic form is the generalisation of ax2 to multiple variables. Instead of one variable, you have a vector x; instead of the scalar coefficient a, you have a matrix A.
Definition — Quadratic Form
Given a symmetric matrix A∈Rn×n, the quadratic form in x∈Rn is:
Q(x)=xTAx=∑i=1n∑j=1naijxixj
Every quadratic polynomial with no linear or constant terms can be written as xTAx for a unique symmetric A. The diagonal entry aii is the coefficient of xi2; the off-diagonal entry 2aij (for i=j) is the coefficient of xixj.
Step-by-step — Expanding $\mathbf{x}^TA\mathbf{x}$ for $A=\begin{pmatrix}2&1\\1&3\end{pmatrix}$, $\mathbf{x}=\begin{pmatrix}x_1\\x_2\end{pmatrix}$
The two cross terms x1x2 add up because a12=a21=1.
3
Read off the structure: coefficient of x12 is a11=2; coefficient of x22 is a22=3; coefficient of x1x2 is a12+a21=2a12=2. Always: for symmetric A, the coefficient of xixj (with i=j) in xTAx is 2aij.
✓ Example — Evaluating a Quadratic Form at a Specific Point
A=(2113), x=(2−1).
Q(x)=2(2)2+2(2)(−1)+3(−1)2=8−4+3=7.
Check via matrix product: Ax=(3−1); xT(Ax)=2(3)+(−1)(−1)=6+1=7 ✓.
❌ What Breaks — Asymmetric Matrix Changes the Quadratic Form
Writing a quadratic form using an asymmetric matrix is valid but non-unique. If A is asymmetric, xTAx=xT(2A+AT)x — the quadratic form depends only on the symmetric part 2A+AT, not on the antisymmetric part 2A−AT. The antisymmetric contribution xT2A−ATx=0 for all x. When working with quadratic forms, always symmetrise A first.
02 · Classifying Quadratic Forms
The sign of xTAx classifies the matrix and the form.
Sign of xTAx
Classification
Eigenvalues
>0 for all x=0
Positive definite
All λi>0
≥0 for all x
Positive semi-definite
All λi≥0
≤0 for all x
Negative semi-definite
All λi≤0
<0 for all x=0
Negative definite
All λi<0
Both signs possible
Indefinite
Mixed signs
Indefinite quadratic forms arise in saddle-point problems in optimisation — the Hessian is indefinite at a saddle point.
03 · The Sample Covariance Matrix
The sample covariance matrix is the key object connecting statistics to linear algebra.
Definition — Sample Covariance Matrix
Given n observations of a p-dimensional random vector, arranged as rows of a data matrix X∈Rn×p, the sample covariance matrix is:
S=n−11XcTXc
where Xc is the mean-centered data matrix with rows (xt−xˉ)T and xˉ=n1∑txt.
S11=0.0004 is the sample variance of Asset 1 (standard deviation ≈2%). S22=0.0001 is the sample variance of Asset 2 (standard deviation 1%). S12=−0.0002: assets move opposite each other (negative covariance).
Bessel's Correction: $n-1$ not $n$
Dividing by n−1 rather than n corrects for the bias introduced by estimating the mean from the same data. With n observations, once you fix the sample mean, only n−1 deviations are free — the last one is determined by the constraint that deviations sum to zero. Dividing by n gives a biased estimate; n−1 gives the unbiased estimate.
04 · Portfolio Variance as a Quadratic Form
The most direct application of the covariance matrix in finance is portfolio variance.
Definition — Portfolio Variance
Given a portfolio with weight vector w∈Rp (with ∑iwi=1) and asset covariance matrix Σ, the portfolio variance is:
σp2=wTΣw=∑i=1p∑j=1pwiΣijwj
This is a quadratic form in the weights. Since Σ⪰0, σp2≥0 for all w — portfolio variance cannot be negative. Since portfolio variance is a quadratic form, minimising variance over all weights w is a convex quadratic programme — it has a unique global minimum.
✓ Example — Two-Asset Portfolio Variance
Two assets with Σ=(0.040.020.020.01) and weights w=(0.60.4).
Portfolio standard deviation: σp=0.0256=0.16=16%. The 2× cross term 2(0.6)(0.4)(0.02) comes from Σ12=Σ21=0.02 appearing in both (i,j)=(1,2) and (i,j)=(2,1) in the double sum.
05 · Spectral Decomposition of the Covariance Matrix
Since Σ is symmetric PSD, the spectral theorem gives Σ=QΛQT where Q is orthogonal and Λ=diag(λ1,…,λp) with λi≥0.
Portfolio variance in the eigenvector basis: Let f=QTw (coordinates of w in the eigenvector basis).
σp2=wTΣw=wTQΛQTw=(QTw)TΛ(QTw)=fTΛf=∑k=1pλkfk2
Each term λkfk2 is the variance contribution from principal component k. The eigenvalue λk is the variance of the k-th PC; the coefficient fk is the portfolio's exposure to PC k.
To minimise portfolio variance while maintaining expected return, you want to avoid loading heavily on large-λk directions — the high-variance PCs.
06 · Correlation Matrix and Standardisation
The covariance matrix conflates two things: the scale of each asset (measured in return2) and the linear dependence structure. The correlation matrix separates these.
Definition — Correlation Matrix
The correlation matrixC is obtained by standardising the covariance matrix:
Cij=ρij=ΣiiΣjjΣij,C=D−1ΣD−1
where D=diag(Σ11,…,Σpp) is the diagonal matrix of standard deviations.
Equivalently: Σ=DCD.
C has ones on the diagonal and entries in [−1,1]. C is PSD (since xTCx=∥D−1x∥ under the Mahalanobis metric... more precisely: C is PSD because Σ=DCD and D is invertible).
Step-by-step — Extracting correlations from $\Sigma=\begin{pmatrix}0.04&0.03\\0.03&0.09\end{pmatrix}$
1
Read off variances:Σ11=0.04 (Asset 1 variance), Σ22=0.09 (Asset 2 variance). Standard deviations: σ1=0.04=0.2=20%, σ2=0.09=0.3=30%.
ρ=0.5 means the two assets have moderate positive co-movement. The correlation does not depend on the units (percent, basis points, etc.) — it is dimensionless.
07 · Practice Exercises
EXERCISE 15.1
For diagonal entry aii: the coefficient of xi2 in xTAx. For off-diagonal aij: the coefficient of xixj in the expansion is 2aij (because A is symmetric). Work backwards from the polynomial.
Reading coefficients: a11=5 (coeff of x12); a22=3 (coeff of x22); a33=1 (coeff of x32).
Cross terms: coeff of x1x2 is 4=2a12⇒a12=2. Coeff of x1x3 is −2=2a13⇒a13=−1. Coeff of x2x3 is 6=2a23⇒a23=3.
A=52−1233−131
Verify: e1TAe1=5 ✓; e2TAe2=3 ✓; (e1+e2)TA(e1+e2)=5+2(2)+3=12, which matches 5(1)+4(1)(1)+3(1)=12 ✓.
Find the symmetric matrix A such that xTAx=5x12+4x1x2−2x1x3+3x22+6x2x3+x32.
EXERCISE 15.2
Compute the sample mean vector, mean-center the data matrix, form XcTXc, and divide by n−1. Then extract the diagonal for variances and use ρ=S12/S11S22 for correlation.
σ1=σ2=2.5≈1.58. Correlation: ρ=2.5−2.5=−1 — perfect negative correlation. Asset 2's returns are exactly 6− Asset 1's returns — they always move in opposite directions by the same amount.
Compute the 2×2 sample covariance matrix S from the data X=2435142315 (5 observations, 2 assets). Also compute the correlation ρ12 and interpret the result.
EXERCISE 15.3
Expand wTΣw=∑i∑jwiΣijwj using Σ11, Σ22, Σ12=Σ21. The cross term appears twice. Then minimise over w1=1−w2.
Two assets have covariance matrix Σ=(0.090.060.060.16). Write portfolio variance σp2=wTΣw as a function of w1=w (with w2=1−w), find the minimum-variance portfolio weight, and compute the minimum portfolio standard deviation.
EXERCISE 15.4
Σ=QΛQT where Q has eigenvectors as columns. Portfolio variance becomes fTΛf=∑λkfk2 where f=QTw. The variance is dominated by the eigenvector direction with the largest λk.
PC exposures: f=QTw=21(111−1)(0.50.5)=21(10)=(1/20).
σp2=fTΛf=3(1/2)2+1(0)2=3/2.
Direct check: wTΣw=0.25(2)+2(0.25)(1)+0.25(2)=0.5+0.5+0.5=1.5 ✓.
Interpretation: the equal-weight portfolio has exposure only to PC1 (λ1=3). It has zero exposure to the long-short direction (λ2=1). All variance (1.5) comes from the market/PC1 direction.
For Σ=(2112) and w=(0.50.5), compute the portfolio variance using the spectral decomposition: (1) find eigenvalues and eigenvectors of Σ, (2) compute PC exposures f=QTw, (3) evaluate σp2=fTΛf. Verify against the direct formula.
EXERCISE 15.5
The correlation matrix C satisfies Σ=DCD where D=diag(σ1,σ2,σ3). So C=D−1ΣD−1. Verify C has ones on the diagonal and check that ∣ρij∣≤1.
Σ=42−1293−131.
Standard deviations: σ1=4=2, σ2=9=3, σ3=1=1.
C23=1 means Assets 2 and 3 are perfectly positively correlated — they move in lockstep. det(C)=0 — confirming the covariance matrix is PSD but not PD.
Extract the correlation matrix C from Σ=42−1293−131. Compute all pairwise correlations, identify any perfectly correlated pair, and state what that implies about the rank of Σ.
EXERCISE 15.6
The variance of a long-short portfolio w=(1,−1)T/2 (normalised) is 21wTΣw with w=(1,−1)T. Correlation ρ appears in the off-diagonal; as ρ→1 the variance goes to zero. Connect to the eigenvalue λ2=σ2(1−ρ).
Σ=σ2(1ρρ1) for two assets with equal variance σ2 and correlation ρ.
Long-short portfoliow=(1,−1)T:
σLS2=wTΣw=σ2(1−2ρ+1)=2σ2(1−ρ).
Eigenvalues of Σ:λ1=σ2(1+ρ), λ2=σ2(1−ρ).
The long-short portfolio is the eigenvector 21(1,−1)T associated with λ2=σ2(1−ρ). Portfolio variance =∥(1,−1)T∥2⋅λ2/(∥(1,−1)T∥2)... more directly: σLS2=2σ2(1−ρ)=2λ2.
As ρ→1: σLS2→0 — the long-short portfolio becomes risk-free. This is statistical arbitrage: if two stocks are highly correlated (ρ≈1), a long-short position in them has nearly zero variance while capturing the mean-reversion of their spread.
As ρ→−1: σLS2→4σ2 — maximum variance, the two assets always move opposite each other, amplifying the long-short swing.
Two assets have equal variance σ2 and correlation ρ, giving covariance matrix Σ=σ2(1ρρ1). Compute the variance of the long-short portfolio w=(1,−1)T as a function of ρ. Explain what happens as ρ→1 and connect this to statistical arbitrage.
08 · Chapter Summary
Concept
Key Formula
Quadratic form
Q(x)=xTAx=∑ijaijxixj
Diagonal of A
Coefficient of xi2 in xTAx
Off-diagonal of A
Half the coefficient of xixj (for i=j)
Classify form
PD/PSD/ND/NSD/Indefinite by sign of Q(x) for all x
Sample covariance
S=n−11XcTXc; always PSD; PD when n>p
Portfolio variance
σp2=wTΣw; quadratic form in weights
Spectral decomposition
Σ=QΛQT; σp2=∑kλkfk2; f=QTw
Correlation matrix
C=D−1ΣD−1; entries in [−1,1]; ones on diagonal
ρ=1 assets
Covariance matrix singular; long-short has zero variance
Nearest PSD fix
Replace negative eigenvalues with ϵ>0; Σ^=QΛ+QT
Next: Chapter 16 — Matrix Decompositions (LU) introduces the LU factorisation as the matrix encoding of Gaussian elimination, providing an efficient method for solving multiple linear systems with the same coefficient matrix.