Example 1 — Perfect quadratic data
Data from \(y=2x^2-3x+1\): \((0,1),(1,0),(2,3),(3,10)\). The fit returns \(a=2,\ b=-3,\ c=1\) (exact), \(R^2=1\). Vertex: \(x_v=\tfrac{3}{4}\), \(y_v=\tfrac{-7}{8}\).
Fit \(y \approx ax^2 + bx + c\) to your data. Enter X and Y lists and press Calculate.
\( \text{Model: } y \approx ax^2 + bx + c \text{ with design matrix } X=\begin{bmatrix}x_1^2&x_1&1\\ \cdots&\cdots&\cdots\\ x_n^2&x_n&1\end{bmatrix}. \)
\( \text{Normal equations: } (X^{\mathsf T}X)\,\beta = X^{\mathsf T}y,\; \beta=[a,b,c]^{\mathsf T}. \)
\( R^2 = 1-\dfrac{\text{SSE}}{\text{SST}},\; \text{SSE}=\sum(y_i-\hat y_i)^2,\; \hat y_i=ax_i^2+bx_i+c. \)
A Quadratic Regression Calculator estimates a best-fit parabola for paired data \((x_i,y_i)\) using least squares. Instead of a straight line, the model allows curvature, capturing accelerating or decelerating trends common in physics (projectiles), business (diminishing returns), biology (growth curves), and engineering. The tool returns the coefficients \(a,b,c\) in \(y=ax^2+bx+c\), reports goodness-of-fit (e.g., \(R^2\)), and highlights the vertex—the point where the fitted curve changes direction. Beyond raw numbers, it computes residuals, summarizes error (SSE, MSE), and can evaluate or forecast \(y\) at any \(x\). All steps appear clearly, with algebra shown so students can follow the derivation and practitioners can audit results.
The calculator builds the design matrix with columns \([x_i^2,\;x_i,\;1]\) and solves the normal equations for the coefficient vector. Centering/scaling options can stabilize the fit when \(x\) is large, since \(x\) and \(x^2\) are often correlated. Diagnostics include \(R^2\) for explained variance, residual summaries to spot heteroscedasticity or outliers, and the vertex \((x_v,y_v)\) for interpretation (maximum or minimum depending on the sign of \(a\)). While quadratic models are flexible, they can overfit extremes; the tool flags extrapolation beyond the observed range and encourages inspection of residual patterns to validate assumptions.
Model: \[ y = a x^2 + b x + c. \]
Matrix form (least squares): \[ \hat{\boldsymbol\beta}=\begin{bmatrix}\hat a\\ \hat b\\ \hat c\end{bmatrix} =(X^\top X)^{-1}X^\top \mathbf{y},\quad X=\begin{bmatrix} x_1^2 & x_1 & 1\\ \vdots & \vdots & \vdots\\ x_n^2 & x_n & 1 \end{bmatrix}. \]
Normal equations (summation form): \[ \begin{bmatrix} \sum x_i^4 & \sum x_i^3 & \sum x_i^2\\ \sum x_i^3 & \sum x_i^2 & \sum x_i\\ \sum x_i^2 & \sum x_i & n \end{bmatrix} \begin{bmatrix} a\\ b\\ c\end{bmatrix} = \begin{bmatrix} \sum x_i^2 y_i\\ \sum x_i y_i\\ \sum y_i \end{bmatrix}. \]
Predictions & residuals: \[ \hat y_i = a x_i^2 + b x_i + c,\qquad r_i = y_i-\hat y_i. \]
SSE, MSE, and \(R^2\): \[ \mathrm{SSE}=\sum r_i^2,\quad \mathrm{MSE}=\frac{\mathrm{SSE}}{n-3},\quad R^2=1-\frac{\sum r_i^2}{\sum (y_i-\bar y)^2}. \]
Vertex of the parabola: \[ x_v=-\frac{b}{2a},\qquad y_v = c - \frac{b^2}{4a}. \]
Data from \(y=2x^2-3x+1\): \((0,1),(1,0),(2,3),(3,10)\). The fit returns \(a=2,\ b=-3,\ c=1\) (exact), \(R^2=1\). Vertex: \(x_v=\tfrac{3}{4}\), \(y_v=\tfrac{-7}{8}\).
\((0,1.1),(1,2.9),(2,9.2),(3,18.8),(4,32.1)\). The model yields coefficients near \(a\approx2,\ b\approx-1,\ c\approx1\) with \(R^2\) high; residuals look random—fit is adequate.
With \(a,b,c\) from your dataset, predict \(\hat y(5)=a\cdot25+b\cdot5+c\). Use the vertex to reason about maxima/minima when planning operating points.
When residuals from a line show curvature or theory suggests accelerating/decelerating change with \(x\).
It’s the fitted maximum/minimum. If \(a<0\) it’s a peak; if \(a>0\) it’s a trough.
It indicates explained variance, but check residuals and beware of overfitting or extrapolation beyond observed \(x\).
At least three noncollinear points; more data improves stability and allows error estimation (\(\mathrm{MSE}\)).
Large \(x\) values cause collinearity between \(x\) and \(x^2\). Try centering/scaling \(x\).
Yes—use transformed variables or constrained fitting; the calculator can expose these options if needed.