Skip to content
MoneyDeck

Quadratic Regression Calculator

Fit a best-fit parabola y = ax² + bx + c and see how well it fits

Updated · Free, no signup

Separate with commas, spaces or new lines.

Same number of values, in the same order as x.

Best-fit equation

y = -4.154762x² + 25.607143x + 2.190476

a (x² coefficient)

-4.154762

b (x coefficient)

25.607143

c (intercept)

2.190476

R²

0.999252

Adjusted R²

0.998878

Standard error of the fit

0.5233

Vertex x (−b / 2a)

3.0817

Vertex y

41.6468

Predicted y at chosen x

40.2411

Data points (n)

7

  • The parabola opens downward, so its maximum is y ≈ 41.6468 at x ≈ 3.0817.
  • R² = 0.9993: the quadratic explains 99.93% of the variation in y.

Data and fitted parabola

Fitted values and residuals

xyFitted ŷResidual y − ŷ
022.190476-0.190476
12423.6428570.357143
23736.7857140.214286
34141.619048-0.619048
43838.142857-0.142857
52726.3571430.642857
666.261905-0.261905

About the Quadratic Regression Calculator

This quadratic regression calculator fits the parabola y = ax² + bx + c that best matches your data using the method of least squares. Paste your x values and y values (same order, same count) and it returns the coefficients a, b and c, the coefficient of determination R², the adjusted R², the standard error of the fit, the vertex (the turning point of the curve) and a predicted y for any x you choose.

Quadratic models suit data that rise and then fall, or fall and then rise: projectile height over time, profit as a function of price, crop yield against fertilizer, fuel economy against speed, or the stopping distance of a car. Students use it to check graphing-calculator QuadReg output; analysts use it to find the optimum of a curved relationship. The chart overlays the fitted curve on your data so you can judge the fit at a glance.

You need at least three points with at least three distinct x values. R² is computed as 1 − SSE/SST on the original y values. A high R² does not prove the relationship is truly quadratic, and predictions far outside the range of your x data can be unreliable because the parabola keeps curving.

How to use the quadratic regression calculator

  1. 1Paste your x values into the first box.
  2. 2Paste the matching y values into the second box, in the same order.
  3. 3Optionally enter an x value to predict.
  4. 4Read the best-fit equation, the coefficients and R².
  5. 5Check the vertex for the maximum or minimum, and the chart to judge the fit.

Formula and method

ŷ = a·x² + b·x + c
Normal equations:
Σy = c·n + b·Σx + a·Σx²
Σxy = c·Σx + b·Σx² + a·Σx³
Σx²y = c·Σx² + b·Σx³ + a·Σx⁴
R² = 1 − Σ(y − ŷ)² / Σ(y − ȳ)²

Least squares chooses a, b and c to minimise the sum of squared vertical distances between the data and the curve. Setting the partial derivatives of that sum to zero gives three linear "normal equations" in a, b and c, built from sums of powers of x up to x⁴. The calculator centres and scales x before solving them with Gaussian elimination, which avoids rounding problems when x values are large (such as years), and then converts the coefficients back to the original x.

R² is the share of the total variation in y explained by the curve. Adjusted R² and the standard error use n − 3 degrees of freedom because three parameters are estimated. The vertex at x = −b/(2a) is the maximum when a < 0 and the minimum when a > 0.

a, b, c
Fitted coefficients of x², x and the constant
n
Number of data points
ŷ
Value predicted by the fitted curve
ȳ
Mean of the observed y values
R²
Coefficient of determination

Worked examples

Ball height over time

Solving the normal equations for these seven points gives y ≈ −4.1548x² + 25.6071x + 2.1905. The negative a means the curve opens downward; the peak height of about 41.65 occurs at x ≈ 3.08, the curve explains 99.93% of the variation, and at x = 2.5 it predicts a height of about 40.24.

Exact parabola y = 2x² − 3x + 1

All six points lie exactly on y = 2x² − 3x + 1, so least squares recovers a = 2, b = −3, c = 1 with R² = 1. The minimum is at x = 3/4 with y = −0.125, and at x = 4 the curve predicts 2(16) − 12 + 1 = 21.

Fuel economy vs speed

The fit is mpg ≈ −0.011607·speed² + 1.213929·speed − 1.9357. Fuel economy peaks at about 29.8 mpg near 52.3 mph and falls off on both sides; R² ≈ 0.998 shows the parabola describes the pattern well, and at 55 mph it predicts about 29.7 mpg.

Frequently asked questions

What is quadratic regression?+

Quadratic regression fits a second-degree polynomial, y = ax² + bx + c, to a set of points by least squares. It captures curved relationships with one bend, such as a rise followed by a fall, that a straight line cannot.

How many points do I need for quadratic regression?+

At least three points with three different x values. With exactly three the parabola passes through every point and R² is 1, so you need more points to judge how well a quadratic really fits.

How do I know whether a quadratic fits better than a line?+

Compare adjusted R² and the residual pattern with a linear fit. If the linear residuals form a U or an arch and the quadratic raises adjusted R² noticeably, the curvature is real. Also check whether a turning point makes sense for your data.

What does the vertex tell me?+

The vertex at x = −b/(2a) is where the fitted curve reaches its maximum (when a is negative) or minimum (when a is positive). It is often the answer you want, such as the price that maximises profit or the speed that maximises fuel economy.

Is this the same as QuadReg on a TI-84?+

Yes. QuadReg on TI calculators uses the same least-squares method, so the coefficients a, b, c and R² should match what this calculator reports for the same data.

Related tools