Polynomial Regression Calculator
Fit linear through sextic polynomial regression models to data points with R-squared and coefficient display.
What Is Polynomial Regression?
Polynomial regression fits a curved relationship between an independent variable $x$ and a dependent variable $y$ using a polynomial of chosen degree. Degree 1 is linear regression; higher degrees capture bends and peaks. See also the Linear Regression Calculator and Exponential Regression Calculator.
Polynomial Regression Equation
$$y = a_0 + a_1 x + a_2 x^2 + \cdots + a_n x^n$$
Coefficients are found by least squares: minimize the sum of squared residuals between observed and predicted $y$ values. You need at least $n + 1$ points to fit a degree-$n$ model.
Interpreting R²
The coefficient of determination $R^2$ measures how much variation in $y$ is explained by the polynomial model. Values closer to 1 indicate a better fit, but very high-degree models can overfit small datasets.
Frequently Asked Questions
How many points do I need?
You need at least one more point than the polynomial degree. For a cubic model (degree 3), enter at least 4 (x, y) pairs.
Is polynomial regression linear?
Yes in the statistical sense: the model is linear in the coefficients even though the curve itself can be nonlinear in $x$.
What if the fit fails?
A singular matrix usually means duplicate x values, too few points, or a degree that is too high for your data.
Which degree should I choose?
Start with degree 2 or 3 for smooth curves. Increase the degree only when a simpler model clearly underfits.