Lynx and hare pelts give up a textbook law that runs two years slow
For 21 years from 1900, the Hudson's Bay Company's fur records rise and crash twice, hares first and lynx after. Those counts are enough to pick the classic predator–prey equations out of 12 candidate terms, and too few to get the length of the cycle right.
- Published
- 21 November 2026
- Reads
- A time column and two or three measured ones
- Example
- Lynx and hare pelts, Hudson's Bay, 1900–1920
- Method
- SINDy, as PySINDy 2.0.0 fits it
- Download
- About 350 KB
In 1903 the Hudson’s Bay Company’s hare pelts peaked, and a year later its lynx pelts did. Both collapsed, recovered and peaked again, hares in 1913 and lynx in 1915. Ecology textbooks explain such cycles with the Lotka–Volterra equations: prey breed, predators eat them, and predators starve when the prey run out.
The textbook starts from those equations. laws starts from the numbers, 21 for each species in thousands of pelts a year, and asks which equations could have produced them. Its answer is typeset under the data:
- dH/dt = 0.486 H − 0.0221 H L
- dL/dt = −0.708 L + 0.0199 H L
These are Lotka and Volterra’s equations. Hares, left alone, multiply at a rate of 0.486 a year. Lynx without hares die off at 0.708 a year. The product H L counts meetings between the two, which cost hares and feed lynx.
Eight terms had to go
The method, SINDy (sparse identification of nonlinear dynamics), was published by Brunton, Proctor and Kutz in 2016. It estimates how fast both counts are changing in every year from the neighbouring years, then tries to write those rates as weighted sums of candidate terms. Here there are six per equation: a constant, H, L, H², H L and L². Any weight below a threshold is struck out and the rest are refitted, until nothing changes.
At the default threshold of 0.2, four of the 12 terms are left. Drag the threshold on the page and the equations rewrite themselves, with a dotted line under whatever will drop out next. At 0.05 there are 10 terms and no obvious story. The hare equation settles on its pair at 0.07, but lynx hold on to extra terms until 0.19. From there to 0.32, 14 of the slider’s 124 steps, nothing moves. At 0.33 the hare equation empties, and at 0.49 the lynx equation follows.
The explanations it beat
A threshold can land on a tidy answer by luck, which is why the page also fits every possible model of one or two terms and lists them in rank order. For hares, the Lotka–Volterra pair explains 92.5% of the variation in the rate of change. The runner-up, a constant minus lynx, manages 84.4%. For lynx the gap is 87.6% to 77.5%.
Leave out any one year and that pair is still the best two-term model, in 21 of 21 refits for both species. The thresholded fit is a little less steady: it keeps its hare terms in all 21 and its lynx terms in 19, picking up extras in the other two.
The equations also make a prediction that was never fitted directly. They balance at 35.5 thousand hares and 21.9 thousand lynx, and a Lotka–Volterra cycle averages out to its balance point. The pelts average 34.1 and 20.2.
Two years slow
Start the equations at the 1900 counts, let them run, and they come round every 12.1 years. In the data the peaks are 10 years apart for hares and 11 for lynx. By the second cycle the model is badly late, and a typical miss is a factor of about 2.4 for hares and 2.8 for lynx (root-mean-square errors in the logs of 0.865 and 1.03).
SINDy never looks at that run. It fits rates of change, and with one noisy point a year those can be matched well by equations that drift steadily away from the counts. The dashed curve on the page’s first plot keeps the four terms and adjusts their weights and starting point until the run itself follows the data. This second fit is no longer SINDy, and is labelled that way. It lands close to Bob Carpenter’s Bayesian fit of Lotka–Volterra in Stan, which was given the form of the equations in advance:
| SINDy | fitted to the run | Stan | |
|---|---|---|---|
| hare growth | 0.486 | 0.540 | 0.545 |
| hares lost to lynx | 0.0221 | 0.0272 | 0.028 |
| lynx decline | 0.708 | 0.796 | 0.803 |
| lynx gained from hares | 0.0199 | 0.0237 | 0.024 |
| cycle, years | 12.1 | 10.3 | 10.16 |
| log error, hares | 0.865 | 0.218 | 0.225 |
| log error, lynx | 1.03 | 0.220 | 0.223 |
SINDy found the form from the rates alone; good weights needed the whole trajectory.
Another team’s SINDy missed it
In 2021 Hirsh, Barajas-Solano and Kutz ran plain SINDy on these counts and concluded that it failed to find Lotka–Volterra. Their Table 4 has almost identical rates, 0.48 for hare growth and 0.71 for lynx decline, plus a stray lynx term of −0.143 in the hare equation.
They scaled the columns by standard deviation and laws scales them by the mean, which changes what a given threshold removes. In laws, too, a lynx term creeps into the hare equation once the threshold is 0.06 or lower. Settings like these can decide whether the textbook law appears, which is why the page shows every threshold and not only the one that works.
To be sure that the successes and the misses are SINDy’s own, the Rust engine was compared with PySINDy 2.0.0 run in Python on the pelts. Candidate terms and derivatives agree to 1e-12. Coefficients agree to 1e-9, with identical terms kept at nine thresholds, at three more with cubic terms, with sines and cosines added, and with a year removed to make the time steps uneven. The R² of all 21 small models agrees to 1e-9, every leave-one-out refit keeps PySINDy’s terms, and the forward run follows PySINDy’s simulation to 1 part in 100,000.
Your own series can have up to 5,000 rows and three measured columns, and stays in the page. The engine works through the largest, with 26 candidate terms, in about 15 ms natively; the pelts take about 20 ms in the browser.
Limits
- Twenty-one points is very little, and differences between neighbouring years amplify their noise.
- Pelts record trade, which moves with trapping effort and prices as well as with animal numbers.
- The leave-one-out count is optimistic. A missing year’s neighbours carry much of its information, and the rates of change come from the full series.
- R² scores the fit to rates of change, and says nothing about the run.
- There is one real example. A pendulum recorded with a phone’s sensors will join it once the recording exists; generated data would prove nothing.
Data and licences
- Pelts: stan-dev/example-models (BSD-3-Clause), from Howard’s course notes, after D. A. MacLulich (1937) and C. Elton and M. Nicholson (1942).
- Method as implemented in PySINDy (MIT): B. de Silva et al., PySINDy: a Python package for the sparse identification of nonlinear dynamical systems from data, Journal of Open Source Software 5 (2020); A. A. Kaptanoglu et al., PySINDy: a comprehensive Python package for robust sparse system identification, Journal of Open Source Software 7 (2022).
Further reading
- S. L. Brunton, J. L. Proctor and J. N. Kutz, Discovering governing equations from data by sparse identification of nonlinear dynamical systems, PNAS 113 (2016), 3932–3937.
- B. Carpenter, Predator-Prey Population Dynamics: the Lotka-Volterra model in Stan (2018).
- S. M. Hirsh, D. A. Barajas-Solano and J. N. Kutz, Sparsifying priors for Bayesian uncertainty quantification in model discovery, arXiv:2107.02107 (2021).
