What Is Curve Fit?
Curve fitting finds a function that follows the pattern in your data. Because the best model is rarely obvious, this tool fits several curves at once and shows them in one ranked table.
Enter your points to see the highest-R² curve with its equation, the adjusted R² and RMSE of every model, and a prediction for any x you choose. A chart of the data and curve and a bar chart of R² by model help you judge the fit.
The sections below explain R², why a higher degree can overfit and how to choose a sensible model.
How to Use the Curve Fit Calculator
- Enter x and y values in matching order.
- Optionally enter an x to predict.
- Read the ranked model table.
- Check the curve against the points.
Curve Fit Formula
R²
Adjusted R²
Curve Fit Variables Explained
| Symbol | Meaning | Notes |
|---|---|---|
| x, y | Your data points | |
| R² | Share of variation explained | |
| Adjusted R² | R² corrected for the number of parameters | |
| RMSE | Typical size of the residuals |
Curve Fit Worked Example
Values that roughly multiply by 1.65 at each step, such as 3.1, 5.2, 8.9, 14.8, 24.5, are growing exponentially. The exponential model ranks first with R² close to 1, while a straight line fits poorly.
With the example values loaded in the calculator above, the steps are:
- Fit each model to the 8 points by least squares.
- Exponential, power and logarithmic models are fitted by taking logarithms and fitting a straight line.
- Rank by R². Exponential is highest with R² = 0.999745.
- R² always rises with more parameters, so also compare adjusted R² and look at the plot.
Result: Highest R²: Exponential = y = 1.8823·e^(0.51251x); R² of that model = 0.999745; Prediction at x = 9 = 189.622.
How to Read the Ranked Fits
The calculator fits several curves and ranks them by R², the share of variation in y that each curve explains. Values that roughly multiply by 1.65 at each step, such as 3.1, 5.2, 8.9, 14.8 and 24.5, are growing exponentially, so the exponential model ranks first with R² close to 1 while a straight line fits poorly.
Do not choose a model on R² alone. Models with more parameters can fit noise, and a curve that fits the data well may extrapolate badly. Check the plot and ask whether the model makes sense for what you are measuring.
Where Curve Fit Is Used
Choosing a model
Compare linear, exponential, power, logarithmic and polynomial fits.
Prediction
Estimate y at a new x with the best curve.
Growth data
Check whether data grow by a constant factor.
Coursework
See the fitted equation and R² for each model.
Common Curve Fit Mistakes to Avoid
- Plot the data first. The shape often shows which family of curves to try.
- Exponential and power fits need positive y values.
- Prefer the simpler model when two have nearly equal R².
- Do not extrapolate far beyond your data.
Curve Fit Terms and Definitions
- Residual
- The difference between an observed y and the curve’s y.
Curve Fit FAQs
How do I fit a curve to data points?
Enter the x and y values. The calculator fits each model by least squares and lists the equations and R² values so you can compare them.
Which curve is the best fit?
The one that follows the pattern in the plot with the highest R² among reasonable models. Prefer a simpler curve when the gain from a more complex one is small.
Why does R² rise with a higher degree?
Adding terms to a polynomial can never make the fit to the same data worse, so R² only goes up. Adjusted R² and a look at the plot show whether the extra terms help.
Can I predict with the curve?
Yes, at x values inside your data range. Predictions outside the range are much less reliable.