A solid model of the plant's nominal behavior renders its prediction error β the residual β into an interpretable metric of system change: small and noise-like while the plant behaves, and rising once it departs from what the model knows.
Conventionally the residual is read through two sliding windows: a recent test window to watch for the change, and an older reference window to compensate for measurement noise. The score is their ratio:
score = max( Dtest / Dref β 1 , 0 )
where D is the mean residual over a window. It sits near zero while both windows see the same nominal behavior, and rises as the test window slides into a change the reference hasn't reached yet β that rise is the detection.
The score's whole character comes from how the two windows are sized and spaced. Here's what each of the three knobs does β drag them and watch the figure:
A threshold turns the score into a yes/no alarm. Set it too low and you cry wolf β a high FAR; too high and you miss the event β a high MAR.
Don't like setting magic constants? Us neither! The score is a
relative increase β the test error as a fraction of the reference
(0.25 = 25% above baseline) β so it is dimensionless and the same
threshold transfers across signals of any scale.
Not convinced? Check the sweep view over all reasonable thresholds.
The threshold-free summary is the AUC in the table: higher is better, and it doesn't depend on where you set the bar.
Slow drifts and noisy sensors are what actually break detectors. Make the transition gradual and turn the noise up β the delay grows and the AUC falls. But the detection
So far so good? Now comes the difficult part! The whole idea holds only if we can identify a model that tracks the system well. Here the residual come from a real nonlinear two-tank simulation whose outflow slowly fouls.
The model is one of six DMD identifiers β batch vs online, input-blind vs control-aware, full vs rank-truncated. Switch them on and compare: which fires first, with fewest false alarms?
The upper panels then show each tank's level in metres (grey = plant, coloured dashed = each model's prediction) and the input flow. The residual is the plantβmodel mismatch β the gap between the grey and dashed lines β so it is in metres too; where a model's prediction peels off the plant, its residual climbs.
Export the exact figure or the underlying numbers.
Glossary. FAR = false-alarm rate Β· MAR/s = missed per sample Β·
MAR/e = missed per event Β· AUC = ranking quality Β· delay = samples to
detection. DMD variants: c = control-aware,
t = rank-truncated, o/online =
streaming/adaptive.