Skip to content

A two-minute tour

Twindex proves when data cannot tell two explanations apart, and it tells you which measurement would. Every claim is an exact certificate that anyone can re-check, including in a browser with nothing installed.

The two-minute demo

0:00 The question. Open the live demo. In January 1978, influenza swept through an English boarding school, and the nurses counted the boys in bed each day. Ask: after five days, could anyone have known how contagious it was (R₀)?

0:20 Two explanations, same data. With the slider at "through 26 Jan", two curves pass through every error bar. One has R₀ = 2.52 and the other R₀ = 20. They agree on everything seen so far and disagree wildly about what comes next. So no method, whether a statistician, a neural network or a Bayesian model, could have pinned R₀ down from those counts.

0:45 Don't trust us. Check it. Click Check this proof in my browser. Python starts in the page and runs Twindex's exact checker on the certificate: VALID in under half a second. It uses rational arithmetic with no floating-point rounding, and nothing is sent to a server.

1:05 The discovery loop. Scroll to The discovery loop. Using only the first five counts, as if on 26 January, Twindex shows that the two explanations predict 142 vs 471 boys for the next day. They are so far apart that any count on 27 January, within the stated allowance, must rule out at least one of them. The recorded count was 298. Click the two twin buttons: both are now proved INVALID. With six counts, the most different pair it finds is R₀ = 3.19 vs 6.10.

1:30 It's general. The cards below replay certificates for drug dosing (pharmacokinetics), neurons (FitzHugh–Nagumo), PDE inverse problems and a twin that fails. The same twindex ode model.json data.csv command works on any polynomial ODE model and your own CSV.

1:50 Why it matters. Before you spend money on an experiment, Twindex can show that it cannot answer your question, and suggest the measurement that would.

What it proves, in one page

Twindex proves Twindex does not prove
Two parameter sets both fit every measurement within the stated error allowance (a pair certificate). That the model is the right model.
Hence no method can estimate the parameter with worst-case error below half the certified gap. That the true value lies between the two twins.
A given future measurement would rule out at least one of two named twins. That this measurement is the best possible one.
Two specific values both fit, so the uncertainty is at least their gap. The full range of values that fit. A pair is a lower bound, and a failed search proves nothing.
A proposed explanation is incompatible with the data (INVALID). Anything from a failed search: failing to find twins proves nothing.

How the proof works. A numerical solver proposes candidates. They are rounded to exact rational polynomials, and a small checker bounds how far each candidate can be from the true solution, using maximum-principle barriers for PDEs and a logarithmic-norm tube argument for ODEs. All of this is computed in exact arithmetic. The checker is about 4,400 lines of standard-library Python, type checked with mypy --strict, and every theorem it relies on is written out in THEORY.

Assumptions are stated, not hidden. In the 1978 example these are:

  • an SIR model;
  • bed counts treated as infections;
  • a counting-error allowance of 3√count + 5 boys;
  • explicit prior ranges.

Change any of them and the certificates no longer apply. That is the point: the claim is exactly as strong as what you assumed, and no stronger.

Who would use this

  • Epidemiology: what can early outbreak data really say about R₀?
  • Pharmacology: which rate constants a sampling schedule can and cannot determine.
  • Chemistry and systems biology: mass-action kinetics with unidentifiable rates.
  • Engineering and physics: PDE coefficient inverse problems and sensor placement.
  • Machine learning for science: checking whether a PINN's answer is the only answer.

See where Twindex applies for the exact mathematical scope.

Try it yourself

$ pip install "twindex[general,report]"
$ twindex example theta500_pair > pair.json && twindex check pair.json

The ODE quickstart takes your own model and data. Reproduce the 1978 study with studies/flu_1978.py and studies/flu_1978_next.py.