Skip to main content

34  Koopman Theory, EDMD, and Continuous Generators

An observation of a dynamical system may be a function of its state, such as position, energy, or a molecule count. Instead of asking how the state changes, we can ask how each such function changes after one step. Composition with the state update defines the Koopman operator.

This operator is linear in the observed function even when the state update is nonlinear. Its function space may be infinite dimensional. We first examine that distinction, then fit matrices on selected functions using least squares. For reaction models, the same construction relates the evolution of expected observations to the master equation.

34.1 Koopman Operator Theory

NoteDefinition: Nonlinear Dynamics and Observables

Consider a discrete-time dynamical system \[ \begin{align} \bx^{(k+1)} = \mathbf{F}(\bx^{(k)}), \qquad \bx \in \mathcal{M} \subseteq \fR^n. \end{align} \] Choose a function space \(\mathcal F\) invariant under composition with \(\mathbf F\). An observable is a scalar function \(g: \mathcal{M} \to \fR\) belonging to \(\mathcal F\). For an \(L^2\) space, the measure and assumptions ensuring that composition is well defined must be specified. The Koopman operator \(\mathcal{K}: \mathcal{F} \to \mathcal{F}\) is defined by \[ \begin{align} (\mathcal{K}g)(\bx) = g(\mathbf{F}(\bx)). \end{align} \] The operator \(\mathcal{K}\) is linear on \(\mathcal{F}\), even when the underlying map \(\mathbf{F}\) is nonlinear.

NoteProposition: Linearity of the Koopman Operator

The Koopman operator \(\mathcal{K}\) satisfies \[ \begin{align} \mathcal{K}(\alpha g_1 + \beta g_2) = \alpha \mathcal{K} g_1 + \beta \mathcal{K} g_2 \end{align} \] for all scalars \(\alpha, \beta \in \fR\) and observables \(g_1, g_2 \in \mathcal{F}\).

WarningExercise

Evaluate both sides at an arbitrary state and expand \((\alpha g_1+\beta g_2)(\mathbf F(\bx))\). Which operation is linear here, and which map may remain nonlinear?

WarningExercise

For the state update \(F(x)=x^3\), compute the images of \(g_1(x)=x\) and \(g_2(x)=x^3\). Show that \(\operatorname{span}\{x,x^3\}\) is not invariant under composition with \(F\). Which further monomials appear if you repeatedly add the missing images? Explain why linearity of the operator does not imply that these two observables give an exact matrix model.

NoteDefinition: Koopman Eigenfunctions and Eigenvalues

A nonzero function \(\varphi \in \mathcal{F}\) is a Koopman eigenfunction with eigenvalue \(\mu \in \fC\) if \[ \begin{align} \mathcal{K}\varphi = \mu \varphi. \end{align} \] Along system trajectories, Koopman eigenfunctions evolve linearly: \[ \begin{align} \varphi(\bx^{(k)}) = \mu^k \varphi(\bx^{(0)}). \end{align} \] A sufficiently rich collection of Koopman eigenfunctions can provide coordinates in which part of the nonlinear dynamics evolves linearly. Such a collection need not exist globally, and finite dictionaries generally give only a projected approximation.

34.2 Dynamic Mode Decomposition (DMD) and EDMD

Suppose a scalar state is observed in pairs \((x_m,y_m)\). Fitting one multiplier asks for \(\min_a\sum_m(y_m-ax_m)^2\). Provided not all \(x_m\) vanish, the answer is \(a=\sum_mx_my_m/\sum_mx_m^2\). DMD applies this least-squares calculation to vectors, placing each observation in a column. This orientation differs from PCA, where observations were rows.

NoteDefinition: Dynamic Mode Decomposition (DMD)

Given snapshot matrices \(\bX, \bY \in \fR^{n \times M}\) where \(\bY\) advances \(\bX\) by time step \(h\): \[ \begin{align} \bX = [\bx_1, \bx_2, ..., \bx_M], \qquad \bY = [\by_1, \by_2, ..., \by_M], \qquad \by_m = \mathbf{F}(\bx_m), \end{align} \] DMD seeks the best-fit linear map \(\bA \approx \bY \bX^\dagger\) in the Frobenius norm.

To compute the reduced model:

  1. Compute the rank-\(r\) truncated SVD \(\bX \approx \bU_r \boldsymbol{\Sigma}_r \bV_r^T\).

  2. Project onto the span of the retained left singular vectors (often called the proper orthogonal decomposition, or POD, subspace): \(\widetilde{\bA} = \bU_r^T \bY \bV_r \boldsymbol{\Sigma}_r^{-1} \in \fR^{r \times r}\).

  3. Compute eigendecomposition \(\widetilde{\bA} \bw_i = \mu_i \bw_i\).

  4. The DMD modes are \(\boldsymbol{\phi}_i = \bY \bV_r \boldsymbol{\Sigma}_r^{-1} \bw_i\).

NoteProposition: DMD as a Least-Squares Fit

The minimum-Frobenius-norm solution of \[ \begin{align} \min_{\bA}\|\bY-\bA\bX\|_F \end{align} \] is \(\bA_*=\bY\bX^\dagger\). If \(\bX=\bU_r\boldsymbol{\Sigma}_r\bV_r^T\) is a rank-\(r\) SVD, the representation of this map on \(\mathcal{R}(\bU_r)\) is \[ \begin{align} \widetilde{\bA}=\bU_r^T\bA_*\bU_r =\bU_r^T\bY\bV_r\boldsymbol{\Sigma}_r^{-1}. \end{align} \]

Let row \(i\) of \(\bA\) be \(\ba_i^T\) and row \(i\) of \(\bY\) be \(\by_i^T\). The squared Frobenius residual is \[ \begin{align} \|\bY-\bA\bX\|_F^2 =\sum_i\|\by_i^T-\ba_i^T\bX\|_2^2 =\sum_i\|\by_i-\bX^T\ba_i\|_2^2. \end{align} \] Different rows of \(\bA\) appear in different summands. Hence we may minimize each summand independently. The pseudoinverse least-squares theorem gives its unique minimum-norm solution \[ \begin{align} \ba_i=(\bX^T)^\dagger\by_i=(\bX^\dagger)^T\by_i. \end{align} \] Transposing back and collecting the rows gives \(\bA_*=\bY\bX^\dagger\). Among all residual minimizers, the squared Frobenius norm is \(\sum_i\|\ba_i\|_2^2\). Choosing the minimum norm independently in every row therefore gives the minimum-Frobenius-norm matrix.

For a rank-\(r\) SVD, \(\bX^\dagger=\bV_r\boldsymbol\Sigma_r^{-1}\bU_r^T\). Its diagonal inverse is defined because the retained singular values are positive. Substitute into the reduced representation: \[ \begin{align} \bU_r^T\bA_*\bU_r &=\bU_r^T\bY\bV_r\boldsymbol\Sigma_r^{-1}\bU_r^T\bU_r\\ &=\bU_r^T\bY\bV_r\boldsymbol\Sigma_r^{-1}. \end{align} \] The last equality uses the orthonormal columns of \(\bU_r\). This proves the reduced formula as well as the least-squares assertion.

NoteDefinition: Extended Dynamic Mode Decomposition (EDMD)

Extended DMD (Williams et al. 2015) generalizes DMD by lifting state data through a dictionary of nonlinear observables \(\boldsymbol{\psi}(\bx) = (\psi_1(\bx), ..., \psi_K(\bx))^T \in \fR^K\).

Form data matrices \[ \begin{align} \boldsymbol{\Psi}_X = [\boldsymbol{\psi}(\bx_1), ..., \boldsymbol{\psi}(\bx_M)] \in \fR^{K \times M}, \qquad \boldsymbol{\Psi}_Y = [\boldsymbol{\psi}(\by_1), ..., \boldsymbol{\psi}(\by_M)] \in \fR^{K \times M}. \end{align} \] The finite-dimensional representation \(\widehat{\bK}_h \in \fR^{K \times K}\) of the Koopman operator minimizes \(\|\boldsymbol{\Psi}_Y - \bK \boldsymbol{\Psi}_X\|_F^2\): \[ \begin{align} \widehat{\bK}_h = \boldsymbol{\Psi}_Y \boldsymbol{\Psi}_X^\dagger = (\boldsymbol{\Psi}_Y \boldsymbol{\Psi}_X^T)(\boldsymbol{\Psi}_X \boldsymbol{\Psi}_X^T)^\dagger. \end{align} \] Left eigenvectors of \(\widehat{\bK}_h\) yield approximations to Koopman eigenfunctions.

WarningExercise

Let a row vector \(\bw^T\) satisfy \(\bw^T\widehat{\bK}_h=\mu\bw^T\) and define \(g(\bx)=\bw^T\boldsymbol\psi(\bx)\). If the fitted relation \(\boldsymbol\psi(F(\bx))=\widehat{\bK}_h\boldsymbol\psi(\bx)\) were exact, prove \(g(F(\bx))=\mu g(\bx)\). With a nonzero fit residual, express the error in this identity. Why does a small training residual not guarantee the identity at unobserved states?

TipRemark

(EDMD as a Galerkin method) When the dictionary consists of the coordinate functions, \(\boldsymbol{\psi}(\bx)=\bx\), the data matrices reduce to \(\bX\) and \(\bY\), and EDMD reduces to the least-squares map of the referenced result. For a richer dictionary, the matrices \(\boldsymbol{\Psi}_Y\boldsymbol{\Psi}_X^T/M\) and \(\boldsymbol{\Psi}_X\boldsymbol{\Psi}_X^T/M\) are sample averages of inner products between dictionary functions. As the number of samples drawn from a measure \(\mu\) grows, they converge to the corresponding inner-product matrices in \(L^2(\mu)\), and \(\widehat{\bK}_h\) converges to the Galerkin projection of the Koopman operator onto the span of the dictionary (Williams et al. 2015). Enlarging the dictionary therefore raises a separate approximation question, namely how well that span represents the Koopman eigenfunctions of interest.

34.3 CME Koopman Generator and Polynomial Closure

TipRemark

(Koopman generator for continuous Markov jump processes) For a continuous-time Markov process with master equation \(\dot{\bp}(t) = \bA(\bc) \bp(t)\), the expectation of an observable \(g(\bx)\) evolves according to \(\frac{d}{dt}\mathbb{E}[g(\bx(t))] = \frac{d}{dt} \sum_{\bx} g(\bx) p(\bx, t) = \sum_{\bx} g(\bx) [\bA(\bc)\bp(t)]_{\bx} = \sum_{\bx} [\bA(\bc)^T g](\bx) p(\bx, t)\). The Koopman infinitesimal generator \(\mathcal{A}\) is the formal adjoint of the master operator: \(\mathcal{A} = \bA(\bc)^T\).

NoteDefinition: CME Koopman Generator

For a chemical reaction network with stoichiometry \(\bnu_k\) and propensities \(\alpha_k(\bx; \bc) = c_k h_k(\bx)\), the Koopman generator acts on observable \(g\) by \[ \begin{align} (\mathcal{A}g)(\bx) = \sum_{k=1}^R \alpha_k(\bx; \bc) \Big( g(\bx + \bnu_k) - g(\bx) \Big). \end{align} \]

The generator contains a difference \(g(\bx+\bnu)-g(\bx)\), so it can reduce polynomial degree before multiplication by the propensity raises it. For instance, if \(g(x)=x^2\), then \((x+1)^2-x^2=2x+1\). Multiplying by a constant or linear propensity leaves degree at most two. A quadratic propensity can produce degree three. This degree count determines whether finitely many moments form a closed system.

NoteTheorem: Polynomial Closure in Chemical Kinetics

Under mass-action kinetics, propensity functions are falling factorial polynomials: \[ \begin{align} h_k(\bx) = \prod_{s=1}^S x_s^{(\nu_{ks}^-)}, \qquad x_s^{(m)} = x_s(x_s - 1)\cdots(x_s - m + 1). \end{align} \] Let \(\mathcal{P}_d\) denote the space of polynomials in \(\bx\) of degree at most \(d\).

  1. Unimolecular networks: If all reactions have reactant order at most 1 (including immigration, conversion, and first-order degradation), then \(\mathcal{A}\mathcal{P}_d \subseteq \mathcal{P}_d\) for all \(d \geq 0\). The subspace \(\mathcal{P}_d\) is invariant under \(\mathcal{A}\), yielding exact finite-dimensional closure.

  2. Bimolecular networks: For reactions of reactant order at most 2, \(\mathcal{A}\mathcal{P}_d \subseteq \mathcal{P}_{d+1}\). A quadratic propensity can produce degree-\((d+1)\) terms, so the moment equations generally fail to close at degree \(d\) unless additional cancellations, conservation laws, or invariant subspaces are present.

If \(d=0\), every observable in the space is constant, so every difference \(g(\bx+\bnu_k)-g(\bx)\) is zero. Its image is the zero polynomial and both closure assertions hold. We may therefore assume \(d\geq1\) in the degree calculation below.

Let \(g \in \mathcal{P}_d\) be a polynomial of degree \(d\). For each stoichiometric change vector \(\bnu_k\), the discrete difference operator expands via Taylor’s formula on polynomials: \[ \begin{align} g(\bx + \bnu_k) - g(\bx) = \sum_{j=1}^d \frac{1}{j!} (\bnu_k \cdot \nabla)^j g(\bx). \end{align} \] Because differentiation reduces polynomial degree by at least one, each term in the sum has degree at most \(d - 1\), so \(g(\bx + \bnu_k) - g(\bx) \in \mathcal{P}_{d-1}\). Applying the Koopman generator (the referenced result): \[ \begin{align} (\mathcal{A}g)(\bx) = \sum_{k=1}^R \alpha_k(\bx; \bc) \big( g(\bx + \bnu_k) - g(\bx) \big). \end{align} \] For unimolecular reactions, each propensity \(\alpha_k(\bx; \bc)\) has reactant order at most 1, so \(\alpha_k \in \mathcal{P}_1\). The product of a degree-1 polynomial and a degree-\((d-1)\) polynomial has degree at most \(1 + (d - 1) = d\), proving \(\mathcal{A}\mathcal{P}_d \subseteq \mathcal{P}_d\). For bimolecular reactions, reactant order is at most 2, so \(\alpha_k \in \mathcal{P}_2\). The product has degree at most \(2 + (d - 1) = d + 1\), giving \(\mathcal{A}\mathcal{P}_d \subseteq \mathcal{P}_{d+1}\).

The notation \(\mathcal A\mathcal P_d\subseteq\mathcal P_d\) means that applying the generator to any member of this finite-dimensional polynomial space produces another member of the same space. Choosing a basis then gives a matrix for its action, so the corresponding expectations form a closed linear system. For the quadratic-propensity case, the inclusion in \(\mathcal P_{d+1}\) only bounds the possible degree. It does not assert that a degree-\(d+1\) term occurs for every polynomial or every network.

WarningExercise

(Bimolecular moment hierarchy) Consider the dimerization reaction \(2A \xrightarrow{c} B\). The stoichiometry is \(\bnu = (-2, 1)^T\) and the propensity is \(\alpha(x) = c x(x-1)/2\).

  1. Compute \((\mathcal{A}g)(x)\) for \(g(x) = x\). Show that the result is quadratic in \(x\).

  2. Explain why computing the time derivative of the mean \(\frac{d}{dt}\mathbb{E}[x]\) requires knowledge of the second moment \(\mathbb{E}[x^2]\).

34.4 Continuous Generator Estimation

TipRemark

(Discrete-to-continuous inversion) Given an EDMD estimate of the discrete Koopman operator \(\widehat{\bK}_h \approx \exp(h\mathcal{A})\) over a sampling interval \(h\), the continuous generator is recovered via the principal matrix logarithm: \[ \begin{align} \widehat{\bA} = \frac{1}{h} \operatorname{logm}(\widehat{\bK}_h). \end{align} \] If \(\widehat{\bK}_h\) is real and has no eigenvalues on the closed negative real axis \((-\infty,0]\), then its principal matrix logarithm exists and is real. A matrix with eigenvalues on this branch cut may possess other logarithms, but it does not possess the principal logarithm used here.

NoteTheorem: Sensitivity of Recovered Decay Rates

Let \(\lambda_i < 0\) be a continuous eigenvalue of the generator \(\mathcal{A}\), corresponding to a discrete Koopman eigenvalue \(\mu_i = \exp(h \lambda_i) \in (0, 1)\). The relation between discrete and continuous eigenvalues is \[ \begin{align} \lambda_i = \frac{1}{h} \ln \mu_i. \end{align} \] The sensitivity of the continuous eigenvalue with respect to perturbations in the discrete eigenvalue is \[ \begin{align} \left|\frac{d\lambda_i}{d\mu_i}\right| = \frac{1}{h \mu_i} = \frac{1}{h \exp(h \lambda_i)}. \end{align} \] For fast decaying modes where \(-\lambda_i \gg 1\), \(\mu_i \to 0\) exponentially fast. Consequently, the noise amplification factor diverges: \[ \begin{align} \lim_{-\lambda_i \to \infty} \left|\frac{d\lambda_i}{d\mu_i}\right| = \infty. \end{align} \] A tiny statistical fluctuation \(\Delta \mu_i\) in data-driven EDMD induces an exponentially magnified error \(\Delta \lambda_i\) in the recovered rate.

The scalar decay relation is \(\mu=e^{h\lambda}\) with \(h>0\). For a positive multiplier it can be inverted as \(\lambda=h^{-1}\ln\mu\). Differentiation gives \[ \begin{align} \frac{d\lambda}{d\mu}=\frac1{h\mu}. \end{align} \] Substitute the exponential expression for \(\mu\): \[ \begin{align} \left|\frac{d\lambda}{d\mu}\right|=\frac{e^{-h\lambda}}h. \end{align} \] When the negative decay rate becomes increasingly large in magnitude at fixed \(h\), \(-h\lambda\to+\infty\), so this derivative grows without bound.

The exact perturbation calculation also shows the range of the linear estimate. If \(\mu+\Delta\mu>0\), then \[ \begin{align} \Delta\lambda =\frac1h[\ln(\mu+\Delta\mu)-\ln\mu] =\frac1h\ln\left(1+\frac{\Delta\mu}{\mu}\right). \end{align} \] For \(|\Delta\mu|/\mu\) small, Taylor’s formula \(\ln(1+s)=s+O(s^2)\) gives \[ \begin{align} \Delta\lambda=\frac{\Delta\mu}{h\mu} +O\left(\frac{(\Delta\mu)^2}{h\mu^2}\right). \end{align} \] Thus the derivative describes amplification of small absolute multiplier errors. It is not a valid linear approximation when the error is comparable to the multiplier. If the perturbed multiplier is nonpositive, the real scalar logarithm is unavailable, which is a separate obstruction.

WarningExercise

Differentiate \(h^{-1}\ln\mu\) and substitute \(\mu=e^{h\lambda}\) to obtain the stated amplification factor. Then compare the exact change \(h^{-1}\ln(1+\Delta\mu/\mu)\) with its linear approximation. What happens as \(\Delta\mu\downarrow-\mu\)? Distinguish this loss of a positive multiplier from a large but locally predictable perturbation.

34.5 Further Exercises

WarningExercise

(DMD residual) Compute \(\bA_*=\bY\bX^\dagger\) for a rank-one snapshot matrix and verify directly that the residual \(\bY-\bA_*\bX\) is orthogonal to the row space of \(\bX\), as predicted by the referenced result.

WarningExercise

(Polynomial closure in unimolecular reaction networks) Consider the reversible isomerization network \(A \underset{c_2}{\overset{c_1}{\rightleftharpoons}} B\). Let \(x_1, x_2\) denote the copy numbers of species \(A\) and \(B\).

  1. Write down the propensities \(\alpha_1(\bx) = c_1 x_1\) and \(\alpha_2(\bx) = c_2 x_2\), and the stoichiometry vectors \(\bnu_1 = (-1, 1)^T\) and \(\bnu_2 = (1, -1)^T\).

  2. Apply the Koopman generator \(\mathcal{A}\) to the linear observable \(g(\bx) = x_1\). Show that \((\mathcal{A}g)(\bx) = -c_1 x_1 + c_2 x_2\), which is strictly linear.

  3. Apply \(\mathcal{A}\) to the second-order observable \(g(\bx) = x_1^2\). Show that \((\mathcal{A}g)(\bx)\) contains only polynomials of degree at most 2.

  4. Explain why the subspace of polynomials of degree at most \(d\) is invariant under \(\mathcal{A}\) for any unimolecular network.

WarningExercise

(Sensitivity of recovered decay rates) Suppose a continuous dynamical system has decay rates \(\lambda_1 = -1\) and \(\lambda_2 = -50\). Data snapshots are collected at sampling interval \(h = 0.1\).

  1. Compute the true discrete eigenvalues \(\mu_1 = \exp(h\lambda_1)\) and \(\mu_2 = \exp(h\lambda_2)\).

  2. Suppose statistical noise perturbs the discrete estimates by \(\Delta \mu = 10^{-3}\). Compute the resulting perturbation \(\Delta \lambda_1 \approx \frac{\Delta \mu}{h \mu_1}\).

  3. Compute the resulting perturbation \(\Delta \lambda_2 \approx \frac{\Delta \mu}{h \mu_2}\).

  4. Explain why recovering continuous generators from discrete snapshots may benefit from regularized regression. Explain why regularization cannot recover a fast mode that the sampling interval has suppressed below the noise level.

NoteFurther reading

Koopman’s original paper gives the operator viewpoint for Hamiltonian systems (Koopman 1931). Schmid introduces dynamic mode decomposition in its fluid-mechanics form, and Williams, Kevrekidis, and Rowley connect a dictionary-based extension to the Koopman operator (Schmid 2010; Williams et al. 2015).