What does Koopman Modes for Audience Turning Points conclude, in numbers, about “Dynamic Mode Decomposition: Eigenvalues, Amplitudes and the False Decay Caused by Noise”?
Answer: Chapter 4 assembles dynamic mode decomposition and shows that noise makes a swing that never decays look like one with modulus 0.7744 and a half-life of 2.7 minutes, which a forward-backward correction repairs.
Scope of the numbers: Marked boxes separate published evidence, runnable Python calculations (19 programs), classical sources and the author's hypotheses.
Data table
The numbers below are printed verbatim by the chapter's Python program and can be reproduced by running it. standard-library Python onlyprinted values that match the answer: 0.7744, 2.7
| rows | samples | noise | DMD |lambda| | half-life | fbDMD |lambda| |
|---|---|---|---|---|---|
| 4 | 24 | 60 | 0.9809 | 35.9 min | 1.0000 |
| 4 | 24 | 150 | 0.9003 | 6.6 min | 1.0012 |
| 4 | 24 | 300 | 0.7744 | 2.7 min | 1.0065 |
| 10 | 30 | 60 | 0.9992 | 852.5 min | 1.0013 |
| 10 | 30 | 150 | 0.9851 | 46.1 min | 0.9965 |
| 10 | 30 | 300 | 0.9463 | 12.6 min | 0.9969 |
| 20 | 60 | 60 | 0.9993 | 974.4 min | 0.9997 |
| 20 | 60 | 150 | 0.9960 | 172.8 min | 0.9987 |
| 20 | 60 | 300 | 0.9843 | 43.7 min | 0.9963 |
| medians over 100 replicates; true |lambda| = 1, half-life inf |
Show the full program
# Chapter 4. p42: sensor noise makes a steady cycle look as if it dies.
# Signal: a 12-minute cycle of amplitude 300 that never decays (true
# |lambda| = 1), plus Gaussian noise; 100 fixed-seed replicates per cell.
# Standard DMD (rank 2) is compared with forward-backward DMD (Dawson et
# al. 2016): fit the forward map A_f and the backward map A_b in the same
# POD basis and take eigenvalues of (A_f A_b^-1)^(1/2). "Half-life" is
# the apparent time for the cycle to halve, ln 2 / -ln |lambda|.
import math
import cmath
import random
import statistics
def dot(a, b):
return math.fsum(x * y for x, y in zip(a, b))
def matmul(a, b):
bt = list(zip(*b))
return [[dot(r, c) for c in bt] for r in a]
def transpose(a):
return [list(r) for r in zip(*a)]
def svd(a):
# 单边 Jacobi(Hestenes):两两旋转列直到正交,A = U S V^T
m, n = len(a), len(a[0])
if n > m:
u, s, v = svd(transpose(a))
return v, s, u
cols = [[a[i][j] for i in range(m)] for j in range(n)]
vc = [[1.0 if i == j else 0.0 for i in range(n)] for j in range(n)]
for sweep in range(60):
rotated = False
for p in range(n - 1):
for q in range(p + 1, n):
al = dot(cols[p], cols[p])
be = dot(cols[q], cols[q])
ga = dot(cols[p], cols[q])
if ga == 0.0 or abs(ga) <= 1e-15 * math.sqrt(al * be):
continue
rotated = True
ze = (be - al) / (2.0 * ga)
t = math.copysign(1.0, ze) / (
abs(ze) + math.sqrt(1.0 + ze * ze))
c = 1.0 / math.sqrt(1.0 + t * t)
s = c * t
cp, cq = cols[p], cols[q]
cols[p] = [c * x - s * y for x, y in zip(cp, cq)]
cols[q] = [s * x + c * y for x, y in zip(cp, cq)]
vp, vq = vc[p], vc[q]
vc[p] = [c * x - s * y for x, y in zip(vp, vq)]
vc[q] = [s * x + c * y for x, y in zip(vp, vq)]
if not rotated:
break
sig = [math.sqrt(dot(c_, c_)) for c_ in cols]
order = sorted(range(n), key=lambda j: (-sig[j], j))
s = [sig[j] for j in order]
u = [[cols[j][i] / sig[j] if sig[j] > 0.0 else 0.0 for j in order]
for i in range(m)]
v = [[vc[j][i] for j in order] for i in range(n)]
return u, s, v
def hankel(x, rows):
# 延迟嵌入:第 i 行是从第 i 分钟起的一段序列
k = len(x) - rows + 1
return [[x[i + j] for j in range(k)] for i in range(rows)]
def inv(a):
# Gauss-Jordan 求逆(部分主元),只用于小矩阵
n = len(a)
m = [list(map(float, a[i])) + [1.0 if i == j else 0.0
for j in range(n)] for i in range(n)]
for c in range(n):
p = max(range(c, n), key=lambda i: abs(m[i][c]))
m[c], m[p] = m[p], m[c]
pv = m[c][c]
m[c] = [q / pv for q in m[c]]
for i in range(n):
if i != c:
f = m[i][c]
m[i] = [q - f * w for q, w in zip(m[i], m[c])]
return [row[n:] for row in m]
def charpoly(a):
# Faddeev-LeVerrier:特征多项式 z^n + c1 z^(n-1) + c2 z^(n-2) 直到 cn
n = len(a)
m = [[0.0] * n for _ in range(n)]
coef = [1.0]
for k in range(1, n + 1):
m = matmul(a, m)
for i in range(n):
m[i][i] += coef[-1]
am = matmul(a, m)
coef.append(-math.fsum(am[i][i] for i in range(n)) / k)
return coef
def roots(coef):
# Durand-Kerner 同时迭代求全部复根(cmath)
n = len(coef) - 1
z = [cmath.rect(0.9, 0.4 + 2.0 * math.pi * k / n) for k in range(n)]
def p(x):
r = complex(1.0, 0.0)
for c in coef[1:]:
r = r * x + c
return r
for _ in range(800):
new = []
for i in range(n):
den = complex(1.0, 0.0)
for j in range(n):
if j != i:
den *= z[i] - z[j]
new.append(z[i] - p(z[i]) / den)
moved = max(abs(a - b) for a, b in zip(new, z))
z = new
if moved < 1e-14:
break
return z
def eigvals(a):
z = roots(charpoly(a))
z = [complex(w.real, 0.0) if abs(w.imag) < 1e-12 else w for w in z]
return sorted(z, key=lambda w: (-round(abs(w), 9), w.imag))
def pinv_rows(xr):
return matmul(transpose(xr), inv(matmul(xr, transpose(xr))))
def moduli(x, rows, r):
h = hankel(x, rows)
xs = [row[:-1] for row in h]
ys = [row[1:] for row in h]
u, s, v = svd(xs)
ur = transpose([row[:r] for row in u])
xr, yr = matmul(ur, xs), matmul(ur, ys)
af = matmul(yr, pinv_rows(xr))
ab = matmul(xr, pinv_rows(yr))
lf = eigvals(af)
lfb = [cmath.sqrt(z) for z in eigvals(matmul(af, inv(ab)))]
return abs(lf[0]), abs(lfb[0])
rng = random.Random(20261116)
print("rows samples noise DMD |lambda| half-life fbDMD |lambda|")
for rows, n in ((4, 24), (10, 30), (20, 60)):
for sd in (60.0, 150.0, 300.0):
a, b = [], []
for _ in range(100):
x = [300.0 * math.cos(2.0 * math.pi * t / 12.0)
+ rng.gauss(0.0, sd) for t in range(n)]
f, fb = moduli(x, rows, 2)
a.append(f)
b.append(fb)
ma, mb = statistics.median(a), statistics.median(b)
hl = math.log(2.0) / -math.log(ma) if ma < 1.0 else float("inf")
print("%4d %7d %5.0f %12.4f %6.1f min %14.4f"
% (rows, n, sd, ma, hl, mb))
print("medians over 100 replicates; true |lambda| = 1, half-life inf")Single source and citation
Fan, Y. (2026). Koopman Operators and Dynamic Mode Decomposition: Linearising Nonlinear Cash-Flow Swings and Forecasting Turning Points in Livestream Audience Curves (Version 1.0.0), Chapter 4: Dynamic Mode Decomposition: Eigenvalues, Amplitudes and the False Decay Caused by Noise. 5D Library. DOI pending
DOI pending · monograph page goes live after publication · 5DL-B-238 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026238,
author = {Fan, Yafu},
title = {Koopman Operators and Dynamic Mode Decomposition: Linearising Nonlinear Cash-Flow Swings and Forecasting Turning Points in Livestream Audience Curves},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
note = {DOI pending}
}Other chapter answers in this book
- Chapter 1 · Two or Three Modes: the Low-Rank Structure of a Livestream Audience Curve and the Built-In Lag of Moving Averages
- Chapter 2 · The Koopman Operator: Lifting Nonlinear Dynamics into Linear Ones, and the Limits of the Lift
- Chapter 3 · Jacobi Rotations: Symmetric Eigendecomposition and the Singular Value Decomposition with the Standard Library Alone
- Chapter 5 · Lead Time at the Turning Point: a Mode-Based Warning Every Five Minutes against Moving Averages
- Chapter 6 · Cash Flow: Linearising Daily, Weekly and Monthly Swings with Modes, and Choosing the Observable
- Chapter 7 · East and West in the Sources: "Knowing the Incipient" in the Book of Changes and Fourier's Analysis of Heat
- Chapter 8 · Closing the Empirical Loop: a Mode Fit Every Five Minutes, a Cooling Warning and a Pre-Registered Test