Data-Driven Science and Engineering
Citation. Steven L. Brunton (Mechanical Engineering) and J. Nathan Kutz (Applied Mathematics), University of Washington. Data-Driven Science and Engineering: Machine Learning, Dynamical Systems, and Control. Cambridge University Press, 1st edition 2019, 2nd edition 2022 (ISBN 978-1-009-09848-9). The authors' site, databookuw.com, holds the code and the lectures. The book's examples are simulations and public image sets, with Matlab code.
Status. Planned. #10 holds the splitters, #11 and #89 the overfitting tests and the count of independent trials, and #25 the portfolio comparison. This textbook teaches the methods behind them, from physics and engineering. Its main lesson for the repo is where they fail on financial data. No code in the repo uses it yet.
Read. Read on 2026-11-27. The 2nd edition is behind a paywall. I read the authors' draft of the 1st edition that their site hosts (databook.pdf, 572 pages, "Copyright © 2017", created April 2018). The 2nd edition may differ. Two subagents read chapters 1, 3, 4, 5 and 7, and sections 8.1, 8.4 and 8.5, with pdftotext, and rendered pages to read the equations. They also searched the whole book for finance. I compared four quotes, the threshold example and two pieces of code with the source. Nobody read chapters 2, 6, 9 and 10 to 12, which the issue makes optional.
Summary
Claim. Data and computation now let scientists find patterns, models and controls without governing equations. The book teaches the methods. They are the SVD, sparse regression, model selection, clustering and classification, dynamics found from data (DMD, SINDy, Koopman), and control.
Method. A textbook. Each method comes with its mathematics, a worked example and code.
- SVD and PCA. The truncated SVD is the best low-rank approximation. The Gavish–Donoho hard threshold decides the rank for data with white noise: τ = (4/√3)√n·γ for a square matrix with noise level γ.
- Sparsity. LASSO keeps a few terms of many, and
robust PCAsplits data into a low-rank part and sparse outliers. - Model selection. Cross-validation, the Pareto front of error against the number of terms, and the AIC and BIC.
- Clustering and classification. k-means, dendrograms, Gaussian mixtures, LDA, SVMs, trees and random forests.
- Dynamics. DMD fits one linear operator to a series of snapshots. SINDy finds a sparse model from a library of terms. Koopman methods turn nonlinear dynamics into linear dynamics on new coordinates.
- Control. The LQR and the Kalman filter, for a known linear model with Gaussian noise.
Findings, as the source reports them.
| Setting | Number | Value |
|---|---|---|
| Rank-2 matrix in noise, n = 600, σ = 1 | Gavish–Donoho threshold | τ ≈ 56.6 |
| LASSO, 100 samples, 10 candidates, 2 true | coefficients after the LASSO, then refitted | 0.70 and −0.49, then 1.10 and −1.07 |
| AR(2) series of 100, fitted as AR(1), AR(2), AR(3) | AIC | 381.8, 358.2, 358.8 |
| The same | BIC | 389.6, 368.7, 371.9 |
| Dogs against cats, LDA, 100 random splits | accuracy | 40% to 100%, about 70% on average |
| Fisher's iris, tree with 3 splits | error over 10 folds | 4.67% |
| Two Gaussian clusters, k-means, 100 test points | wrongly labelled | 7 |
The threshold agrees: (4/√3)·√600 ≈ 56.6. The AIC barely separates the AR(2) from the AR(3), as the authors note.
Where the claims go beyond the evidence
Cross-validation assumes independent samples, and never says so. Every fold in the book is a random subset. Nothing covers ordered data, blocks, purging or embargoes. The authors write "one should never trust a model unless properly cross-validated". They also write "if you don't cross-validate, you is dumb". On a time series, random folds leak the future into training.
The book's "k-fold cross-validation" is not k-fold. Its code (Code 4.17) draws a new noisy copy of the whole data set for each "fold", and averages the fits. That needs fresh data from the same process, which a single price history never gives.
The finance claims have no evidence. The book lists finance among its fields several times. It cites one paper on finance, Mann & Kutz (2016) on DMD for trading, in one line with no results. Every worked example is a simulation or an image set.
The methods assume what returns lack.
- The Gavish–Donoho threshold assumes independent Gaussian noise of one size.
- DMD fits modes that are "globally coherent across the entire time series". The authors say its eigenvalues are biased by noise, and that more data "does not remove the bias".
- SINDy's demonstrations use noise-free data with exact derivatives.
- The Kalman filter needs a known model and known Gaussian noise.
The examples are small and single. The LASSO and AIC results each come from one random draw, with 10 or fewer candidates.
Errors in the text.
- In the 100-split cats-and-dogs code (Code 5.12), the cats' indices are
r2 + 60, so the training and test sets take rows 61 to 140. The cats are rows 81 to 160, so some dogs are labelled as cats. The loop'sEis also twice the error rate, while the text and figure call it accuracy. So the "40% to 100%" spread is unreliable. - The book compares the tree's 16% error with "the 30% error of LDA", which comes from that loop, on 2 features instead of 20.
- PCA "sets the variance to unity", but the code only subtracts the mean.
- The "80% of the image variance" sums singular values, not their squares.
- The Kalman gain (8.59) lacks Vn⁻¹, and the Riccati equation prints PA + AP∗ for PA + A∗P.
Credit. The authors state that choosing the rank is "one of the most important and contentious decisions" in the SVD. They also say DMD fails on transients and broadband signals, and that a linear model "cannot capture" chaos. They warn that error alone is a poor guide to choosing a model, because "almost any method can produce a reliable, low-error model". The book shows a model failing badly outside its training range.
Use in this repo
Never split a time series at random. The book's cross-validation is for independent samples. #10's splitters must keep time order and purge and embargo, as López de Prado does (docs/literature/advances-in-financial-ml.md). A strategy tested with random folds, as the book teaches, overstates its accuracy.
A LASSO search is a search. LASSO throws "nearly all possible predictive information" in and keeps a few terms. The book never counts the candidates. Each candidate signal, and each value of λ tried, is a trial for the ledger (#7). The selected set needs the multiple-signal correction (docs/literature/novy-marx-multiple-signals.md).
Denoise a covariance, but not with the white-noise threshold alone. The SVD threshold helps #25 compare 1/N with optimised weights. But returns are fat-tailed and their volatility changes, so the Gaussian threshold is a first guess. Test it against the strategy's own out-of-sample error.
Clustering needs a rule for the number of clusters. The book gives none for k-means or dendrograms, only the AIC for mixtures. #89, which clusters correlated trials, must state its rule, such as the ONC score (docs/literature/multiple-testing-clustering.md), and count each choice tried.
Treat DMD, SINDy and Koopman as untested on markets. The book has no evidence that they work on returns, and says why they may not: noise bias, nonstationarity and broadband signals. A strategy that uses them goes through the harness (#87) like any other, with each window and rank counted as a trial.
A question for the maintainer. Take a strategy that uses one of these methods, such as DMD or a Kalman filter. Should it state its window, rank and noise assumptions in the registry, so that the ledger can count each setting tried?