Quadratic Regression Calculator

Quadratic Regression Calculator

Fit the best parabola y = ax² + bx + c to your data, with R², the vertex (the peak or trough), a chart and predictions at any X.

y = ax² + bx + c · vertex at x = −b ÷ 2a

Enter at least 3 pairs of X and Y values

What is Quadratic Regression?

Quadratic regression fits a parabola, y = ax² + bx + c, through data that rises then falls, or falls then rises. It picks a, b and c to make the squared vertical distances from the points to the curve as small as possible.

It's the natural model for anything with a single peak or trough: the height of a thrown ball, crop yield against fertiliser (too little and too much both hurt), or a car's fuel use against speed.

The vertex is often the answer people want: the best dose, the top of the flight, the cheapest production level. The sign of a says which: negative a gives a peak, positive a a trough.

Quadratic Regression Formula

Least squares as in the NIST/SEMATECH e-Handbook, section 4.4.3. See Sources.

1. Minimise the squared errors

Choose a, b, c to minimise Σ(y − ax² − bx − c)²

2. Solve the normal equations

Σy = aΣx² + bΣx + cn
Σxy = aΣx³ + bΣx² + cΣx
Σx²y = aΣx⁴ + bΣx³ + cΣx²

3. Vertex and fit

Vertex x = −b ÷ 2a
R² = 1 − SSE ÷ SST · RSE = √(SSE ÷ (n − 3))

Worked Example: The Height of a Thrown Ball

Given:
A ball's height in metres every half second: times 0, 0.5, 1, 1.5, 2, 2.5, 3, heights 1.5, 11.8, 19.6, 24.8, 27.6, 27.9, 25.3.
Step 1:
Fit the parabola:
y = −5.086t² + 23.229t + 1.471
Step 2:
Vertex:
t = −b ÷ 2a = 2.284 s · height 28 m
Step 3:
Physics check:
a = −½g → g ≈ 10.17 m/s² (true value 9.81)
Result:
Peak of 28 m at 2.28 s

R² = 0.9999: the parabola fits almost perfectly, and the curvature recovers gravity to within a few percent despite rough measurements.

Observed Against Fitted Heights

Small residuals scattered either side of zero are the sign of a good fit.

Observed, fitted and residual heights
Time (s)ObservedFittedResidual
01.51.470.03
0.511.811.81-0.01
119.619.61-0.01
1.524.824.87-0.07
227.627.590.01
2.527.927.760.14
325.325.39-0.09

Common Quadratic Regression Mistakes

  • Extrapolating far beyond the data. Parabolas turn sharply. Predicting the ball's height at 10 seconds gives a large negative number.
  • Fitting a curve because R² went up. Adding the x² term always raises R². Only keep it if the curvature is real and makes sense.
  • Trusting a vertex outside the data. If the fitted peak lies beyond your X range, the data don't actually show a peak.
  • Using it for growth that keeps accelerating. Compounding growth is exponential, not quadratic.

Quadratic Regression FAQs

How many points do I need?

At least 3 different X values. With exactly 3 the parabola passes through every point; more points are needed to judge the fit.

What does the sign of a tell me?

Negative a opens downwards with a peak; positive a opens upwards with a trough.

Is quadratic regression still linear regression?

Technically yes: it’s linear in the coefficients a, b and c, so the same least-squares maths applies.

How do I do this in Excel?

Add a polynomial trendline of order 2 to a scatter chart, or use =LINEST(y, x^{1,2}).

How do I find where the curve crosses zero?

Solve ax² + bx + c = 0 with the quadratic formula using the fitted coefficients.

When should I use a cubic instead?

When the data bend twice, such as rising, levelling and rising again. The cubic regression calculator handles that.

What is RSE?

The residual standard error: a typical distance between the points and the curve, in the same units as Y.

Can I predict outside my data?

You can, but treat it cautiously. Close to the data range is usually fine; far away, the curve shape dominates.

Sources

Related Tools