Polynomial Regression Calculator

Enter data pairs and select the polynomial degree to fit a least-squares model. Inspect the resulting equation, R², and residual diagnostics.

Degree must be less than number of data pairs.

Predicted y ≈ 46.3333

Polynomial model

y = 0.9365 + 0.8995·x + 1.5556·x^2 + -0.0741·x^3

R² = 0.9988

Fitted values and residuals
xActual yPredicted yResidual
01.00000.93650.0635
13.00003.3175-0.3175
29.00008.36510.6349
315.000015.6349-0.6349
425.000024.68250.3175
535.000035.0635-0.0635

How to Use This Calculator

  1. Enter paired x and y observations.
  2. Select the polynomial degree to match the level of curvature you wish to capture.
  3. Review the fitted equation and R² to understand model fit.
  4. Inspect residuals and optionally generate predictions for new x values.

Formula

Model: y = a₀ + a₁x + a₂x² + … + adxd

Coefficients minimize Σ (yi − ŷi)², solved via normal equations (XᵀX)a = Xᵀy

R² = 1 − SSres / SStot

Full Description

Polynomial regression extends linear regression by incorporating higher-order powers of x. It flexibly captures curvature in relationships at the cost of increased complexity and potential overfitting.

Choose the polynomial degree carefully and consider cross-validation or information criteria to avoid fitting noise rather than signal.

Frequently Asked Questions

How do I pick the right degree?

Start low and increase degree until residual patterns disappear. Use validation techniques to guard against overfitting.

Can I fit very high-degree polynomials?

High degrees require many data points and can suffer from numerical instability. Use with caution.

Does order of data matter?

No. The fit depends only on the set of points, not their order.

What about predictions outside the data range?

Polynomial extrapolation can behave unpredictably. Interpret predictions beyond the observed x range with care.