Chapter 15

Covariance Matrices & Quadratic Forms

00 · Symbol Glossary

$\Sigma$Sigma — covariance matrix

The uppercase Greek letter sigma used for the covariance matrix of a random vector rRp\mathbf{r}\in\mathbb{R}^p. Entry Σij=Cov(ri,rj)\Sigma_{ij}=\text{Cov}(r_i,r_j). The diagonal entries are variances; off-diagonal entries are covariances. Not to be confused with the summation \sum (lowercase indices) — context and font distinguish them.

$\mathbf{x}^T A \mathbf{x}$x transpose A x — quadratic form

A quadratic form in x\mathbf{x} defined by matrix AA. The result is a scalar — a degree-2 polynomial in the components of x\mathbf{x}. For symmetric AA, the quadratic form uniquely determines AA. Portfolio variance wTΣw\mathbf{w}^T\Sigma\mathbf{w} is the fundamental financial quadratic form.

$\bar{\mathbf{x}}$x bar — sample mean vector

The sample mean vector: xˉ=1nt=1nxt\bar{\mathbf{x}} = \frac{1}{n}\sum_{t=1}^n \mathbf{x}_t. Each component xˉj\bar{x}_j is the sample mean of the jj-th variable. The mean-centered data matrix has rows (xtxˉ)T(\mathbf{x}_t-\bar{\mathbf{x}})^T — translating the data cloud to the origin before computing scatter.

$S$S — sample covariance matrix

The unbiased sample covariance matrix: S=1n1t=1n(xtxˉ)(xtxˉ)TS=\frac{1}{n-1}\sum_{t=1}^n(\mathbf{x}_t-\bar{\mathbf{x}})(\mathbf{x}_t-\bar{\mathbf{x}})^T. Dividing by n1n-1 (Bessel's correction) rather than nn makes SS an unbiased estimator of the population covariance Σ\Sigma. Always symmetric PSD; PD when n>pn>p.

$\rho_{ij}$rho i j — correlation

The Pearson correlation between assets ii and jj: ρij=ΣijΣiiΣjj\rho_{ij}=\frac{\Sigma_{ij}}{\sqrt{\Sigma_{ii}\Sigma_{jj}}}. Always in [1,1][-1,1]. The correlation matrix C\mathbf{C} has Cij=ρijC_{ij}=\rho_{ij} and ones on the diagonal. Σ=DCD\Sigma = D\mathbf{C}D where D=diag(Σ11,,Σpp)D=\text{diag}(\sqrt{\Sigma_{11}},\ldots,\sqrt{\Sigma_{pp}}).


01 · Quadratic Forms

A quadratic form is the generalisation of ax2ax^2 to multiple variables. Instead of one variable, you have a vector x\mathbf{x}; instead of the scalar coefficient aa, you have a matrix AA.

Definition — Quadratic Form

Given a symmetric matrix ARn×nA \in \mathbb{R}^{n\times n}, the quadratic form in xRn\mathbf{x}\in\mathbb{R}^n is:

Q(x)=xTAx=i=1nj=1naijxixjQ(\mathbf{x}) = \mathbf{x}^T A \mathbf{x} = \sum_{i=1}^n\sum_{j=1}^n a_{ij} x_i x_j

Every quadratic polynomial with no linear or constant terms can be written as xTAx\mathbf{x}^TA\mathbf{x} for a unique symmetric AA. The diagonal entry aiia_{ii} is the coefficient of xi2x_i^2; the off-diagonal entry 2aij2a_{ij} (for iji\neq j) is the coefficient of xixjx_ix_j.

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}$
1

Compute AxA\mathbf{x} first:

Ax=(2113)(x1x2)=(2x1+x2x1+3x2)A\mathbf{x} = \begin{pmatrix}2&1\\1&3\end{pmatrix}\begin{pmatrix}x_1\\x_2\end{pmatrix} = \begin{pmatrix}2x_1+x_2\\x_1+3x_2\end{pmatrix}
2

Multiply xT(Ax)\mathbf{x}^T(A\mathbf{x}):

xTAx=x1(2x1+x2)+x2(x1+3x2)=2x12+x1x2+x1x2+3x22=2x12+2x1x2+3x22\mathbf{x}^T A\mathbf{x} = x_1(2x_1+x_2) + x_2(x_1+3x_2) = 2x_1^2 + x_1x_2 + x_1x_2 + 3x_2^2 = 2x_1^2 + 2x_1x_2 + 3x_2^2.

The two cross terms x1x2x_1x_2 add up because a12=a21=1a_{12}=a_{21}=1.

3

Read off the structure: coefficient of x12x_1^2 is a11=2a_{11}=2; coefficient of x22x_2^2 is a22=3a_{22}=3; coefficient of x1x2x_1x_2 is a12+a21=2a12=2a_{12}+a_{21}=2a_{12}=2. Always: for symmetric AA, the coefficient of xixjx_ix_j (with iji\neq j) in xTAx\mathbf{x}^TA\mathbf{x} is 2aij2a_{ij}.

✓ Example — Evaluating a Quadratic Form at a Specific Point

A=(2113)A=\begin{pmatrix}2&1\\1&3\end{pmatrix}, x=(21)\mathbf{x}=\begin{pmatrix}2\\-1\end{pmatrix}.

Q(x)=2(2)2+2(2)(1)+3(1)2=84+3=7Q(\mathbf{x}) = 2(2)^2 + 2(2)(-1) + 3(-1)^2 = 8 - 4 + 3 = 7.

Check via matrix product: Ax=(31)A\mathbf{x}=\begin{pmatrix}3\\-1\end{pmatrix}; xT(Ax)=2(3)+(1)(1)=6+1=7\mathbf{x}^T(A\mathbf{x})=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 AA is asymmetric, xTAx=xT(A+AT2)x\mathbf{x}^TA\mathbf{x} = \mathbf{x}^T(\frac{A+A^T}{2})\mathbf{x} — the quadratic form depends only on the symmetric part A+AT2\frac{A+A^T}{2}, not on the antisymmetric part AAT2\frac{A-A^T}{2}. The antisymmetric contribution xTAAT2x=0\mathbf{x}^T\frac{A-A^T}{2}\mathbf{x}=0 for all x\mathbf{x}. When working with quadratic forms, always symmetrise AA first.


02 · Classifying Quadratic Forms

The sign of xTAx\mathbf{x}^TA\mathbf{x} classifies the matrix and the form.

Sign of xTAx\mathbf{x}^TA\mathbf{x}ClassificationEigenvalues
>0> 0 for all x0\mathbf{x}\neq\mathbf{0}Positive definiteAll λi>0\lambda_i > 0
0\geq 0 for all x\mathbf{x}Positive semi-definiteAll λi0\lambda_i \geq 0
0\leq 0 for all x\mathbf{x}Negative semi-definiteAll λi0\lambda_i \leq 0
<0< 0 for all x0\mathbf{x}\neq\mathbf{0}Negative definiteAll λi<0\lambda_i < 0
Both signs possibleIndefiniteMixed 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 nn observations of a pp-dimensional random vector, arranged as rows of a data matrix XRn×pX \in \mathbb{R}^{n\times p}, the sample covariance matrix is:

S=1n1XcTXcS = \frac{1}{n-1} X_c^T X_c

where XcX_c is the mean-centered data matrix with rows (xtxˉ)T(\mathbf{x}_t - \bar{\mathbf{x}})^T and xˉ=1ntxt\bar{\mathbf{x}} = \frac{1}{n}\sum_t \mathbf{x}_t.

Equivalently: Sij=1n1t=1n(xtixˉi)(xtjxˉj)S_{ij} = \frac{1}{n-1}\sum_{t=1}^n (x_{ti}-\bar{x}_i)(x_{tj}-\bar{x}_j).

Structure: SS is symmetric (Sij=SjiS_{ij}=S_{ji}), PSD (S=1n1XcTXc0S=\frac{1}{n-1}X_c^TX_c\succeq0), and PD when rank(Xc)=p\text{rank}(X_c)=p (i.e. n>pn>p and no column of XX is a linear combination of others).

Step-by-step — Computing the sample covariance matrix from 3 observations of 2 assets
1

Set up data: 3 daily returns for two assets.

X=(0.010.020.030.010.010.03)X = \begin{pmatrix}0.01 & 0.02 \\ 0.03 & 0.01 \\ -0.01 & 0.03\end{pmatrix}

Rows = days. Columns = Asset 1, Asset 2.

2

Compute sample means: xˉ1=(0.01+0.030.01)/3=0.03/3=0.01\bar{x}_1 = (0.01+0.03-0.01)/3 = 0.03/3 = 0.01. xˉ2=(0.02+0.01+0.03)/3=0.06/3=0.02\bar{x}_2=(0.02+0.01+0.03)/3=0.06/3=0.02.

3

Mean-center the data: subtract xˉT=(0.01,0.02)\bar{\mathbf{x}}^T=(0.01,0.02) from each row.

Xc=(0.010.010.020.020.030.010.010.020.010.010.030.02)=(000.020.010.020.01)X_c = \begin{pmatrix}0.01-0.01 & 0.02-0.02\\0.03-0.01 & 0.01-0.02\\-0.01-0.01 & 0.03-0.02\end{pmatrix} = \begin{pmatrix}0 & 0\\0.02 & -0.01\\-0.02 & 0.01\end{pmatrix}

Check: each column of XcX_c sums to zero — the centring worked. (0+0.020.02=0)(0+0.02-0.02=0), (00.01+0.01=0)(0-0.01+0.01=0) ✓.

4

Compute XcTXcX_c^TX_c:

XcTXc=(00.020.0200.010.01)(000.020.010.020.01)X_c^TX_c = \begin{pmatrix}0&0.02&-0.02\\0&-0.01&0.01\end{pmatrix}\begin{pmatrix}0&0\\0.02&-0.01\\-0.02&0.01\end{pmatrix}

(1,1)(1,1): 0+0.0004+0.0004=0.00080+0.0004+0.0004=0.0008. (1,2)=(2,1)(1,2)=(2,1): 00.00020.0002=0.00040-0.0002-0.0002=-0.0004. (2,2)(2,2): 0+0.0001+0.0001=0.00020+0.0001+0.0001=0.0002.

XcTXc=(0.00080.00040.00040.0002)X_c^TX_c = \begin{pmatrix}0.0008 & -0.0004\\-0.0004 & 0.0002\end{pmatrix}.

5

Divide by n1=2n-1=2:

S=12(0.00080.00040.00040.0002)=(0.00040.00020.00020.0001)S = \frac{1}{2}\begin{pmatrix}0.0008 & -0.0004\\-0.0004 & 0.0002\end{pmatrix} = \begin{pmatrix}0.0004 & -0.0002\\-0.0002 & 0.0001\end{pmatrix}

S11=0.0004S_{11}=0.0004 is the sample variance of Asset 1 (standard deviation 2%\approx2\%). S22=0.0001S_{22}=0.0001 is the sample variance of Asset 2 (standard deviation 1%1\%). S12=0.0002S_{12}=-0.0002: assets move opposite each other (negative covariance).

Bessel's Correction: $n-1$ not $n$

Dividing by n1n-1 rather than nn corrects for the bias introduced by estimating the mean from the same data. With nn observations, once you fix the sample mean, only n1n-1 deviations are free — the last one is determined by the constraint that deviations sum to zero. Dividing by nn gives a biased estimate; n1n-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 wRp\mathbf{w}\in\mathbb{R}^p (with iwi=1\sum_i w_i=1) and asset covariance matrix Σ\Sigma, the portfolio variance is:

σp2=wTΣw=i=1pj=1pwiΣijwj\sigma_p^2 = \mathbf{w}^T \Sigma \mathbf{w} = \sum_{i=1}^p\sum_{j=1}^p w_i \Sigma_{ij} w_j

This is a quadratic form in the weights. Since Σ0\Sigma\succeq0, σp20\sigma_p^2\geq0 for all w\mathbf{w} — portfolio variance cannot be negative. Since portfolio variance is a quadratic form, minimising variance over all weights w\mathbf{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)\Sigma=\begin{pmatrix}0.04&0.02\\0.02&0.01\end{pmatrix} and weights w=(0.60.4)\mathbf{w}=\begin{pmatrix}0.6\\0.4\end{pmatrix}.

wTΣw=0.62(0.04)+2(0.6)(0.4)(0.02)+0.42(0.01)\mathbf{w}^T\Sigma\mathbf{w}=0.6^2(0.04)+2(0.6)(0.4)(0.02)+0.4^2(0.01)

=0.36(0.04)+0.48(0.02)+0.16(0.01)=0.0144+0.0096+0.0016=0.0256= 0.36(0.04)+0.48(0.02)+0.16(0.01) = 0.0144+0.0096+0.0016=0.0256.

Portfolio standard deviation: σp=0.0256=0.16=16%\sigma_p=\sqrt{0.0256}=0.16=16\%. The 2×2\times cross term 2(0.6)(0.4)(0.02)2(0.6)(0.4)(0.02) comes from Σ12=Σ21=0.02\Sigma_{12}=\Sigma_{21}=0.02 appearing in both (i,j)=(1,2)(i,j)=(1,2) and (i,j)=(2,1)(i,j)=(2,1) in the double sum.


05 · Spectral Decomposition of the Covariance Matrix

Since Σ\Sigma is symmetric PSD, the spectral theorem gives Σ=QΛQT\Sigma=Q\Lambda Q^T where QQ is orthogonal and Λ=diag(λ1,,λp)\Lambda=\text{diag}(\lambda_1,\ldots,\lambda_p) with λi0\lambda_i\geq0.

Portfolio variance in the eigenvector basis: Let f=QTw\mathbf{f}=Q^T\mathbf{w} (coordinates of w\mathbf{w} in the eigenvector basis).

σp2=wTΣw=wTQΛQTw=(QTw)TΛ(QTw)=fTΛf=k=1pλkfk2\sigma_p^2 = \mathbf{w}^T\Sigma\mathbf{w} = \mathbf{w}^TQ\Lambda Q^T\mathbf{w} = (Q^T\mathbf{w})^T\Lambda(Q^T\mathbf{w}) = \mathbf{f}^T\Lambda\mathbf{f} = \sum_{k=1}^p \lambda_k f_k^2

Each term λkfk2\lambda_k f_k^2 is the variance contribution from principal component kk. The eigenvalue λk\lambda_k is the variance of the kk-th PC; the coefficient fkf_k is the portfolio's exposure to PC kk.

To minimise portfolio variance while maintaining expected return, you want to avoid loading heavily on large-λk\lambda_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\text{return}^2) and the linear dependence structure. The correlation matrix separates these.

Definition — Correlation Matrix

The correlation matrix C\mathbf{C} is obtained by standardising the covariance matrix:

Cij=ρij=ΣijΣiiΣjj,C=D1ΣD1C_{ij} = \rho_{ij} = \frac{\Sigma_{ij}}{\sqrt{\Sigma_{ii}}\sqrt{\Sigma_{jj}}}, \qquad \mathbf{C} = D^{-1}\Sigma D^{-1}

where D=diag(Σ11,,Σpp)D = \text{diag}(\sqrt{\Sigma_{11}},\ldots,\sqrt{\Sigma_{pp}}) is the diagonal matrix of standard deviations.

Equivalently: Σ=DCD\Sigma = D\mathbf{C}D.

C\mathbf{C} has ones on the diagonal and entries in [1,1][-1,1]. C\mathbf{C} is PSD (since xTCx=D1x\mathbf{x}^T\mathbf{C}\mathbf{x}=\|D^{-1}\mathbf{x}\| under the Mahalanobis metric... more precisely: C\mathbf{C} is PSD because Σ=DCD\Sigma=DCD and DD 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\Sigma_{11}=0.04 (Asset 1 variance), Σ22=0.09\Sigma_{22}=0.09 (Asset 2 variance). Standard deviations: σ1=0.04=0.2=20%\sigma_1=\sqrt{0.04}=0.2=20\%, σ2=0.09=0.3=30%\sigma_2=\sqrt{0.09}=0.3=30\%.

2

Compute correlation: ρ12=Σ12σ1σ2=0.030.2×0.3=0.030.06=0.5\rho_{12}=\frac{\Sigma_{12}}{\sigma_1\sigma_2}=\frac{0.03}{0.2\times0.3}=\frac{0.03}{0.06}=0.5.

3

Write the correlation matrix:

C=(10.50.51)\mathbf{C} = \begin{pmatrix}1 & 0.5 \\ 0.5 & 1\end{pmatrix}

ρ=0.5\rho=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 aiia_{ii}: the coefficient of xi2x_i^2 in xTAx\mathbf{x}^TA\mathbf{x}. For off-diagonal aija_{ij}: the coefficient of xixjx_ix_j in the expansion is 2aij2a_{ij} (because AA is symmetric). Work backwards from the polynomial.

Polynomial: Q(x)=5x12+4x1x22x1x3+3x22+6x2x3+x32Q(\mathbf{x})=5x_1^2+4x_1x_2-2x_1x_3+3x_2^2+6x_2x_3+x_3^2.

Reading coefficients: a11=5a_{11}=5 (coeff of x12x_1^2); a22=3a_{22}=3 (coeff of x22x_2^2); a33=1a_{33}=1 (coeff of x32x_3^2).

Cross terms: coeff of x1x2x_1x_2 is 4=2a12a12=24=2a_{12}\Rightarrow a_{12}=2. Coeff of x1x3x_1x_3 is 2=2a13a13=1-2=2a_{13}\Rightarrow a_{13}=-1. Coeff of x2x3x_2x_3 is 6=2a23a23=36=2a_{23}\Rightarrow a_{23}=3.

A=(521233131)A = \begin{pmatrix}5&2&-1\\2&3&3\\-1&3&1\end{pmatrix}

Verify: e1TAe1=5\mathbf{e}_1^TA\mathbf{e}_1=5 ✓; e2TAe2=3\mathbf{e}_2^TA\mathbf{e}_2=3 ✓; (e1+e2)TA(e1+e2)=5+2(2)+3=12(\mathbf{e}_1+\mathbf{e}_2)^TA(\mathbf{e}_1+\mathbf{e}_2)=5+2(2)+3=12, which matches 5(1)+4(1)(1)+3(1)=125(1)+4(1)(1)+3(1)=12 ✓.

Find the symmetric matrix AA such that xTAx=5x12+4x1x22x1x3+3x22+6x2x3+x32\mathbf{x}^TA\mathbf{x} = 5x_1^2 + 4x_1x_2 - 2x_1x_3 + 3x_2^2 + 6x_2x_3 + x_3^2.

EXERCISE 15.2

Compute the sample mean vector, mean-center the data matrix, form XcTXcX_c^TX_c, and divide by n1n-1. Then extract the diagonal for variances and use ρ=S12/S11S22\rho=S_{12}/\sqrt{S_{11}S_{22}} for correlation.

Data: X=(2442335115)X=\begin{pmatrix}2&4\\4&2\\3&3\\5&1\\1&5\end{pmatrix} (5 observations, 2 assets).

xˉ1=(2+4+3+5+1)/5=15/5=3\bar{x}_1=(2+4+3+5+1)/5=15/5=3. xˉ2=(4+2+3+1+5)/5=15/5=3\bar{x}_2=(4+2+3+1+5)/5=15/5=3.

Xc=(1111002222)X_c=\begin{pmatrix}-1&1\\1&-1\\0&0\\2&-2\\-2&2\end{pmatrix}.

XcTXc=((1)2+12+02+22+(2)2(1)(1)+1(1)+0+2(2)+(2)(2)(same by symmetry)12+(1)2+02+(2)2+22)X_c^TX_c=\begin{pmatrix}(-1)^2+1^2+0^2+2^2+(-2)^2 & (-1)(1)+1(-1)+0+2(-2)+(-2)(2)\\(\text{same by symmetry}) & 1^2+(-1)^2+0^2+(-2)^2+2^2\end{pmatrix}.

(1,1)(1,1): 1+1+0+4+4=101+1+0+4+4=10. (1,2)(1,2): 11+044=10-1-1+0-4-4=-10. (2,2)(2,2): 1+1+0+4+4=101+1+0+4+4=10.

S=14(10101010)=(2.52.52.52.5)S=\frac{1}{4}\begin{pmatrix}10&-10\\-10&10\end{pmatrix}=\begin{pmatrix}2.5&-2.5\\-2.5&2.5\end{pmatrix}.

σ1=σ2=2.51.58\sigma_1=\sigma_2=\sqrt{2.5}\approx1.58. Correlation: ρ=2.52.5=1\rho=\frac{-2.5}{2.5}=-1 — perfect negative correlation. Asset 2's returns are exactly 66- Asset 1's returns — they always move in opposite directions by the same amount.

Compute the 2×22\times2 sample covariance matrix SS from the data X=(2442335115)X=\begin{pmatrix}2&4\\4&2\\3&3\\5&1\\1&5\end{pmatrix} (5 observations, 2 assets). Also compute the correlation ρ12\rho_{12} and interpret the result.

EXERCISE 15.3

Expand wTΣw=ijwiΣijwj\mathbf{w}^T\Sigma\mathbf{w}=\sum_i\sum_j w_i\Sigma_{ij}w_j using Σ11\Sigma_{11}, Σ22\Sigma_{22}, Σ12=Σ21\Sigma_{12}=\Sigma_{21}. The cross term appears twice. Then minimise over w1=1w2w_1=1-w_2.

Σ=(0.090.060.060.16)\Sigma=\begin{pmatrix}0.09&0.06\\0.06&0.16\end{pmatrix}, w=(w1w)\mathbf{w}=\begin{pmatrix}w\\1-w\end{pmatrix}.

σp2=w2(0.09)+2w(1w)(0.06)+(1w)2(0.16)\sigma_p^2=w^2(0.09)+2w(1-w)(0.06)+(1-w)^2(0.16).

=0.09w2+0.12w0.12w2+0.160.32w+0.16w2=0.09w^2+0.12w-0.12w^2+0.16-0.32w+0.16w^2.

=(0.090.12+0.16)w2+(0.120.32)w+0.16=(0.09-0.12+0.16)w^2+(0.12-0.32)w+0.16.

=0.13w20.20w+0.16=0.13w^2-0.20w+0.16.

Minimise: dσp2dw=0.26w0.20=0w=0.200.26=10130.769\frac{d\sigma_p^2}{dw}=0.26w-0.20=0 \Rightarrow w^*=\frac{0.20}{0.26}=\frac{10}{13}\approx0.769.

w176.9%w_1^*\approx76.9\%, w223.1%w_2^*\approx23.1\%.

σp2=0.13(10/13)20.20(10/13)+0.16=0.13100169213+0.16=10013002001300+2081300=10813000.0831\sigma_p^{*2}=0.13(10/13)^2-0.20(10/13)+0.16=0.13\cdot\frac{100}{169}-\frac{2}{13}+0.16=\frac{100}{1300}-\frac{200}{1300}+\frac{208}{1300}=\frac{108}{1300}\approx0.0831.

Minimum portfolio std dev 28.8%\approx28.8\%.

Two assets have covariance matrix Σ=(0.090.060.060.16)\Sigma=\begin{pmatrix}0.09&0.06\\0.06&0.16\end{pmatrix}. Write portfolio variance σp2=wTΣw\sigma_p^2=\mathbf{w}^T\Sigma\mathbf{w} as a function of w1=ww_1=w (with w2=1ww_2=1-w), find the minimum-variance portfolio weight, and compute the minimum portfolio standard deviation.

EXERCISE 15.4

Σ=QΛQT\Sigma=Q\Lambda Q^T where QQ has eigenvectors as columns. Portfolio variance becomes fTΛf=λkfk2\mathbf{f}^T\Lambda\mathbf{f}=\sum\lambda_kf_k^2 where f=QTw\mathbf{f}=Q^T\mathbf{w}. The variance is dominated by the eigenvector direction with the largest λk\lambda_k.

Σ=(2112)\Sigma=\begin{pmatrix}2&1\\1&2\end{pmatrix}, w=(0.50.5)\mathbf{w}=\begin{pmatrix}0.5\\0.5\end{pmatrix}.

Eigenvalues: p(λ)=(2λ)21=λ24λ+3=(λ3)(λ1)p(\lambda)=(2-\lambda)^2-1=\lambda^2-4\lambda+3=(\lambda-3)(\lambda-1). λ1=3\lambda_1=3, λ2=1\lambda_2=1.

Eigenvectors: λ1=3\lambda_1=3: q1=12(11)\mathbf{q}_1=\frac{1}{\sqrt{2}}\begin{pmatrix}1\\1\end{pmatrix} (equal-weight direction). λ2=1\lambda_2=1: q2=12(11)\mathbf{q}_2=\frac{1}{\sqrt{2}}\begin{pmatrix}1\\-1\end{pmatrix} (long-short direction).

PC exposures: f=QTw=12(1111)(0.50.5)=12(10)=(1/20)\mathbf{f}=Q^T\mathbf{w}=\frac{1}{\sqrt{2}}\begin{pmatrix}1&1\\1&-1\end{pmatrix}\begin{pmatrix}0.5\\0.5\end{pmatrix}=\frac{1}{\sqrt{2}}\begin{pmatrix}1\\0\end{pmatrix}=\begin{pmatrix}1/\sqrt{2}\\0\end{pmatrix}.

σp2=fTΛf=3(1/2)2+1(0)2=3/2\sigma_p^2=\mathbf{f}^T\Lambda\mathbf{f}=3(1/\sqrt{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\mathbf{w}^T\Sigma\mathbf{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\lambda_1=3). It has zero exposure to the long-short direction (λ2=1\lambda_2=1). All variance (1.5) comes from the market/PC1 direction.

For Σ=(2112)\Sigma=\begin{pmatrix}2&1\\1&2\end{pmatrix} and w=(0.50.5)\mathbf{w}=\begin{pmatrix}0.5\\0.5\end{pmatrix}, compute the portfolio variance using the spectral decomposition: (1) find eigenvalues and eigenvectors of Σ\Sigma, (2) compute PC exposures f=QTw\mathbf{f}=Q^T\mathbf{w}, (3) evaluate σp2=fTΛf\sigma_p^2=\mathbf{f}^T\Lambda\mathbf{f}. Verify against the direct formula.

EXERCISE 15.5

The correlation matrix C\mathbf{C} satisfies Σ=DCD\Sigma=D\mathbf{C}D where D=diag(σ1,σ2,σ3)D=\text{diag}(\sigma_1,\sigma_2,\sigma_3). So C=D1ΣD1\mathbf{C}=D^{-1}\Sigma D^{-1}. Verify C\mathbf{C} has ones on the diagonal and check that ρij1|\rho_{ij}|\leq1.

Σ=(421293131)\Sigma=\begin{pmatrix}4&2&-1\\2&9&3\\-1&3&1\end{pmatrix}.

Standard deviations: σ1=4=2\sigma_1=\sqrt{4}=2, σ2=9=3\sigma_2=\sqrt{9}=3, σ3=1=1\sigma_3=\sqrt{1}=1.

D=(200030001)D=\begin{pmatrix}2&0&0\\0&3&0\\0&0&1\end{pmatrix}, D1=(1/20001/30001)D^{-1}=\begin{pmatrix}1/2&0&0\\0&1/3&0\\0&0&1\end{pmatrix}.

Cij=Σij/(σiσj)\mathbf{C}_{ij}=\Sigma_{ij}/(\sigma_i\sigma_j): C11=4/(22)=1C_{11}=4/(2\cdot2)=1, C22=9/(33)=1C_{22}=9/(3\cdot3)=1, C33=1/(11)=1C_{33}=1/(1\cdot1)=1.

C12=2/(23)=1/30.333C_{12}=2/(2\cdot3)=1/3\approx0.333. C13=1/(21)=0.5C_{13}=-1/(2\cdot1)=-0.5. C23=3/(31)=1C_{23}=3/(3\cdot1)=1.

C=(11/31/21/3111/211)\mathbf{C}=\begin{pmatrix}1&1/3&-1/2\\1/3&1&1\\-1/2&1&1\end{pmatrix}

C23=1C_{23}=1 means Assets 2 and 3 are perfectly positively correlated — they move in lockstep. det(C)=0\det(\mathbf{C})=0 — confirming the covariance matrix is PSD but not PD.

Extract the correlation matrix C\mathbf{C} from Σ=(421293131)\Sigma=\begin{pmatrix}4&2&-1\\2&9&3\\-1&3&1\end{pmatrix}. Compute all pairwise correlations, identify any perfectly correlated pair, and state what that implies about the rank of Σ\Sigma.

EXERCISE 15.6

The variance of a long-short portfolio w=(1,1)T/2\mathbf{w}=(1,-1)^T/\sqrt{2} (normalised) is 12wTΣw\frac{1}{2}\mathbf{w}^T\Sigma\mathbf{w} with w=(1,1)T\mathbf{w}=(1,-1)^T. Correlation ρ\rho appears in the off-diagonal; as ρ1\rho\to1 the variance goes to zero. Connect to the eigenvalue λ2=σ2(1ρ)\lambda_2=\sigma^2(1-\rho).

Σ=σ2(1ρρ1)\Sigma=\sigma^2\begin{pmatrix}1&\rho\\\rho&1\end{pmatrix} for two assets with equal variance σ2\sigma^2 and correlation ρ\rho.

Long-short portfolio w=(1,1)T\mathbf{w}=(1,-1)^T:

σLS2=wTΣw=σ2(12ρ+1)=2σ2(1ρ)\sigma_{LS}^2=\mathbf{w}^T\Sigma\mathbf{w}=\sigma^2(1-2\rho+1)=2\sigma^2(1-\rho).

Eigenvalues of Σ\Sigma: λ1=σ2(1+ρ)\lambda_1=\sigma^2(1+\rho), λ2=σ2(1ρ)\lambda_2=\sigma^2(1-\rho).

The long-short portfolio is the eigenvector 12(1,1)T\frac{1}{\sqrt{2}}(1,-1)^T associated with λ2=σ2(1ρ)\lambda_2=\sigma^2(1-\rho). Portfolio variance =(1,1)T2λ2/((1,1)T2)= \|(1,-1)^T\|^2\cdot\lambda_2/({\|(1,-1)^T\|^2})... more directly: σLS2=2σ2(1ρ)=2λ2\sigma_{LS}^2=2\sigma^2(1-\rho)=2\lambda_2.

As ρ1\rho\to1: σLS20\sigma_{LS}^2\to0 — the long-short portfolio becomes risk-free. This is statistical arbitrage: if two stocks are highly correlated (ρ1\rho\approx1), a long-short position in them has nearly zero variance while capturing the mean-reversion of their spread.

As ρ1\rho\to-1: σLS24σ2\sigma_{LS}^2\to4\sigma^2 — maximum variance, the two assets always move opposite each other, amplifying the long-short swing.

Two assets have equal variance σ2\sigma^2 and correlation ρ\rho, giving covariance matrix Σ=σ2(1ρρ1)\Sigma=\sigma^2\begin{pmatrix}1&\rho\\\rho&1\end{pmatrix}. Compute the variance of the long-short portfolio w=(1,1)T\mathbf{w}=(1,-1)^T as a function of ρ\rho. Explain what happens as ρ1\rho\to1 and connect this to statistical arbitrage.


08 · Chapter Summary

ConceptKey Formula
Quadratic formQ(x)=xTAx=ijaijxixjQ(\mathbf{x})=\mathbf{x}^TA\mathbf{x}=\sum_{ij}a_{ij}x_ix_j
Diagonal of AACoefficient of xi2x_i^2 in xTAx\mathbf{x}^TA\mathbf{x}
Off-diagonal of AAHalf the coefficient of xixjx_ix_j (for iji\neq j)
Classify formPD/PSD/ND/NSD/Indefinite by sign of Q(x)Q(\mathbf{x}) for all x\mathbf{x}
Sample covarianceS=1n1XcTXcS=\frac{1}{n-1}X_c^TX_c; always PSD; PD when n>pn>p
Portfolio varianceσp2=wTΣw\sigma_p^2=\mathbf{w}^T\Sigma\mathbf{w}; quadratic form in weights
Spectral decompositionΣ=QΛQT\Sigma=Q\Lambda Q^T; σp2=kλkfk2\sigma_p^2=\sum_k\lambda_kf_k^2; f=QTw\mathbf{f}=Q^T\mathbf{w}
Correlation matrixC=D1ΣD1\mathbf{C}=D^{-1}\Sigma D^{-1}; entries in [1,1][-1,1]; ones on diagonal
ρ=1\rho=1 assetsCovariance matrix singular; long-short has zero variance
Nearest PSD fixReplace negative eigenvalues with ϵ>0\epsilon>0; Σ^=QΛ+QT\hat{\Sigma}=Q\Lambda_+Q^T

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.