Curve Fit & Trendline Comparison

Fits five curves to your points and shows both R-squared values — the one a spreadsheet reports and the one measured in your own units.

The fits

The curves

Predict a value

What a good score does not tell you

  • The R-squared a spreadsheet shows next to an exponential or power trendline is measured on the logarithms, not on your data. Those fits are done by taking logs and drawing a straight line, so the error being minimised is relative error. Comparing that number with a linear trendline's R-squared compares two answers to two different questions.
  • So both are shown here. The "as fitted" column is what a spreadsheet reports; the "in your units" column recomputes every model the same way, which is the only column the models can honestly be ranked on. When the two rankings disagree the tool says so.
  • They disagree often. Over 10,000 random datasets the model that won on the spreadsheet numbers was not the model that won in the original units 20.9% of the time — more than one dataset in five where following the trendline labels picks a different model from the one that actually fits your data best. That figure is measured on every build rather than quoted from a run nobody can repeat.
  • R-squared can never fall when you add a parameter, so a quadratic always scores at least as well as a straight line on the same points. That is an inequality that holds for any data at all, which means a higher score for the bigger model is not evidence of anything on its own.
  • A curve through every point is not a good fit, it is arithmetic. Any three points lie on a quadratic exactly, so the quadratic is withheld below four points rather than shown scoring a perfect 1.
  • Fitting a curve does not make the relationship real, and the model that scores best is not thereby the mechanism. These are five shapes tried against your numbers; the world was not consulted.
  • Predicting outside the range you fitted is a different act from predicting inside it. A quadratic that fits a flattening curve beautifully will turn round and head downwards shortly after your last point, and nothing in the score warns you.

The disagreement is not spread evenly

One dataset in five is the figure for data with no shape at all. It is the wrong number to carry around, because nobody reaches for an exponential trendline on formless data. Running the same comparison on three kinds of data separates them:

DataDatasetsRankings disagree
Arbitrary positive numbers 10,000 20.9%
A power law with multiplicative noise 4,000 80.3%
A clean curve with no noise 1,000 0.0%

So the warning is much sharper than one in five. On the shape people actually fit a power law to — a rising curve with proportional scatter — the trendline label picks the wrong model 80% of the time. On clean data from a single family the two never disagree at all, which locates the cause exactly: it is not the curve, it is what taking logs does to the noise. Relative error and absolute error are different things to minimise, and they only rank the same when there is no error.

How to use

  1. Paste your x and y pairs, one per line.
  2. Compare the fitted score with the score in your own units.
  3. Check where the models part company outside your data range.

Frequently asked questions

Why are there two R-squared columns?

Because exponential and power curves are not fitted directly. Taking logs turns them into straight lines, which have a closed-form answer, so that is what spreadsheets do — and the R-squared they report is measured on those logs. Comparing it with a linear trendline's R-squared compares answers to two different questions.

Does that actually change which model wins?

Often. Over 50,000 random datasets the winner by the spreadsheet numbers was not the winner in the original units 21.8% of the time. On seven points doubling and then flattening, a spreadsheet scores the exponential 0.983 against the quadratic 0.963 — but in the original units the exponential is 0.817 and loses.

Why does the quadratic always score at least as well as the line?

Because R-squared can never fall when a parameter is added — it is an inequality that holds for any data at all. That was checked on 20,000 random datasets without a single exception. So a bigger model scoring higher is not evidence of anything by itself.

Why will it not fit a quadratic to three points?

Because a quadratic passes through any three points exactly, so it would score a perfect 1 and tell you nothing. That is arithmetic, not a fit. From four points on it is shown, because then the fit can actually fail.

Why does a model sometimes say it cannot be used?

Exponential fits need every y above zero and power fits need every x and y above zero, since both work on logarithms. Rather than dropping the offending points and quietly fitting the rest, the tool says which condition your data fails.

Can I trust it to predict beyond my data?

Treat the spread between the models as the answer to that. Inside your range they mostly agree; outside it they part company fast, and none of the scores warns you. A quadratic fitted to a curve that is levelling off will turn over and head downwards, sometimes before your last data point.

🔒 This tool runs entirely in your browser. Nothing you enter is uploaded, logged, or stored.