01 · Lesson 06
Linear algebra and matrices
Linear algebra organises several related quantities and the rules connecting them. Vectors store biological states; matrices transform those states, describe transitions, or represent interactions.
Scenario: a stage-structured population
A population contains juveniles and adults. Juveniles may survive and mature, while adults survive and produce new juveniles. We want to update both groups together without writing separate calculations repeatedly.
Store the current state in a column vector:
The order is part of the definition: the first component is juvenile and the second is adult.
Scalars, vectors and matrices
| Object | Example | Role |
|---|---|---|
| Scalar | \(0.8\) | One number, such as a survival probability |
| Vector | \((J,A)^T\) | An ordered list of state quantities |
| Matrix | \((a_{ij})\) | A rectangular array representing a transformation |
An \(m\times n\) matrix has \(m\) rows and \(n\) columns. It can multiply a vector with \(n\) components and produces a vector with \(m\) components.
A population projection matrix
Consider
Multiplication gives
Rows identify the receiving class; columns identify the contributing class. The entry \(0.4\) says that each current juvenile contributes an expected \(0.4\) adults to the next census.
Matrix multiplication
For \(C=AB\), entry \(c_{ij}\) is the dot product of row \(i\) of \(A\) with column \(j\) of \(B\):
The inner dimensions must match. In general \(AB\ne BA\), because reversing transformations usually changes both their meaning and their result.
Never multiply matrices only because their numerical sizes permit it. Define what rows, columns and the direction of transformation represent.
Important matrices
- The identity matrix \(I\) leaves a compatible vector unchanged: \(I\mathbf x=\mathbf x\).
- A diagonal matrix scales components without mixing them.
- A transition matrix represents movement probabilities under a declared row or column convention.
- A generator matrix represents continuous-time transition rates, not probabilities.
- A covariance matrix records variances on its diagonal and pairwise covariances off the diagonal.
Linear systems
A system \(A\mathbf x=\mathbf b\) asks for a vector whose transformation by \(A\) produces \(\mathbf b\). A unique solution exists when the square matrix \(A\) is invertible:
In computation, direct numerical solvers are normally preferred to explicitly calculating \(A^{-1}\). Singular or nearly singular matrices may indicate non-identifiable effects or numerically unstable calculations.
Repeated updating
Applying the same projection for \(k\) steps gives
The long-term pattern depends on the structure of \(L\), especially its eigenvalues and eigenvectors. Those are introduced in the next lesson.
Conditions and interpretation
- Declare component and class order explicitly.
- Check dimensional compatibility before multiplication.
- Keep units consistent within every sum.
- Distinguish counts, proportions, probabilities and rates.
- Check non-negativity and conservation when the model requires them.
- Remember that a linear matrix model assumes contributions combine additively; density dependence requires additional structure.
What this lesson adds
You can now interpret scalars, vectors and matrices, construct a structured-population update, perform meaningful matrix multiplication, recognise important matrix types and explain why repeated matrix transformations matter in biology.