STATISTICSInference & TestsStatistics Calculator
📊

Polynomial Regression Calculator

Free polynomial regression calculator. Fit degree 1–6 polynomials. R², adjusted R², AIC, BIC for mod

Run CalculatorExplore data analysis and statistical calculations

Why This Statistical Analysis Matters

Why: Statistical calculator for analysis.

How: Enter inputs and compute results.

y=xᵏ
REGRESSION2026

Polynomial Regression — Model Comparison

Fit degree 1–6 polynomials. Compare R², adjusted R², AIC, BIC. Select best model. View residuals and turning points.

Real-World Scenarios — Click to Load

Paste from Clipboard

xy
Warning: Degree approaches n. Risk of overfitting. Consider using fewer degrees or more data.
poly_regression_results.sh
CALCULATED
$ poly_reg --degree=3 --max_degree=6
Degree
3
1.0000
Adj R²
1.0000
Turning Points
None
Coefficients:
β0=1.0000 β1=0.0000 β2=1.0000 β3=0.0000
Share:
Polynomial Regression Result
Degree 3 Fit
R² = 1.000
Adj R² = 1.000AIC = -InfinityBIC = -InfinityTurning pts: 0
numbervibe.com/calculators/statistics/polynomial-regression-calculator

Scatter with Polynomial Curve (Degree 3)

R² / Adjusted R² / AIC by Degree

Residuals (Degree 3)

Calculation Breakdown

MODEL
Vandermonde matrix
X_ij = x_i^j
Build X where each row is [1, x, x², ..., x^3]
FITTING
Normal equations
(X'X)β = X'y
ext{Solve} ext{for} ext{coefficient} ext{vector} \text{beta}
Coefficients β
β0=1.0000, β1=0.0000, β2=1.0000, β3=0.0000
y = β₀ + β₁x + ... + β3x^3
GOODNESS OF FIT
1.0000
R^{2} = 1 - SS_res/SS_tot
Adjusted R²
1.0000
R²_adj = 1 − (1−R²)(n−1)/(n−4)
AIC
-Infinity
ext{AIC} = n cdot \text{ln}(SS_res/n) + 2(k+1)
BIC
-Infinity
ext{BIC} = n cdot \text{ln}(SS_res/n) + \text{ln}(n)(k+1)
DIAGNOSTICS
Turning points
None
ext{Roots} ext{of} ext{derivative} p'(x)=0

Model Comparison

DegreeAdj R²AICBICBest
10.95520.946321.3921.29
21.00001.0000-Infinity-InfinityAIC & BIC
31.00001.0000-Infinity-Infinity
41.00001.0000-Infinity-Infinity
51.00001.0000-345.89-346.21
61.00000.0000-Infinity-Infinity

For educational and informational purposes only. Verify with a qualified professional.

Key Takeaways

  • Model: y = β₀ + β₁x + β₂x² + ... + βₖxᵏ (degree k). Vandermonde matrix X: Xᵢⱼ = xᵢʲ.
  • Normal equations: β = (X'X)⁻¹X'y. Solve via least squares.
  • = 1 − SS_res/SS_tot. Adjusted R² = 1 − (1−R²)(n−1)/(n−k−1).
  • AIC = n×ln(SS_res/n) + 2(k+1). BIC = n×ln(SS_res/n) + ln(n)(k+1). Lower is better.
  • Best degree: Minimize AIC or BIC to balance fit vs complexity.
  • Overfitting: If adjusted R² decreases or degree approaches n, simplify.
  • Turning points: Roots of derivative p'(x)=0 indicate local minima/maxima.

Did You Know?

📈Polynomial regression can fit any smooth curve, but higher degrees risk overfitting.Source: Modeling
📊AIC and BIC penalize model complexity. BIC favors simpler models more than AIC.Source: Model Selection
🧪Chemical kinetics and temperature curves often need cubic or quartic terms.Source: Chemistry
📐The Vandermonde matrix becomes ill-conditioned for high degrees. Use orthogonal polynomials in practice.Source: Numerical Methods
📱User engagement and sales curves often show polynomial trends with plateaus.Source: Product Analytics
🌡️Climate data over decades can be modeled with polynomial trends to capture acceleration.Source: Climate Science

How Polynomial Regression Works

1. Vandermonde matrix

Build X where Xᵢⱼ = xᵢʲ. Each row is [1, xᵢ, xᵢ², ..., xᵢᵏ].

2. Normal equations

Solve (X'X)β = X'y. β contains the polynomial coefficients.

3. R² and adjusted R²

R² = 1 − SS_res/SS_tot. Adjusted R² penalizes extra parameters.

4. AIC and BIC

AIC = n×ln(SS_res/n) + 2(k+1). BIC adds ln(n) factor. Choose degree that minimizes these.

5. Prediction and residuals

ŷ = β₀ + β₁x + ... + βₖxᵏ. Residuals: eᵢ = yᵢ − ŷᵢ.

6. Turning points

Solve p'(x)=0 for roots. Degree k polynomial has at most k−1 turning points.

Expert Tips

Minimum sample size

Use at least k+2 points for degree k. More points reduce overfitting.

Check residuals

Residuals should be random. Patterns suggest a different model.

Prefer AIC/BIC

R² always increases with degree. Use AIC or BIC to choose the best model.

Avoid extrapolation

Polynomials can diverge wildly outside the data range.

Degree Comparison

DegreeParametersBest For
1 (Linear)2Straight-line relationships
2 (Quadratic)3Parabolic curves, one hump/valley
3 (Cubic)4S-curves, two turning points
45More complex curvature
56Highly flexible curves
67Maximum flexibility (risk overfitting)

When to Use Polynomial vs Linear Regression

ScenarioUse
Straight-line relationshipLinear (degree 1)
U-shape, one hump/valleyQuadratic (degree 2)
S-curve, two turning pointsCubic (degree 3)
Complex curvature, inflectionQuartic or higher
Plateau or saturationConsider exponential/logistic instead

Frequently Asked Questions

When should I use polynomial vs linear regression?

Use polynomial when the relationship shows curvature (U-shape, S-curve, plateau). Linear is for roughly straight-line relationships.

What is the best degree?

Minimize AIC or BIC. If adjusted R² decreases with higher degree, use the simpler model.

What does overfitting mean?

The model fits noise instead of signal. High R² but poor predictions on new data. Use AIC/BIC and residual plots.

Can I extrapolate with polynomial regression?

Cautiously. Polynomials can diverge quickly outside the data range. Prefer interpolation.

Why does R² always increase with degree?

More parameters allow a tighter fit. Adjusted R², AIC, and BIC penalize complexity to avoid overfitting.

What are turning points?

Points where the curve changes direction (local min/max). A degree-k polynomial has at most k−1 turning points.

Polynomial Regression by the Numbers

1–6
Degree range
Fit quality
AIC/BIC
Model selection
n≥k+2
Min points

Disclaimer: Polynomial regression can overfit with few points or high degree. Use AIC/BIC and adjusted R² for model selection. Avoid extrapolation outside the data range.

👈 START HERE
⬅️Jump in and explore the concept!
AI

Related Calculators