Curve fitting

How to interpret residual plots

To interpret a residual plot, look for structure the model left behind. A residual is the observed value minus the fitted value; plotted against fitted values, predictors or acquisition order, residuals from an adequate model scatter evenly around zero with no shape. Curvature points to the wrong functional form, a funnel to changing variance, runs in time order to drift, and separated bands to groups the model merged. Each pattern is a clue that tells you what to check next, not a verdict.

Updated · 5 min read

On this page
  1. Which residual plot answers which question
  2. Residual plot patterns, likely causes and next checks
  3. Heteroscedasticity in a residual plot
  4. Normality of residuals: when it matters
  5. A repeatable residual diagnostic sequence
  6. Residual plots in Autoplot
  7. Frequently asked questions

Which residual plot answers which question

  • Residuals vs fitted values: does the functional form hold, and is the spread constant across the predicted range?
  • Residuals vs each predictor: did the model miss curvature, a threshold or an interaction in that variable?
  • Residuals vs run order or time: is there drift, a step change or a cycle in the acquisition?
  • Residuals vs lagged residuals: are neighbouring errors correlated?
  • Normal probability plot or histogram of residuals: do the errors meet the distributional assumption behind a confidence interval or test?

State which residuals you plot. Raw residuals are in the response's units. Standardised residuals divide by an estimate of the error's standard deviation; studentised residuals also account for each point's leverage. Thresholds such as |r| > 2 or 3 only make sense for the scaled versions.

Residual plot patterns, likely causes and next checks

PatternLikely causeNext check
U-shape or arch around zeroWrong functional form, a missing term or transformationTry the scientifically motivated term or model family, then refit
Funnel: spread grows with fitted valueHeteroscedasticity, often proportional or counting noiseWeight by known errors, or fit on a scale where the spread is constant
Long runs above or below zero in time orderDrift, temperature or instrument effects, serial correlationPlot against time and lag; add the covariate or model the correlation
Wave or regular oscillationAn unmodelled periodic effect, or too few componentsCheck the period against the setup; compare with one more component
Separate bands or clustersGroups, batches or instruments merged in one modelColour residuals by group; fit groups separately or add a group term
One or a few isolated pointsA recording error, a valid extreme value, or local model failureCheck provenance and leverage before excluding; report any exclusion
Residuals of one sign at the edges of the rangeA fit range that extends past where the model holdsNarrow the range and see whether the parameters move

The same shape can have several causes. Use the pattern to pick the next check, then test that explanation against the experiment.

Autoplot histogram of cell diameter from 8 to 21 micrometres with a dashed single-Gaussian fit that overshoots the dip between two peaks and a solid mixture fit that follows both
A single Gaussian fitted to a two-peaked density. Its residuals would be negative under both peaks and strongly positive in the dip: the systematic wave of a wrong functional form.

Heteroscedasticity in a residual plot

Heteroscedasticity means the error variance changes across the data. In a residuals-vs-fitted plot it appears as a funnel or a bow tie. Ordinary least squares still gives unbiased estimates for a correct model, but it gives the noisy points too much say, and the reported parameter errors are wrong.

Common remedies, in order of preference:

  1. Weight by known measurement errors. In SciPy's curve_fit, pass them as sigma with absolute_sigma=True.
  2. Fit on a variance-stabilising scale. A log scale suits multiplicative noise, a square root suits counts, but only if the model is refitted on that scale.
  3. Model the variance explicitly, or use errors that are robust to heteroscedasticity, when neither of the above applies.

Histogram fits are a special case. Bin counts carry roughly Poisson noise, so the residual spread is larger where the density is high. A modest funnel under the peak is expected there and does not by itself mean the model failed.

Normality of residuals: when it matters

Least-squares estimates do not need normal errors. Confidence intervals and tests built on the t or F distribution do, especially with small samples. Look at a normal probability plot when you need those intervals, and read it after the functional form is right: a wrong model often produces skewed or heavy-tailed residuals that disappear once it is fixed.

With a few dozen points, a histogram of residuals is too coarse to judge normality. Prefer the probability plot, and do not accept or reject a model on a normality view alone.

A repeatable residual diagnostic sequence

  1. Keep the exact observations, fitted values, model, fit range, transforms, exclusions and weights used to compute the residuals.
  2. Plot residuals against fitted values with a zero line, then against every available predictor.
  3. If the data have an acquisition order, plot against order and against the previous residual.
  4. Check spread, groups, isolated points and any distributional assumption your inference needs.
  5. Revise the model for a scientific reason, refit, and repeat the full set.
  6. Report the original pattern, the change and the residuals after the change, not only the cleaner final plot.

If each added polynomial term leaves new structure behind, stop raising the degree and reconsider the model family. Starting values, bounds and convergence, which can also leave a patterned residual, are covered in nonlinear curve fitting.

In Autoplot

Residual plots in Autoplot

The histogram fit (free plan) reports each component's amplitude, mean and sigma with parameter errors and R², and Export Fit Function turns the fitted curve into a reusable derived function. Autoplot does not draw a residual panel for you. To get one, ask the assistant to compute observed minus fitted density at the bin centres and plot it against them with a zero line; then compare a one-, two- and three-component Gaussian or your own formula on the same bins.

X&Y plots offer linear and polynomial trend overlays, but the documentation does not describe a residual output for them. For residuals of a trend or a custom model on paired data, ask the assistant: it writes the Python that fits the model and computes the residuals, shows it to you before it runs, runs it on your Mac and keeps the script, so the residual plot can be rebuilt later. Leverage, influence and autocorrelation diagnostics are not built into any card; use statsmodels or another statistics environment for those.

For the model-choice side, see how to fit a curve to data, and compare tools in curve-fitting software for Mac.

Frequently asked questions

Frequently asked questions
What does a good residual plot look like?An even horizontal band around zero, with constant spread across fitted values and no curvature, runs or clusters. It supports the model but does not prove it.
How do I spot heteroscedasticity in a residual plot?The vertical spread of the residuals changes with the fitted value, usually as a funnel that widens to the right. Weight the fit or change the scale before trusting the parameter errors.
Do residuals have to be normally distributed?Not for the least-squares estimates themselves. Normality matters for t- and F-based confidence intervals and tests, mainly with small samples.

Sources

Autoplot behaviour comes from the app's documentation for the histogram fit, X&Y data operations and the assistant, checked on 9 October 2026, and from the features page. The residual definition and model-adequacy framework follow the NIST/SEMATECH e-Handbook on checking model adequacy, functional-form sufficiency, a misleading fitted overlay and residuals vs fitted values, order and factors. Weighting with known errors follows the SciPy curve_fit reference.

Try it on your own data.

Fit a histogram in the free plan, export the fit as a function, and let the assistant compute and plot the residuals with a script you can keep.

Follow the full fitting workflow →
Download free for Mac Mac App Store

Apple silicon · macOS 15 or later · Free plan · Plus free for 30 days

Send to my Mac

Autoplot runs on a Mac. Send the link to yourself, or open it in the Mac App Store.