keisoku

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

xyx = 1, y = 3x = 2, y = 5x = 3, y = 9x = 4, y = 17x = 5, y = 27x = 6, y = 41

Data points and predictions

xObserved yPredictedResidual
133.1429-0.1429
254.68570.3143
399.2286-0.2286
41716.77140.2286
52727.3143-0.3143
64140.85710.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

  1. Home
  2. Quadratic Regression Calculator (Least Squares)