Technology / Technical guide
Model Residuals: Prediction Gaps & Ambiguous Causes
A model residual is the difference between an observation and a specified model prediction. It records what that prediction did not explain, rather than naming a physical cause. Model error, unrepresented inputs and measurement error can all produce residual structure. The prediction horizon and signal units belong to its definition.
A discrepancy becomes meaningful through its model.
Sign, timing and units define the residual question before its magnitude or pattern can be interpreted.
01 / Prediction
The reference is a model result, not another raw channel.
Use r[k] = y[k] − ŷ[k], where y is an observation and ŷ the prediction for the same represented output.
Use r[k] = y[k] − ŷ[k], where y is an observation and ŷ the prediction for the same represented output. A one-step prediction, a longer forecast and a fitted static response use different information and should not be labelled as an identical reference.
MathWorks describes residuals against one-step-ahead predicted validation outputs. The mathematical difference has the output’s units. Comparing two different physical quantities without a defined mapping would not produce the same kind of residual, even if their plotted scales happen to look similar.
02 / Toy gain error
Input-related discrepancies can arise without a fault.
Consider an invented static relationship y = 2u and a model ŷ = 1.8u, where input and output share arbitrary units.
Consider an invented static relationship y = 2u and a model ŷ = 1.8u, where input and output share arbitrary units. Its residual is 0.2u. At u = 5 units, r = 1 unit; at u = 10 units, r = 2 units.
The residual grows with the input because the model coefficient differs. This arithmetic requires no hardware failure. In a real interpretation, uncertainty in the coefficient, the input and the observation could change the comparison; a magnitude alone does not identify which relationship is wrong.
03 / Offset
Several mechanisms can produce a similar mean departure.
A constant residual can arise from a missing model intercept, an observation offset or an unrepresented contribution that remains nearly constant.
A constant residual can arise from a missing model intercept, an observation offset or an unrepresented contribution that remains nearly constant. These explanations can produce the same sign and magnitude within the represented interval. The residual alone does not uniquely separate them.
A time-varying omitted input can likewise create changing discrepancies. Calling every change an anomaly conflates unexpected model output with confirmed abnormal equipment behaviour. The cause remains a separate inference, requiring distinctions that the chosen model and observations can actually support.
04 / Structure
Correlation concerns what the model has left unexplained.
Residual correlation over time can indicate structure remaining after the prediction, while a relationship with represented inputs can indicate an incomplete input–output description.
Residual correlation over time can indicate structure remaining after the prediction, while a relationship with represented inputs can indicate an incomplete input–output description. The interpretation depends on the model, timing and feedback relationships rather than on a universal visual pattern.
A least-squares fit can make its own residuals orthogonal to fitted regressor columns as an algebraic consequence. That in-sample relationship is not independent proof of validity. A low residual on the observations used to choose the model also does not establish behaviour outside those conditions.
05 / Uncertainty
Normalising a discrepancy changes its comparison basis.
If a justified residual-error variance S is positive, a scalar normalised residual can be written r/√S.
If a justified residual-error variance S is positive, a scalar normalised residual can be written r/√S. It is dimensionless, but its interpretation depends on what S includes. Ignoring model uncertainty or error correlation can make a normalised magnitude misleading.
A Kalman innovation is a particular residual before the observation correction under its state-estimation model. A generic model residual need not be that innovation. Vector discrepancies also require a declared covariance relationship; independently scaling components does not remove their shared uncertainty.
06 / Scope
Diagnostic certainty requires more than a plotted difference.
A residual can support a question about model consistency without proving a unique fault, a protection need or a corrective action.
A residual can support a question about model consistency without proving a unique fault, a protection need or a corrective action. Timing mismatch, unobserved inputs and changing operating relationships can each complicate interpretation. A failed prediction is evidence about a prediction first.
No MARSTON residual diagnostic, threshold or automatic response is claimed. This explanation provides no alarm settings, fault injection or operating procedure. The identifiability guide develops the related question of whether different explanations can be distinguished.
Related technical guides: Least-Squares Fitting: Residuals, Weights & Input Errors · Parameter Identifiability: Unique Models & Hidden Ambiguity · Estimator Bias, Variance & Mean-Squared Error.
General background: MathWorks: prediction residuals and unexplained structure. These references explain industry concepts; they are separate from the applicable MARSTON product and project documents.
Key concepts and conditions.
Read each quantity with its reference, units and stated conditions. A general relation does not establish a model-specific value.
| Concept / quantity | Meaning / relation | Conditions / limits |
|---|---|---|
| Residual r | Observation minus stated prediction | Same represented output, units and time |
| Prediction horizon | Information used to form ŷ | One-step and long-horizon predictions differ |
| Input relationship | Residual variation associated with input | Can arise from an incomplete model |
| Normalised value | r divided by justified uncertainty scale | A valid positive variance model is required |
| Fault interpretation | Physical explanation of disagreement | Not uniquely established by residual shape |
Engineering questions.
Is every residual a fault?
No. A discrepancy can arise from model, input or measurement limitations.
Does a growing residual prove damage?
No. The hypothetical coefficient mismatch produces growth without a fault.
What does a constant residual mean?
It records a mean departure but does not uniquely identify its cause.
Are in-sample residuals independent validation?
No. Their properties can result from how the model was fitted.
Is every residual a Kalman innovation?
No. An innovation belongs to a specific prediction-and-correction model.
Does the page specify an alarm threshold?
No. It explains residual meaning without a diagnostic implementation.
Technical enquiry
Discuss the technical question.
A model residual is the difference between an observation and a specified model prediction. Share the model and applicable operating or design information for an engineering discussion.