A matrix is a machine
An m×n matrix A turns every input vector x with n entries into an output vector Ax with m entries. The map is linear: A(ax+by)=aAx+bAy, so scaling and adding inputs scales and adds outputs. In finance, if column j of A holds how each of m assets responds to risk factor j, then Ax is the vector of asset returns for the factor moves x.
Ax=x1a1+x2a2+⋯+xnan(1) Read the product by columns: Ax is a combination of the columns aj of A, weighted by the entries of x. Taking x=e1=(1,0,…,0) picks out the first column, so the columns of a matrix are the images of the unit vectors. That is all you need to write down any linear map: decide where each unit vector goes and put the results in the columns.
Reading and writing a matrixFor
A=(1324) the columns
(1,3) and
(2,4) are the images of
e1 and
e2. For
x=(1,1):
Ax=1⋅(1,3)+1⋅(2,4)=(3,7). A rotation by 90 degrees counterclockwise sends
e1→(0,1) and
e2→(−1,0), so its matrix is
(01−10).
- Linear map: f(ax+by)=af(x)+bf(y). Every linear map between finite-dimensional spaces is a matrix.
- Columns: the images of the unit vectors, so Aej is column j.
- Zero goes to zero: a linear map always sends 0 to 0.
Linear is not the same as a straight linef(x)=2x+1 draws a straight line but is not linear, because f(0)=1=0. Adding a constant (an intercept) makes a map affine. Regression handles it by adding a column of ones to the data, which turns the affine problem into a linear one. Lab · what's graded
- From images to a matrix20 pts
- A matrix times a vector15 pts
- Spot the map that is not linear15 pts
- A rotation20 pts
- Matrices and their effects15 pts
- Why columns are images15 pts