What polynomial regression does
Polynomial regression fits a curve of the form y = a₀ + a₁x + a₂x² + … + aₙxⁿ to a set of observed (x, y) points. It is an extension of simple linear regression: instead of forcing a straight line through the data, it allows the relationship to bend. A degree-1 polynomial is an ordinary straight line, degree 2 is a parabola, degree 3 (cubic) can have one inflection, and higher degrees can follow more wiggles. The calculator above finds the coefficients that best fit your data and reports the R² goodness of fit.
How the coefficients are found
The fit uses ordinary least squares: it chooses the coefficients that minimize the sum of squared vertical residuals, Σ(yᵢ − ŷᵢ)². Although the curve is nonlinear in x, it is linear in the coefficients, so the solution comes from a system of linear equations called the normal equations. For a degree-n fit you build an (n+1)×(n+1) matrix from the sums Σxᵏ (for k up to 2n) and a right-hand side from the sums Σyxᵏ, then solve for the coefficient vector. This calculator solves that system by Gaussian elimination with partial pivoting, the same result you would get from a spreadsheet's LINEST or NumPy's polyfit.
Reading R²
R² = 1 − SSres/SStot, where SSres = Σ(yᵢ − ŷᵢ)² is the leftover error and SStot = Σ(yᵢ − ȳ)² is the total variance around the mean. R² of 1 means the curve passes through every point; 0 means it does no better than a flat line at the average. A key caveat: adding degree can only raise R², never lower it, so a high R² from a degree-5 fit on six points is meaningless — it is interpolating, not modeling.
When to use it
Polynomial regression is useful when a scatter plot shows clear curvature: an object's height under gravity (quadratic in time), a dose–response curve that levels off, a cost curve with diminishing returns, or a calibration curve for an instrument. It is a poor choice for extrapolation — polynomials shoot off to ±∞ outside the data range — and for data that is genuinely linear or better described by an exponential, logarithmic, or logistic model.