← Computational Mathematical Biology

Matrix computations

Matrices appear in structured populations, Markov chains, stability analysis, networks and statistical models.

Matrix multiplication

import numpy as np
A = np.array([[0.8, 0.2], [0.1, 0.9]])
x = np.array([100, 50])
y = A @ x

Eigenvalues and eigenvectors

values, vectors = np.linalg.eig(A)

Linear systems

b = np.array([1.0, 2.0])
x = np.linalg.solve(A, b)

For solving \(Ax=b\), direct solution routines are normally preferable to explicitly computing \(A^{-1}\).

Key idea. Computational linear algebra provides efficient operations for the matrix structures that arise throughout mathematical biology.