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.
Polynomial model
y = 0.9365 + 0.8995·x + 1.5556·x^2 + -0.0741·x^3
R² = 0.9988
| x | Actual y | Predicted y | Residual |
|---|---|---|---|
| 0 | 1.0000 | 0.9365 | 0.0635 |
| 1 | 3.0000 | 3.3175 | -0.3175 |
| 2 | 9.0000 | 8.3651 | 0.6349 |
| 3 | 15.0000 | 15.6349 | -0.6349 |
| 4 | 25.0000 | 24.6825 | 0.3175 |
| 5 | 35.0000 | 35.0635 | -0.0635 |
How to Use This Calculator
- Enter paired x and y observations.
- Select the polynomial degree to match the level of curvature you wish to capture.
- Review the fitted equation and R² to understand model fit.
- 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.