Polynomial Regression Calculator
Least-squares polynomial regression (degree 1 to 6) solved exactly through the normal equations with partial pivoting; reports ascending-power coefficients and R².
Description
Fit a least-squares polynomial of degree one through six and report coefficients and R squared.
Polynomial regression models curvature by adding powers of one predictor. It can summarize smooth nonlinear patterns on a bounded range and demonstrate how degree changes fit complexity.
When to use Polynomial Regression Calculator
- Fit a quadratic or other low-degree curve
- Recover coefficients from well-scaled sample data
- Compare polynomial degrees on the same paired observations
How the calculation works
A Vandermonde design forms the normal equations, which are solved by Gauss-Jordan elimination with partial pivoting. Coefficients are returned in ascending power order: constant, x, x², and so forth.
ŷ = c₀ + c₁x + c₂x² + … + c_d x^d Interpreting the result
Evaluate coefficients with the shown power order. R² describes in-sample fit and normally rises as terms are added; that does not prove the higher-degree model generalizes better.
Important limitations
- Normal equations can be numerically unstable for large or poorly scaled x values.
- At least degree + 1 suitably distinct points are needed.
- High-degree extrapolation can diverge rapidly outside the observed x range.