Polynomial regression

How to choose a polynomial regression degree

Compare linear, quadratic, cubic, and higher-degree polynomial fits using scientific reasoning, residual patterns, and validation evidence instead of R-squared alone.

Hands-on example

Try this in FigureCheck

Compare quadratic, cubic, and higher-degree polynomials on the same data while watching residuals and the fit check.

Opens a small synthetic dataset with a step-by-step guide in a new editable session.
Polynomial regression fits of different degrees compared with scientific data and residuals
Increasing polynomial degree can improve the training fit while making the curve less stable between or beyond observations.

What polynomial degree means

A degree-one polynomial is linear. Degree two is quadratic and can form one broad turning point. Degree three is cubic and can represent an S-shaped pattern. Higher degrees permit more changes in curvature, but every added term increases model flexibility.

Start with the simplest defensible model

  1. Fit a line first and inspect the residuals.
  2. Move to a quadratic only when the data or scientific mechanism supports curvature.
  3. Compare validation error, not only training R-squared.
  4. Stop increasing degree when additional terms do not provide stable, interpretable improvement.

A high-degree polynomial can pass close to every observed point and still oscillate sharply between them. Its extrapolation can become extreme even just outside the measured X range.

Signs of underfitting and overfitting

  • Underfitting: residuals show a broad curve or repeated structure that the model misses.
  • Useful added complexity: residual structure decreases and validation performance improves consistently.
  • Overfitting: training error becomes very small while validation error rises or the curve develops unsupported wiggles.

FigureCheck's fit check is supporting evidence rather than an automatic verdict. Read the probability with the visible curve, residuals, sample size, and scientific context.

Polynomial fit or cubic spline?

Use a low-degree polynomial when one compact global equation is meaningful. Consider a cubic spline when the shape changes locally and a high global degree would be unstable. Neither choice establishes causation or proves a mechanism.

FigureCheck Web v1.4.2 (20260902-211836) Next: Fourier fitting