Quant Memo
Advanced

The Matrix Exponential

The generalization of e^x to matrices, used to solve systems of linear differential equations in one shot — most notably, to move a continuous-time Markov chain forward by any amount of time.

Prerequisites: Diagonalization and Similarity

A system of quantities that all influence each other's rate of change — say, capital flowing between three linked trading strategies, each bleeding into or draining from the others at fixed rates — is described by a system of coupled linear differential equations. Solving each equation separately is impossible because they're tangled together. The matrix exponential solves the whole system at once, producing a single matrix that tells you exactly where every quantity will be at any future time, given only where it started.

An analogy: compound growth, but for several linked accounts

Ordinary compound growth says a single quantity growing continuously at rate rr becomes x0ertx_0 e^{rt} after time tt — the familiar exponential. Now imagine several accounts that don't just grow on their own, but also leak into and receive from each other continuously. There's no single growth rate anymore; there's a whole matrix of rates. The matrix exponential is exactly the multi-account version of erte^{rt}: instead of one number growing, an entire vector of linked quantities evolves together, and the "growth rate" rr is replaced by a matrix AA describing every account's self-growth and cross-leakage simultaneously.

The math, one symbol at a time

For a system ddtx(t)=Ax(t)\frac{d}{dt}x(t) = Ax(t) with initial condition x(0)x(0), the solution is

x(t)=eAtx(0),eAt=k=0(At)kk!.x(t) = e^{At} x(0), \qquad e^{At} = \sum_{k=0}^{\infty} \frac{(At)^k}{k!}.

In words: eAte^{At} is defined the same way as the ordinary exponential's power series, just with the matrix AA (times tt) plugged in for the scalar exponent, and matrix powers used instead of number powers. Computing that infinite sum directly is impractical, but if AA is diagonalizable as A=PDP1A = PDP^{-1}, then eAt=PeDtP1e^{At} = Pe^{Dt}P^{-1}, where eDte^{Dt} is just a diagonal matrix of ordinary scalar exponentials eλite^{\lambda_i t} — the infinite matrix sum collapses to exponentiating each eigenvalue separately.

Worked example 1: a two-strategy capital flow system

Two strategies pass capital back and forth: strategy 1 grows at rate 1 but leaks to strategy 2 at rate 1; strategy 2 shrinks at rate 1-1 but nothing flows into it otherwise. A=(1011)A = \begin{pmatrix}1 & 0\\1 & -1\end{pmatrix} has eigenvalues λ1=1\lambda_1 = 1, λ2=1\lambda_2 = -1 (it's already lower triangular, so eigenvalues sit on the diagonal), with eigenvectors (2,1)(2,1) and (0,1)(0,1). Diagonalizing and exponentiating each eigenvalue: capital along the λ1=1\lambda_1=1 direction grows like ete^t, while capital along the λ2=1\lambda_2=-1 direction decays like ete^{-t}. Starting from x(0)=(1,0)x(0) = (1,0), expanding in the eigenvector basis and recombining gives x(t)=(et,12(etet))x(t) = (e^t, \, \frac{1}{2}(e^t - e^{-t})) — strategy 1 grows exponentially, and strategy 2 first absorbs inflow, then its own decay term eventually dominates.

Worked example 2: a continuous-time Markov chain transition matrix

A trading state (idle, active) switches with generator matrix Q=(2211)Q = \begin{pmatrix}-2 & 2\\1 & -1\end{pmatrix} (rows sum to zero, off-diagonals are transition rates). The probability of being in each state after time tt, starting idle, is the first row of eQte^{Qt}. QQ's eigenvalues are 00 and 3-3; the λ=0\lambda=0 eigenvalue never decays and corresponds to the long-run steady state, while the λ=3\lambda=-3 term e3te^{-3t} decays to zero — after about t=1t=1, e30.05e^{-3} \approx 0.05, so the chain is already 95% of the way to its steady-state split of time between idle and active, read directly off the surviving λ=0\lambda=0 eigenvector.

Path explorer
13055time →
end (bold path) 100.38spread of ends 58.966 independent paths, same settings

Watch how a mean-reverting path settles toward its long-run level at a rate set by its decay parameter — the same exponential-decay mechanism that a negative eigenvalue produces inside eAte^{At}.

λ=+1: eᵗ grows λ=-1: e⁻ᵗ decays
Each eigenvalue of A contributes its own independent exponential term inside e^(At) — positive eigenvalues blow up, negative ones die out, and zero eigenvalues hold steady.

What this means in practice

The matrix exponential is the standard tool for propagating any continuous-time linear system forward: continuous-time Markov chain transition probabilities, term-structure models built on linear ODEs, and coupled mean-reverting processes. It's also the bridge between discrete-time matrix powers (see Diagonalization and Similarity) and continuous time — eAte^{At} is what a transition matrix AnA^n becomes when the number of steps nn is replaced by a continuous clock.

eAte^{At} solves x˙=Ax\dot x = Ax in one closed form, and via diagonalization it reduces to exponentiating each eigenvalue of AA separately — positive eigenvalues explode, negative ones decay, zero eigenvalues persist.

eAte^{At} is not the matrix you get by exponentiating each entry of AA individually — that's a completely different (and generally meaningless) operation. The matrix exponential is defined by the full power series (At)k/k!\sum (At)^k/k!, which mixes entries together through repeated matrix multiplication. Confusing entrywise exponentiation with the true matrix exponential is a common error that produces a matrix with no connection to the actual solution of the underlying differential equation.

Related concepts

Practice in interviews

Further reading

  • Strang, Introduction to Linear Algebra, ch. 6
ShareTwitterLinkedIn