Skip to content

Linear algebra

Linear algebra organises vectors, maps and systems. Turn three asset weights into two factor exposures, then distinguish linear aggregation from quadratic risk.

Linear algebra studies vectors, linear combinations, linear maps and systems of linear equations. In quantitative finance, it gives a common language for turning positions into exposures, matching cash flows and organising return data. Its central operation is simple: multiply building blocks by quantities, then add them.
A vector keeps quantities in a fixed order; a matrix records how those quantities contribute to several outputs. The ordering and units are part of the model, even though the arithmetic cannot check them for you.

From three assets to two exposures

Consider a synthetic one-period return-factor model. Portfolio weights are fractions of starting portfolio value, in asset order A, B, C. Rows of the loading matrix correspond to factors F1, F2; columns retain the same asset order:

w=[0.40.30.3],B=[120.501−1].\mathbf{w}=\begin{bmatrix}0.4\\0.3\\0.3\end{bmatrix},\qquad B=\begin{bmatrix}1&2&0.5\\0&1&-1\end{bmatrix}.
Both asset returns and factor returns are expressed as decimal fractions over the same period, so these loadings are dimensionless. With fixed loadings, matrix multiplication gives the portfolio's factor exposure:
B⏟2×3w⏟3×1=[1(0.4)+2(0.3)+0.5(0.3)0(0.4)+1(0.3)−1(0.3)]=[1.150].\underbrace{B}_{2\times3}\underbrace{\mathbf{w}}_{3\times1} =\begin{bmatrix}1(0.4)+2(0.3)+0.5(0.3)\\0(0.4)+1(0.3)-1(0.3)\end{bmatrix} =\begin{bmatrix}1.15\\0\end{bmatrix}.
Each row takes a dot product with the weights. Equivalently, the result is a linear combination of the matrix columns: 40% of A's loading vector, plus 30% of B's, plus 30% of C's.
A, B and C have weights 0.40, 0.30 and 0.30. Their first-factor contributions are 0.40, 0.60 and 0.15, summing to 1.15; their second-factor contributions are 0, 0.30 and minus 0.30, summing to zero.
A, B and C have weights 0.40, 0.30 and 0.30. Their first-factor contributions are 0.40, 0.60 and 0.15, summing to 1.15; their second-factor contributions are 0, 0.30 and minus 0.30, summing to zero.
Original synthetic return-factor example. Contributions are weight times dimensionless loading; asset and factor orders remain fixed.

For interpretation, suppose the model is ri=b1if1+b2if2+εir_i=b_{1i}f_1+b_{2i}f_2+\varepsilon_i, where εi\varepsilon_i is an asset-specific residual return. Then, for beginning-of-period weights and no interim trading, external cash flows or costs,

rp=wTr=1.15f1+0f2+∑iwiεi.r_p=\mathbf{w}^{\mathsf T}\mathbf{r} =1.15f_1+0f_2+\sum_i w_i\varepsilon_i.
If F1 returns 1%, F2 returns 2% and all residuals are zero, portfolio return is 1.15%. The exposure 1.15 alone is not a return forecast. Zero F2 exposure means neutrality to that factor within this fixed linear model; F1 exposure, residual risk and model error remain.

Calculating a result versus finding the weights

A linear map preserves addition and scaling:
B(au+bv)=aBu+bBv.B(a\mathbf{u}+b\mathbf{v})=aB\mathbf{u}+bB\mathbf{v}.

This lets desks aggregate books before or after computing exposures. Doubling every position doubles the mapped exposure. A fully invested weight vector must also satisfy ∑iwi=1\sum_i w_i=1; doubling these weights describes exposure relative to the original capital base and requires a separate financing convention.

Run the question backwards and you obtain a system of linear equations: choose x\mathbf{x} so that Bx=eB\mathbf{x}=\mathbf{e} for a target exposure e\mathbf{e}. The columns' span determines which targets are attainable. The rank and null space determine whether different holdings can produce the same target. Budget limits, short-sale restrictions and transaction costs add further requirements; matching measured exposures alone does not establish an affordable hedge.
Other branches answer different practical questions. Least squares fits an approximate match when an exact system is inconsistent. A basis provides independent coordinates. Eigenvalues and eigenvectors help identify directions of variation in covariance analysis.

Using linear algebra does not make every calculation linear

Portfolio variance uses the covariance matrix Σ\Sigma through the quadratic form
Var(rp)=wTΣw.\text{Var}(r_p)=\mathbf{w}^{\mathsf T}\Sigma\mathbf{w}.
For fixed Σ\Sigma, doubling the exposure vector multiplies variance by four, rather than two. A genuine covariance matrix is positive semidefinite, which ensures nonnegative variance. Nonlinear payoffs and changing factor loadings also require more than a fixed exposure map.
To practise the arithmetic, read Vectors and Matrices. For the column-space interpretation, replication systems and covariance-ready matrices, continue with Vectors, Matrices and Linear Systems, part of the Linear Algebra, Optimisation and Numerical Methods Programme. Both have public previews; full lessons require membership.

Sources

Last updated
  • linear algebra
  • vectors
  • matrices
  • factor exposures
  • linear systems
← Back to the glossaryBack to top ↑