Core inference · Curve fitting
Quadratic Regression Calculator
Quadratic regression fits a parabola — y = ax² + bx + c — to your data by least squares, the right model when a relationship rises and then falls (or falls and then rises) rather than running straight. Paste paired x and y values for the fitted equation, R² and adjusted R², the vertex and axis of symmetry, a prediction tool and a scatter-and-curve plot — with a candid word about overfitting and why extrapolating a parabola is the quickest way to a nonsense forecast.
You need at least four points to fit and judge a quadratic. A parabola has one bend; if your data clearly bend twice, you want a higher-degree fit on the nonlinear regression page, not a quadratic.
Result
In plain English
A straight line assumes y changes by the same amount for every step in x. A parabola lets that rate of change itself change — so the curve can climb, level off and come back down, tracing a single hump or valley. Quadratic regression finds the parabola that sits closest to your points, in the least-squares sense, and is the natural model for things like a projectile’s height, a cost curve with a sweet spot, or a yield that peaks at some dose.
- quadratic regression
- Fitting y = ax² + bx + c to data by least squares — choosing a, b and c to minimise the total squared vertical distance from the points to the curve.
- the coefficient a
- Controls the curvature and direction: a > 0 opens upward (a valley, a minimum), a < 0 opens downward (a hump, a maximum). The closer a is to zero, the flatter — and the more a straight line would have done.
- vertex & axis of symmetry
- The turning point, at x = −b ∕ (2a). It is the maximum or minimum of the fitted curve, and the parabola is a mirror image either side of the vertical line through it.
- R² and adjusted R²
- The share of the variation in y the curve explains. A quadratic can never have a lower R² than a straight line on the same data — it has an extra term to play with — so adjusted R², which docks you for that term, is the fairer comparison.
- overfitting
- Adding curvature always hugs the data tighter, even when the bend is just noise. A quadratic that barely beats a line, or whose curvature has no mechanism behind it, is probably fitting noise.
- extrapolation
- Beyond the data a parabola accelerates away and eventually turns around. Predictions just outside the range can be wildly wrong — a fitted hump will happily forecast negative heights or impossible values.
Frequently asked
How do you do quadratic regression by hand?
You solve the “normal equations” — three simultaneous equations in the three unknowns a, b and c, built from sums of your data: Σx, Σx², Σx³, Σx⁴, Σy, Σxy and Σx²y. In matrix form it is a 3×3 system, X′Xβ = X′y, where each row of X is [1, x, x²]. Solving it (by elimination or with a little linear algebra) gives the least-squares coefficients. It is the same idea as fitting a straight line, just with an extra column for x², and it is exactly what this calculator does for you — along with the R², the vertex and a plot.
When should I use quadratic instead of linear regression?
Use a quadratic when the relationship genuinely turns — rises then falls, or falls then rises — or when the rate of change clearly speeds up or slows down across the range. Tell-tale signs are a linear fit whose residuals show a U or ∩ shape rather than scattering randomly, or a known mechanism with a peak or trough (a projectile’s arc, a dose with an optimal level, a cost that bottoms out). If the data simply curve gently in one direction without turning, an exponential, power or logarithmic model on the nonlinear regression page may fit better and extrapolate more sensibly than a parabola.
What do a, b and c mean in y = ax² + bx + c?
c is the y-intercept — the value of y when x = 0. a sets the curvature: positive opens the parabola upward into a valley with a minimum, negative opens it downward into a hump with a maximum, and a larger magnitude makes a tighter, steeper curve. b, together with a, fixes where the turning point sits: the vertex is at x = −b ∕ (2a). Note that unless your data straddle x = 0, the intercept c and the individual coefficients can be hard to interpret on their own — the vertex and the overall shape are usually the meaningful summaries.
Does a high R² mean the quadratic is the right model?
No. R² only measures how closely the parabola fits the data you already have, and because a quadratic has an extra term it almost always posts a higher R² than a straight line — even when the curvature is fitting random noise. Check the adjusted R² (which penalises the extra term), look at whether the residuals scatter randomly rather than showing a leftover pattern, and ask whether a parabola is mechanistically plausible. Above all, do not trust the fit outside the range of your data: a parabola curves away fast, so a model that fits beautifully from x = 0 to 10 can predict absurd values at x = 15.