Quartic Regression Calculator

Quick answer

The quartic regression calculator fits a fourth-degree polynomial y = a₄x⁴ + a₃x³ + a₂x² + a₁x + a₀ to at least five data points. It shows the equation, all five coefficients with t-tests, R² and adjusted R², the residuals, a chart and a predicted value.

Same number of values as x

Optional – leave empty to skip the prediction

Regression equation
y = 1.008x⁴ − 0.02462x³ − 5.062x² + 0.08631x + 4.044
Scatter plot with the fitted curve
Coefficient a₄ (x⁴)
1.00779
Coefficient a₃ (x³)
-0.024621
Coefficient a₂ (x²)
-5.062162
Coefficient a₁ (x)
0.086308
Coefficient a₀ (constant term)
4.044285
Coefficient of determination (R²)
0.99939
Adjusted R²
0.99858
Residual standard error
0.67246
Overall F-test
F(4, 3) = 1,230.1502, p < 0.0001
Predicted y at the chosen x
-2.19728
95% prediction interval for a new y
−4.7893 to 0.3948
95% confidence interval for the mean y
−3.6598 to −0.7348
Interpolation or extrapolation?
x = 1.5 lies inside the data range (−3 to 3) – an interpolation.
Coefficients with standard errors and t-tests
Term Coefficient Std. error t p-value ────────────────────────────────────────────────────────────── Intercept (a₀) 4.044 0.4954 8.163 0.0038 x (a₁) 0.08631 0.3357 0.257 0.8137 x² (a₂) −5.062 0.2835 −17.855 0.0004 x³ (a₃) −0.02462 0.04553 −0.541 0.6263 x⁴ (a₄) 1.008 0.02925 34.456 < 0.0001
Fitted values and residuals
# x y ŷ (fitted) Residual y − ŷ Standardised ─────────────────────────────────────────────────────────── 1 −3 40.6 40.521687 0.078313 0.116 2 −2 −0.4 −0.055366 −0.344634 −0.512 3 −1 0.5 −0.071774 0.571774 0.85 4 0 3.6 4.044285 −0.444285 −0.661 5 1 0.3 0.0516 0.2484 0.369 6 2 −0.6 −0.104072 −0.495928 −0.737 7 2.5 12.2 11.603646 0.596354 0.887 8 3 39.5 39.709995 −0.209995 −0.312
Sum of squared residuals (SSE)
1.3566
Number of points
8

A quartic (fourth-order) polynomial can turn three times, so it can describe W- and M-shaped patterns: a double-humped response, a potential-energy curve with two wells, or seasonal data with two peaks within the range you measured. Quartic regression finds the five coefficients that minimise the squared differences between your y values and the curve.

That flexibility is both the strength and the danger of the model. With five coefficients the curve can chase random noise, so a quartic should be backed by a reason, such as theory or a clear pattern left behind by a cubic fit. The coefficient table helps here: if the x⁴ term has a large p-value, the simpler cubic is the better choice. Adjusted R² penalises the extra parameter and is the fairer way to compare models of different degree.

You need at least five distinct x values; exactly five make the curve pass through every point, leaving no degrees of freedom to estimate error. The more points beyond five you have, the more the R² and the standard errors mean.

How to use the Quartic Regression Calculator

  1. x values
  2. y values: Same number of values as x
  3. Predict y at x =: Optional, leave empty to skip the prediction
  4. Precision (significant figures)

Everything is calculated in your browser, so results appear instantly and nothing you type is sent to a server.

How it works

The calculator uses the columns 1, x, x², x³ and x⁴ in the normal equations, centres and scales x to keep the 5 × 5 system well conditioned, solves it, converts back to raw powers of x and reports the fit statistics with n − 5 degrees of freedom.

Worked example

Eight points from a W-shaped relationship: x = −3, −2, −1, 0, 1, 2, 2.5, 3 with y = 40.6, −0.4, 0.5, 3.6, 0.3, −0.6, 12.2, 39.5. The quartic fit is y = 1.008x⁴ − 0.02462x³ − 5.062x² + 0.08631x + 4.044 with R² = 0.99939 and adjusted R² = 0.99858. The x⁴ and x² terms are highly significant (p < 0.001), while the x³ and x terms are not (p = 0.63 and 0.81), so the curve is essentially symmetric, close to x⁴ − 5x² + 4. At x = 1.5 the model predicts −2.20.

Signs of overfitting

  • R² barely improves over the cubic while adjusted R² falls.
  • Coefficient p-values are large and standard errors exceed the coefficients.
  • The curve swings sharply between neighbouring points.
  • Predictions just outside the data are implausible.

Formula

Minimise Σ(y − a₀ − a₁x − a₂x² − a₃x³ − a₄x⁴)² · 5 × 5 normal equations (XᵀX)β = Xᵀy

Worked example

Inputs: x values: -3, -2, -1, 0, 1, 2, 2.5, 3; y values: 40.6, -0.4, 0.5, 3.6, 0.3, -0.6, 12.2, 39.5; Predict y at x =: 1.5; Precision (significant figures): 4.
Results: Regression equation = y = 1.008x⁴ − 0.02462x³ − 5.062x² + 0.08631x + 4.044; Coefficient a₄ (x⁴) = 1.00779; Coefficient a₃ (x³) = -0.024621; Coefficient a₂ (x²) = -5.062162; Coefficient a₁ (x) = 0.086308; Coefficient a₀ (constant term) = 4.044285.

Key terms

Quartic
A polynomial of degree four.
Overfitting
A model so flexible that it follows random noise rather than the underlying trend.
Turning point
A local maximum or minimum of the curve.
Residual standard error
√(SSE ÷ (n − 5)) for a quartic, the typical scatter around the curve.

Frequently asked questions

What is a quartic function?

A polynomial of degree four: y = a₄x⁴ + a₃x³ + a₂x² + a₁x + a₀. Its graph can have up to three turning points.

How many data points does quartic regression need?

At least five distinct x values; use well over five so the fit can be judged.

Why does my quartic fit look wild between points?

High-degree polynomials can oscillate when points are unevenly spaced. Add points in the gaps or use a lower degree.

Should I use quartic or cubic regression?

Fit both and compare adjusted R² and the p-value of the x⁴ coefficient. Keep the simpler model unless the quartic term is clearly significant.

Can the quartic model be used for forecasting?

Not far beyond the data, as the x⁴ term grows very fast and dominates any extrapolation.

What does R² = 1 mean here?

Usually that you entered exactly five points, so the curve interpolates them exactly. It says nothing about predictive quality.

Sources

  1. Penn State STAT 462: Applied Regression Analysis
  2. NIST/SEMATECH e-Handbook of Statistical Methods

Cite this calculator

Speedy Calculator. (2026). Quartic Regression Calculator. Speedy Calculator. https://speedycalculator.com/calculators/statistics/quartic-regression/