🧮
🧮 Math & statistics

Polynomial Regression Calculator (least-squares fit, degree 2 to 6)

Results update as you type.

Your numbers

Understanding the polynomial regression calculator — concept and principle

This calculator fits a polynomial curve of degree 2 to 6 to your (x, y) data by least squares. It returns the fitted equation, the coefficients, R², adjusted R², the standard error, the residual sum of squares and a prediction at a chosen x. Use it for curved trends in experiments, calibration curves, growth data and engineering measurements.

Polynomial regression summaryFitting a quartic to 10 pointsPointsx = 0…9Degree4minimise Σ(y − ŷ)²SSE 0.0982 · n − d − 1 = 5R² · adjusted0.9981 · 0.9966ŷ at x = 4.52.1574standard error 0.1402
Least squares picks the 5 coefficients that make the squared misses smallest.

How it is calculated

Model: ŷ = a₀ + a₁x + a₂x² + … + a_d·x^d.

You need at least d + 1 different x values.

The principle

Although the curve is not a straight line, the model is linear in its coefficients, so ordinary least squares applies just as in linear regression. Least squares picks the curve that makes the total squared vertical distance from the points as small as possible. Each extra degree adds one more coefficient and one more bend, which always reduces SSE. That is why plain R² always rises with degree, and why adjusted R² and the standard error, which charge for each extra coefficient, are better for choosing a degree.

Worked example

Default data: x = 0 to 9, y = 1.0, 2.8, 3.1, 2.5, 2.0, 2.4, 3.9, 6.0, 7.6, 7.9; degree 4; predict at x = 4.5.

  1. Fit by least squares: y = −0.0181964x⁴ + 0.341696x³ − 1.92181x² + 3.65915x + 0.932517.
  2. SSE = 0.0982226 with n − d − 1 = 10 − 4 − 1 = 5 residual degrees of freedom.
  3. R² = 0.998117; adjusted R² = 0.996611.
  4. Standard error = √(0.0982226 ÷ 5) ≈ 0.140159.
  5. Prediction at x = 4.5: ŷ ≈ 2.15742.

How to read the result

R² near 1 means the curve follows the points closely, but with few points and a high degree that can simply be overfitting. Compare adjusted R² and the standard error across degrees and choose the lowest degree that fits well. The standard error is the typical vertical miss in y units. Predictions are reliable only inside the range of your x data.

Common mistakes

Keep in mind: A good fit does not prove the relationship is truly polynomial. Use domain knowledge and residual plots, and avoid using the model outside the measured range.

Frequently asked questions

What degree should I choose?

The lowest degree that captures the shape, judged by adjusted R², the standard error and a look at the residuals.

Is polynomial regression a type of linear regression?

Yes. It is linear in the coefficients, so the same least-squares method applies.

Why does the page centre and scale x?

Powers of large x values become huge and nearly dependent, which makes the equations unstable. Rescaling avoids that.

Sources: NIST/SEMATECH e-Handbook of Statistical Methods, §4.1.4.1 Linear Least Squares Regression

Checked 9 Nov 2026. NIST/SEMATECH e-Handbook of Statistical Methods, §4.1.4.1 Linear Least Squares Regression (polynomial models are linear in the parameters; estimates minimise the sum of squared deviations). R², adjusted R² and standard error with n − d − 1 residual degrees of freedom: standard formulas.

🧮 All math & statistics tools →🌍 Calculators by country →