Curve Fitting Calculator — Advanced

❓Curve fit 🏠Home 🧮Basic Video
📘 How to use this — copy and paste CSV, TSV, or spreadsheet data

What this page adds. The basic calculator fits straight lines and polynomials to up to three columns in your browser. This page takes any number of columns and adds the non-linear models - exponential, power, logarithmic, logistic and Gaussian - with the standard error of every coefficient. To do that it sends your table to the server, computes there, and sends the numbers back. Nothing is stored, but the data does leave your machine. If that matters for your data, use the basic page. The curve fitting article explains each model.

A high R² does not make a model right: look at the residual chart, and choose the model from the process behind the data. A non-linear fit starts from a guess and can fail; a column that does not converge is reported, never drawn.

  1. Paste your data into the Input grid — straight from a spreadsheet, or as CSV/TSV text — or import a file. First column is x, then one column per series: y1, y2, … Each column is fitted on its own, and needs at least as many points - at different x - as the model has coefficients.
  2. Pick a method.
    • linear: y = a + b·x.
    • polynomial: y = c0 + c1·x + … + cn·xⁿ, order n.
    • exponential: y = a·e^(b·x) - growth or decay.
    • power: y = a·x^b, x > 0 - a scaling law.
    • logarithmic: y = a + b·ln x, x > 0.
    • logistic: y = L / (1 + e^(−k·(x − x0))) - an S-curve with a plateau L.
    • Gaussian: y = A·e^(−(x − μ)² / (2σ²)) - one peak at μ, width σ.
    • user-defined: your own formula in x - see the next step.
  3. Type the formula (user-defined), for example a*exp(b*x) + c.
    • Allowed: numbers, x, + − * / ^, the constants pi and e, and exp, ln (or log), log10, sqrt, sin, cos, tan, abs. One sign at a time: b + -c works, b +-+- c is refused.
    • Parameters: every other name, such as a, b, k1 - up to 6, at most 200 characters in all.
    • Starting guess: name = number, comma separated, such as a = 10, b = -0.3. A parameter left out starts at 1. A guess far from the answer can stop the solver; the result then says so.
  4. Set the order (polynomial): 1 to 10. Fit space (exponential, power): non-linear fits y itself; linearised fits a straight line to ln y, which weighs relative errors - a different answer, and every y must be above 0.
  5. Real time range — try orders live on the order box.
    • ▲▼ buttons or the mouse wheel over the box: the order moves and the fit is recomputed - one request a moment after the last step.
    • Limits: order 1 to 10; a typed value outside is set to the nearest limit.
    • Typing or the arrow keys change the box only; press fit to recompute.
  6. Press fit. The server's time for the fit appears beside the button, and the status line gives R² for each column. The upper chart shows your data as dots and each fitted curve as a line in the same color; the lower chart shows the residuals.
  7. Read the result. Under the charts, pick a column: R², adjusted R², RMSE and the solver's evaluations on the first line, the equation, ready to retype, on the second. See more beside the equation - hover or click - lists each coefficient ± its standard error and the starting guess; the status line has its own for every column's R². The Output grid lists x, then per column the fitted y and the residual. Export saves it as a CSV/TSV file.

Input

Output

Fit

Residuals