← All posts

Verification Is Not Validation: Checking Flood Models

A flood simulator that solves the shallow-water equations on a terrain grid can take a long time for one storm over a large area. A machine-learning model trained on that simulator's runs can answer in a fraction of the time, which is the reason to build one. Fast models like this come with a reporting habit I have learned to distrust, including in my own work: a test score against the simulator presented as if it said how well the model predicts real floods.

Those are two different checks. Engineering has names for them. Verification asks whether a model reproduces the reference it was built to reproduce. Validation asks whether it matches what happened in the world. This post shows why the difference matters for a fast flood model, what evidence each check needs, how a model can pass one and fail the other, and how to word results so that neither is passed off as the other. The numbers come from a small synthetic lab you can download and run; nothing here is taken from a real flood model.

In short

  • A fast model trained on simulator runs and tested on held-out simulator runs has been verified, not validated. The score says nothing about the simulator's own errors.
  • In the lab, a model scores 0.988 against its simulator and 0.932 against reality, and the gap grows with physics the simulator leaves out while the verification score does not move.
  • An uncertainty band sized on simulator runs covers the simulator, not the real flood: on average over ten lab seeds, 91% of cells against the simulator and 15% against reality.
  • Validation evidence is incomplete by nature, and a terrain baseline belongs beside every score.

Two questions

The distinction comes from computational engineering, where it is set out in detail by Oberkampf and Roy (2010). Their short form is that verification asks whether the equations are solved right, and validation asks whether they are the right equations. A fast model adds a layer, because it learns from a simulator rather than from the world. In this series, verifying a fast model means checking it against its simulator; checking the simulator's own code against known solutions, which Oberkampf and Roy call code verification, is a separate step:

Four boxes. The real flood leads to what was observed. The real flood's inputs feed the simulator, whose runs train the fast model. A dashed bracket joins the fast model and the simulator, labelled verification. A solid bracket joins what was observed and the models, labelled validation Two different questions, answered against two different references The real flood rain, ground, drains, buildings The simulator equations on a terrain grid The fast model learned from simulator runs What was observed outlines, satellite, gauges inputs runs verification fast model against simulator validation any model against what was observed
Figure 1. Verification compares the fast model with the simulator it learned from; validation compares any model with an observed flood.

A fast model's error against what really happened splits into two parts:

observed − fast = (observed − simulated) + (simulated − fast)

The second term is the emulation error, and held-out simulator runs measure it well. The first is everything the simulator gets wrong: rainfall that differs from the storm that fell, ground data that misses a wall or a culvert, drains it does not model, roughness it guesses. A verification score sees only the second term. It can be excellent while the first is large.

A lab where the simulator is wrong

The lab makes the first term visible on purpose. A valley cross-section stands in for terrain, with a raised bank and a low hollow behind it. Water fills the valley from the channel and reaches only ground connected to it. Reality loses a quarter of the rain to drains; the simulator does not model drains and keeps all of it. The fast model learns the simulator's water level from five runs and predicts storms between them:

A valley cross-section with ground as a line. The simulator's water level, dashed, sits above the real water level, shaded blue. Dots mark cells in the hollow behind the bank that a lowest-ground baseline marks wet although no water reaches them Lab valley: the simulator's water, the real water, and a terrain baseline simulator level real level Dashed: the simulator keeps all the rain. Blue: reality loses a quarter of it to drains the simulator does not model. Dots: cells a lowest-ground baseline marks wet in the hollow behind the bank, which no water reaches.
Figure 2. One of the 20 lab valleys at one storm.

The score used throughout is the critical success index, the share of cells correctly marked wet among all cells marked wet by either side (Schaefer 1990):

CSI = hits / (hits + misses + false alarms)

A 6 by 6 grid of cells marked H for hits, M for misses and F for false alarms, with the counts and the resulting critical success index, and the higher accuracy the same prediction would get A worked example: observed and predicted wet cells on a 6 by 6 grid M H H F M H H H M H H F M H H F F Hits H = 9: wet in both Misses M = 4: observed wet, predicted dry False alarms F = 4: predicted wet, observed dry CSI = 9 / (9 + 4 + 4) = 0.53 The 19 cells dry in both do not count. Accuracy, which counts them, would be 0.78 for the same prediction.
Figure 3. Cells dry in both are left out, which is why the index is not inflated by large dry areas.

On this index the fast model looks excellent against its simulator and noticeably weaker against reality:

Four bars: fast model against simulator 0.988, fast model against reality 0.932, simulator against reality 0.923, terrain baseline against reality 0.783. Depth error is 4 cm against the simulator and 16 cm against reality Lab: critical success index of wet cells, 80 unseen storms in 20 valleys fast model vs simulator 0.988 fast model vs reality 0.932 simulator vs reality 0.923 terrain baseline vs reality 0.783 Depth error, root mean square: 4 cm against the simulator, 16 cm against reality. One seed; ten are in the table below.
Figure 4. The verification score is the highest bar and the least informative about real floods.

The fast model even scores slightly above its own simulator against reality, 0.932 against 0.923, and it does so in all ten seeds I ran. That is not skill. The fast model interpolates the water level in straight lines between its training runs, and because a valley widens as it fills, the true level rises along a curve that the straight lines undercut: in 76 of 80 test cases the fast model's level sits below the simulator's. Reality also sits below the simulator, because of the drains, so the bias happens to point the right way. A different flaw in the simulator could point the other way. Matching the simulator more closely is not the same as matching the world more closely. The depth error says the same more plainly: 4 cm against the simulator, 16 cm against reality. The simulator itself is 20 cm from reality, five times the emulation error, and no test against the simulator can see that part:

Three bars of depth error: fast model against simulator 4 cm, simulator against reality 20 cm, fast model against reality 16 cm Lab: depth error, root mean square, in centimetres fast model vs simulator 4 cm simulator vs reality 20 cm fast model vs reality 16 cm The emulation error is small beside the simulator's own error, which no simulator-based test can see.
Figure 5. The two errors do not simply add: here part of the emulation error happens to offset the simulator's.

Now make the missing physics larger. As the share of rain that real drains remove grows from none to 40%, the verification score stays where it was, and only validation notices:

Two lines against the share of rain removed by drains, from 0 to 40%. Verification stays near 0.99 throughout. Validation starts at 0.99 and falls to about 0.86 Lab: as the simulator's missing physics grows, only validation notices 0.8 0.9 1.0 0% 10% 20% 30% 40% share of the rain that real drains remove and the simulator ignores verification: fast model vs simulator validation: fast model vs reality
Figure 6. A verification score cannot detect a flaw the simulator shares with the model trained on it.

Uncertainty has the same problem

A fast model should state its own error, usually as a band around each depth. The usual way to size the band is to measure how far the model's predictions fall from the reference on runs it has not seen, then widen the band until a chosen share falls inside. The share inside is the band's measured coverage. Counted per cell:

coverage = (1/N) Σi 1[ |yi − ŷi| ≤ w ]

where yi is the reference depth, ŷi the model's, and w the band's half-width. Sized on simulator runs, the band covers the simulator. Nothing in the procedure involves the real flood:

Four bars, means over ten seeds with whiskers from lowest to highest, for a band sized to cover 90% of simulator cells: 91% of cells and 80% of whole runs covered against the simulator; 15% of cells and 1% of whole runs against reality Lab: a depth band sized to cover 90% on simulator runs, tested on new storms, ten seeds each cell, against simulator whole run, against simulator each cell, against reality whole run, against reality 91% (74% to 99%) 80% (66% to 86%) 15% (2% to 22%) 1% (0% to 8%) Bars: mean of ten seeds; whiskers: lowest and highest seed. The band came out 11 to 24 cm wide, mean 19 cm. A run counts as covered only if every wet cell is inside.
Figure 7. Measured coverage against the simulator is a verification result, however good it looks.

Over ten seeds the band came out 11 to 24 cm wide and covered between 74% and 99% of simulated cells, because a band is set on calibration storms before it meets the test storms. Against reality it covered between 2% and 22%. Two further points follow. Coverage per cell and coverage per run answer different questions. Someone pricing many properties wants to know what share of locations fall inside the band; an engineer judging one site wants to know whether the whole map is right, a much stricter test. And a band can be honest about the simulator while saying nothing about the world: on average 15% of real depths fall inside a band that covers 91% of simulated ones. Statements such as "certified error bounds" or "within three sigma" hide both points. The defensible form is the coverage, its level, against what reference, per cell or per run, and on which held-out runs.

Plotted against the band's width, the gap is plain. A band that covers 90% of simulated depths covers far fewer real ones, and reaching 90% against reality takes a band more than twice as wide:

Two rising curves of coverage against band half-width from 0 to 100 cm. Against the simulator, coverage passes 90% at about 20 cm. Against reality it is below 20% up to 20 cm and passes 90% only between 40 and 50 cm Lab: share of depths inside a band of the fast model's depth plus or minus w 0% 50% 90% 100% 0 20 40 60 80 100 band half-width w, cm against the simulator against reality Wet cells of 80 new storms. 90% coverage: about 20 cm against the simulator, 40 to 50 cm against reality.
Figure 8. How wide the band must be depends on which reference it has to cover.

This curve comes from one seed; its 20 cm for 90% against the simulator sits inside the 11 to 24 cm range above. A band is always set before the data it is judged on, and it holds only as well as the two resemble each other.

What validation evidence looks like

Validation needs observations, and every kind is partial:

EvidenceWhat it checksKindWhat it misses
Held-out simulator runsThe fast model against its simulatorVerificationEverything the simulator gets wrong
Benchmark tests of the simulatorThe code against known solutionsVerificationWhether its inputs and physics fit a real place
Recorded flood outlinesThe extent of a past floodValidationDepth, timing, and areas nobody recorded
Satellite radar extentOpen water at one momentValidationWater under trees and between buildings, and the peak if no pass caught it
River and level gaugesWater level over time at a pointValidationEverything away from the gauge; needs the same height reference
Another model's flood mapAgreement in patternNeitherIts own errors: it is a model, not an observation

Partial evidence lowers the score even of a model that is exactly right. In the lab, a recorded outline that caught 70% of the flooded cells takes a perfect model from 1.0 to about 0.7:

Three bars: a perfect model against a complete record scores 1.0, against a record that caught 70% of the flood about 0.71, and the fast model against the same record about 0.65 Lab: scored against a record that caught 70% of the flooded cells perfect model, complete record 1.000 perfect model, 70% record 0.705 fast model, 70% record 0.650 A model that is exactly right loses about 0.3 of its score to what the record missed.
Figure 9. Part of every validation score is the record's own gaps.

So a validation score needs its context: which record, what it is known to miss, and, most of all, a baseline.

Always report a baseline

Terrain alone predicts a lot about where water goes. A model that cannot beat a rule built from the ground surface has not shown that it learned anything the terrain did not already say. Two baselines are cheap to compute and often hard to beat in flat, simple terrain:

BaselineRuleSource
Elevation thresholdMark the lowest cells wet, as many as the model marks wetNone needed
Height above nearest drainageMark a cell wet when its height above the nearest stream is below a thresholdNobre et al. 2011

Both need the same care as the model: match the wet area or the threshold the same way for every method, and say whether the threshold was fitted to the record being scored or set in advance. In the lab the elevation baseline scores 0.783 against reality, well below the fast model, because it wets the hollow behind the bank that no water reaches. In real terrain the gap can be much smaller, and in some places the baseline wins. That is worth knowing before anyone else finds it.

Words that keep the two apart

Most mix-ups happen in wording, not in analysis. The phrases on the left are common; the ones on the right say what was actually measured:

AvoidSay instead
"Validated", of a score against simulator runs"Verified against held-out simulator runs"
"Validated against satellite""Compared with satellite-observed extent", with the score and the baseline beside it
"X% accurate against the national flood map""Compared with that map, model to model", naming the rainfall each used
"Certified error bounds", "within three sigma""Measured coverage of X% per cell, against the simulator, on held-out runs"
"Probability of flooding" from runs agreeing"K of N model runs wet"
"Physics-informed", of a model trained on simulator output"Trained on physics-based simulations"
"1-in-100-year flood" where the rainfall statistics were not fitted"1.5 times the reference storm's rainfall"

None of this makes a fast model less useful. A model that is well verified against a good simulator is a cheap way to explore many storms, as long as the simulator's own record against real floods is stated beside it, or its absence is.

When verification is all there is

For many places no flood has ever been recorded, and validation is impossible. That is not a reason to stay silent about it. A result there can still be stated precisely: the fast model reproduces this simulator to the stated accuracy, and the simulator's own record against real floods, elsewhere, is this. If the simulator has never been compared with an observed flood either, that belongs in the same sentence. A reader can work with "this is what the simulator would show for this rainfall"; a reader misled into thinking it is a forecast of what will happen cannot.

It helps to keep the two records apart in the files as well as in the text. A verification result belongs to a model release and a set of simulator runs; a validation result belongs to a model release, a place and a dated flood. Stored together under one heading such as "accuracy", they are merged again by the next person who quotes them.

A checklist for any flood-model result

Before a score leaves the team, each of these should be stated beside it:

StateWhy
The reference: simulator runs or an observed floodDecides whether the score is verification or validation
How test cases were held out: random cells, whole storms or whole areasRandom cells and repeated storms leak information into the test
The baseline, and whether its threshold was fitted or set in advanceA score with no baseline cannot be read
The depth that counts as wetThe critical success index changes with it
The rainfall: an observed storm, a design storm or a multiple of a referenceA return period is only meaningful where the rainfall statistics behind it are real
Coverage: its level, per cell or per run, and against whatPer cell and per run answer different questions
What the record is known to missPart of any validation score is the record's own gaps

The fourth row is easy to underrate. Scored against reality with different depths counted as wet, the same lab predictions score anywhere from 0.93 to 0.82:

Five bars of critical success index for the same predictions: about 0.93 with 1 cm counted as wet, 0.92 at 5 cm and 10 cm, 0.90 at 30 cm and 0.82 at 50 cm Lab: the same predictions, scored with different depths counted as wet wet above 1 cm 0.927 wet above 5 cm 0.923 wet above 10 cm 0.920 wet above 30 cm 0.902 wet above 50 cm 0.821
Figure 10. Two teams scoring the same model at different wet depths will report different numbers, and both will be right.

The second row is the subject of the next post in this series: holding out random cells, or storms that are variations on one event, lets neighbouring cells and near-copies leak between training and test, and the score rises for reasons that have nothing to do with skill.

A small lab you can run

The lab is synthetic: one-dimensional valleys, a storage model of water, no real terrain or rainfall. Download the lab (zip), then run python run_all.py and python -m pytest -q. Its six experiments produce the figures above, and each of its seven tests checks a claim against the alternative it rejects, for example that reality and simulator agree exactly once the drains are removed. python seeds.py repeats experiments 1 and 4 over ten seeds; the coverage figure uses its means, and the table below shows how far each number moves.

QuantityOne seed, in the figuresTen seeds: meanLowest to highest
CSI, fast model vs simulator0.9880.9900.987 to 0.993
CSI, fast model vs reality0.9320.9230.917 to 0.927
CSI, simulator vs reality0.9230.9150.909 to 0.918
CSI, terrain baseline vs reality0.7830.7880.760 to 0.805
Depth error, fast model vs simulator4 cm4 cm3 to 4 cm
Depth error, fast model vs reality16 cm16 cm16 to 17 cm
Band half-width19 cm11 to 24 cm
Coverage per cell vs simulator91%74% to 99%
Coverage per cell vs reality15%2% to 22%
Coverage per run vs simulator80%66% to 86%
Coverage per run vs reality1%0% to 8%

The scores barely move: a standard deviation of 0.003 or less for the fast model. Coverage moves a lot. The band rests on 80 calibration runs whose cells are far from independent, a problem the next post takes up, and that is a reason to quote coverage with its range.

Limits of this post

  • The lab's water fills a valley by volume. Real floods flow, pond and drain over time, so the lab shows the logic of the checks, not realistic scores.
  • The simulator in the lab has one known flaw. Real simulators have many, and most are not known in advance.
  • A good validation score on one flood is one data point. Floods differ by place, season and cause, and a model needs scoring on many before its record means much.

Sources