Quadratic Regression Calculator (Least Squares)
Fit a quadratic regression y=a+bx+cx² to your (x, y) data points by least squares. Get the coefficients, R², and the parabola vertex, with a scatter plot and fitted curve.
Input
Enter your (x, y) data points to fit the quadratic regression y = a + bx + cx² by least squares.
One point per line. Separate x and y with a comma or a space (e.g. 1, 3). At least 3 points are required.
Result
Quadratic regression equation
y = 4.6 − 2.9571x + 1.5x²
Constant a
4.6
Linear term b
-2.957143
Quadratic term c
1.5
R squared
0.9997
Data points
6
Vertex
(0.9857, 3.1426)
The quadratic coefficient is positive, so the parabola opens upward and the vertex is a minimum.
Scatter plot and fitted curve
Data points and predictions
| x | Observed y | Predicted | Residual |
|---|---|---|---|
| 1 | 3 | 3.1429 | -0.1429 |
| 2 | 5 | 4.6857 | 0.3143 |
| 3 | 9 | 9.2286 | -0.2286 |
| 4 | 17 | 16.7714 | 0.2286 |
| 5 | 27 | 27.3143 | -0.3143 |
| 6 | 41 | 40.8571 | 0.1429 |
How it works
- Quadratic regression fits the second-degree model y=a+bx+cx² to your (x, y) data points. The coefficients a, b, and c are chosen by least squares so that the sum of the squared residuals (the gaps between observed and predicted values) is as small as possible.
- The tool builds the normal equations, a system of three linear equations, and solves them with Gaussian elimination using partial pivoting to obtain a, b, and c. At least three data points are required.
- The coefficient of determination R² measures how well the model explains the variation in the data, on a scale from 0 to 1. Values closer to 1 indicate a better fit.
- The parabola vertex is found by solving dy/dx=b+2cx=0, giving x=−b÷(2c). When the quadratic coefficient c is positive the curve opens upward and has a minimum; when c is negative it opens downward and has a maximum.
- Enter one point per line with x and y separated by a comma or a space. The table also lists the predicted value and residual for each point.
Reviews
Tell us what you think of this calculator.
Write a review
- Home
Quadratic Regression Calculator (Least Squares)