ThisCalculator

Everyday

Desmos Quadratic Regression Calculator: How It Works

Updated · Standard formula, shown below

Desmos Quadratic Regression Calculator: How It Works

Desmos can fit a quadratic regression model to paired data and display the estimated equation and its graph. Enter your observed x- and y-values in a table, then use the regression operator in an expression; the fitted coefficients describe the parabola that best matches the data by least squares.

What quadratic regression in Desmos does

Quadratic regression finds a curve of the form y = ax² + bx + c that approximates a set of measured points. It is useful when a scatterplot suggests a curved, roughly parabolic relationship, such as the height of a tossed object over time or an experimentally measured trend that bends upward or downward.

The word “best” has a specific meaning here: ordinary least-squares regression chooses coefficient values that minimize the sum of the squared vertical residuals. A residual is the observed y-value minus the y-value predicted by the model at the same x. The calculation does not prove that the relationship is truly quadratic, nor does it establish a cause-and-effect relationship.

How to enter the data and fit the model

  1. Open a Desmos graphing calculator and add a table using the expression list’s table control.
  2. Put the x-values in the first column and the corresponding observed y-values in the second. Each row should represent one paired observation.
  3. In a new expression line, type y_1 ~ a x_1^2 + b x_1 + c. The tilde indicates a regression fit rather than an ordinary equation to graph. Desmos uses the table columns as lists, and the letters a, b, and c are fitted parameters.
  4. Read the resulting parameter estimates and graph the model by entering y = a x^2 + b x + c on another line. The fitted curve can then be compared visually with the data points.

Use the same subscripts that Desmos assigns to the table columns. If the table is named differently or has additional columns, check the displayed column labels and update the expression accordingly. A regression expression and a graphing expression serve different purposes: the tilde expression estimates the coefficients from data; the equals expression draws the resulting curve.

Reading the fitted equation

In y = ax² + bx + c, a controls curvature, b affects the curve’s horizontal placement and slope, and c is the predicted y-value when x equals zero. If a is positive, the parabola opens upward; if it is negative, it opens downward. A value of a close to zero can indicate that the fitted curve is nearly linear over the observed range.

The vertex, or turning point, occurs at x = −b/(2a), with its y-coordinate found by substituting that x-value into the fitted equation. This can be useful for estimating a maximum or minimum, but only when the fitted parabola is a reasonable model near that point. A vertex far beyond the observed data range is an extrapolation, not a directly supported measurement.

Coefficient units depend on the units of the data. If x is measured in seconds and y in metres, then a has units of metres per second squared, b has units of metres per second, and c has units of metres. Changing the scale or units of x changes the numerical coefficients, even when the underlying relationship is equivalent.

A concrete example

Suppose a small dataset records an object’s height at times 0, 1, 2, and 3 seconds, with heights 1, 4, 5, and 4 metres. Enter those pairs into the table. The quadratic y = −x² + 4x + 1 passes through all four points, so the regression returns coefficients a = −1, b = 4, and c = 1.

The model opens downward and has its vertex at x = −4/(2 × −1) = 2 seconds. Substitution gives y = −(2²) + 4(2) + 1 = 5 metres. This example is exact by construction; real measurements usually do not sit perfectly on one parabola, and the fit will typically leave nonzero residuals.

Fit quality, assumptions, and common problems

A pleasing curve is not enough to establish that a model is useful. Compare the predicted values with the observations and inspect residuals: a systematic pattern, such as residuals that are mostly positive at both ends and negative in the middle, may indicate that a quadratic model misses important structure. Desmos can help visualize the fit, but interpretation still depends on the data and the question.

  • Keep pairs aligned: an x-value must stay in the same row as its corresponding y-value. Missing or shifted entries can produce a fit to unintended pairs.
  • Use the regression symbol: typing an equals sign in place of the tilde sets up an equation, not a least-squares fit to the table.
  • Check the data range: a quadratic may describe the observed interval but behave implausibly outside it. Avoid treating distant predictions as reliable without supporting evidence.
  • Check for influential points: an unusual observation can substantially change a least-squares fit, especially in a small dataset. Verify suspected data-entry errors rather than deleting a point merely because it disagrees.
  • Use enough distinct x-values: three parameters must be estimated. With too few distinct x-values, the model may be underdetermined; repeated x-values alone do not supply the missing range of information.

Quadratic regression also assumes that the chosen response is modeled as a quadratic function of the predictor and minimizes vertical errors in y. It does not minimize distances perpendicular to the curve. If measurement uncertainty is substantial in x as well as y, or if observations have different reliability, ordinary least squares may not match the analysis needed.

Desmos versus a manually calculated fit

For a small dataset, Desmos offers a quick visual workflow: enter points, fit coefficients, and see the curve on the same graph. That makes it convenient for exploration and classroom work. A spreadsheet or statistics program may be more suitable when a project requires reproducible reports, residual tables, confidence intervals, weighting, or more extensive data management. The underlying least-squares idea is the same when the same model and assumptions are used.

Do not choose a quadratic only because it has a higher fit score than a straight line. Adding a parameter can improve the fit to a sample even when the extra curvature does not generalize. Consider the context, plot the points and residuals, and, where appropriate, test predictions on data not used to fit the model.

Frequently Asked Questions

How do I do quadratic regression in Desmos?
Enter paired x- and y-values in a table, then type y_1 ~ a x_1^2 + b x_1 + c using the table’s actual column names. Desmos estimates a, b, and c.

What does the tilde mean in a Desmos regression?
In this expression, the tilde tells Desmos to fit the parameters to the listed data rather than require an exact equality for every observation.

Can Desmos show the quadratic regression curve?
Yes. After the fit estimates a, b, and c, enter y = a x^2 + b x + c as a separate expression to graph the model alongside the table’s points.

Does quadratic regression always give a good prediction?
No. It returns a least-squares quadratic fit, but the model may be inappropriate, affected by outliers, or unreliable outside the data range. Check the graph, residuals, and real-world context.

What if the regression expression does not work?
Confirm that the table columns are referenced with the correct subscripts, that the data are numeric and paired, and that the expression uses a tilde. Also check that there are enough distinct x-values to estimate a quadratic.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.