How this calculator works
Choose a degree from one to eight and fit all powers through that degree, including the intercept. Householder QR works on a centred, scaled predictor rather than solving normal equations. A unique fit requires at least degree + 1 distinct, well-spaced x values. Higher degree can reduce training error while worsening prediction.
Formula
ŷ = Σ(j = 0 to d) bj x^j; minimise Σ(y - ŷ)²; residual df = n - d - 1.
Worked example
For x = -2, -1, 0, 1, 2 and y = 16, 1, 0, 1, 16, degree 4 recovers y = x⁴ and predicts 81 at x = 3.
Advertisement
Frequently asked questions
How should I choose degree?
Use subject knowledge and validation on new data. A larger training R squared alone does not justify extra terms.
What order are coefficients shown in?
b0 is the intercept, b1 multiplies x, b2 multiplies x squared, and so on.
Why reject nearly singular data?
Repeated or tightly clustered predictor values can make high-degree coefficients numerically indeterminate.