Complete user guide — data entry, curve selection, result interpretation, prediction, and reporting
v1.2.0The Advanced Curve Fitting App is a self-contained, browser-based tool that lets you enter or import X–Y data, automatically fit one or more mathematical curves to that data, visualize all curves on an interactive chart, and export polished statistical reports.
Key capabilities at a glance:
cfav120.html in any modern browser (Chrome, Firefox, Edge, Safari). Everything runs locally — no internet connection or server is needed.
The app uses a two-column layout. The left column contains all controls; the right column shows the chart and results.
Type or paste your data directly into the large text area labeled Enter X, Y data. Each row represents one data point. The required format is:
x_value, y_value
Example — six data points:
1, 2.1 2, 4.8 3, 11.0 4, 20.9 5, 35.5 6, 55.2
Click 📊 Example Data to instantly load an 11-point exponential-growth dataset (x = 0 to 10). This is a good starting point to explore all features before working with your own data.
Click Import / Export to open the Import/Export modal, then use one of these methods:
.csv or .json fileAccepted CSV format (first line with an x header is optional and ignored):
# Title: My Experiment x,y 1, 3.2 2, 7.8 3, 18.1
Accepted JSON format:
[{"x": 1, "y": 3.2}, {"x": 2, "y": 7.8}, {"x": 3, "y": 18.1}]
Or the titled JSON format (preserves the dataset name):
{"title": "My Experiment", "data": [{"x": 1, "y": 3.2}, ...]}
Enter a descriptive name in the Data Title field above the data textarea. This title appears in all exported files and printed reports.
Check one or more of the four curve families before clicking Fit Curves. You can run all four simultaneously and compare R² values to find the best model.
| Curve | Color | Equation form | Requirements | Best for |
|---|---|---|---|---|
| Polynomial | Blue | y = a₀ + a₁x + a₂x² + … | n ≥ degree + 1 points | General shapes; peaks & valleys; parabolas |
| Exponential | Green | y = a · ebx | All y values must be > 0 | Rapid growth or decay; population; radioactive decay |
| Logarithmic | Orange | y = a · ln(x) + b | All x values must be > 0 | Diminishing returns; learning curves; sound intensity |
| Power | Purple | y = a · xb | All x > 0 and all y > 0 | Allometric scaling; Kepler's law; tool wear rates |
When Polynomial is checked, choose the degree from the drop-down:
Type or import your X, Y values. Give the dataset a meaningful name in the title field.
Tick one or more checkboxes. If you're unsure, tick all four — the app will fit and display each independently.
The app runs regression for all selected curve types and redraws the chart with overlaid curves.
Below the chart, each fitted curve gets a result card showing its equation, R² value, and a quality rating.
Each card looks like this:
R² (coefficient of determination) measures how well the curve explains the variance in your data. It ranges from 0 to 1 (or can be negative for very poor fits).
| R² range | Quality label | What it means |
|---|---|---|
| > 0.95 | Excellent | Curve explains >95 % of the variance — very strong fit |
| 0.80 – 0.95 | Good | Strong fit, minor unexplained variation |
| 0.50 – 0.80 | Moderate | Partial fit; may be missing variables or wrong curve type |
| < 0.50 | Poor | Curve does not describe the data well; try a different type |
The canvas chart auto-scales to fit your data range with 10% padding on each axis. Grid lines, axis tick labels, and all fitted curve overlays are drawn automatically.
Each curve is plotted with 300 sample points across the data range, so even highly curved models render smoothly. Logarithmic and Power curves are only plotted for x > 0.
The Evaluate at Custom Point panel (bottom of the left column) lets you predict the Y value for any X across all currently fitted curves — useful for interpolation and extrapolation.
The results box shows the predicted Y from every fitted curve. If you supplied an Expected Y, it also shows the absolute difference and percentage error for each curve — handy for ranking which model is most accurate at that specific point.
polynomial: y = 129.321462 (diff: -0.678538, 0.52% error)
exponential: y = 131.042915 (diff: +1.042915, 0.80% error)
logarithmic: y = 104.732194 (x must be > 0 — OK)
Open the Import/Export modal by clicking Import / Export in the control panel.
.csv.title and data keys to your clipboard..csv or .json file from your computer. The data is parsed, loaded into the textarea, and curves are automatically fitted.You must fit at least one curve before printing. Two report formats are available:
A two-page print layout containing:
A comprehensive multi-page report that adds:
The following ready-to-use data sets demonstrate each curve type. Copy any block below and paste it into the data textarea, then click Fit Curves.
Simulates a bacterial population doubling roughly every 2 time steps. Exponential fit should score ≥ 0.99.
0, 1.2 1, 2.5 2, 5.1 3, 10.2 4, 17.8 5, 26.5 6, 37.1 7, 51.2 8, 66.8 9, 85.1 10, 105.5
| Best curve | Expected equation | Expected R² |
|---|---|---|
| Exponential | y ≈ 1.18 · e0.484x | ≈ 0.9985 |
Represents the height of a ball thrown upward over time. Quadratic polynomial should dominate.
0, 0 0.5, 12.3 1.0, 19.8 1.5, 22.6 2.0, 20.1 2.5, 12.9 3.0, 1.2
| Best curve | Expected equation | Expected R² |
|---|---|---|
| Polynomial degree 2 | y ≈ −9.8x² + 24.5x + 0.1 | ≈ 0.9997 |
Diminishing performance gains with practice — a classic logarithmic shape. All X values must be > 0.
1, 15.0 2, 21.0 4, 27.5 8, 34.0 16, 40.5 32, 47.0 64, 53.5 128, 60.0
| Best curve | Expected equation | Expected R² |
|---|---|---|
| Logarithmic | y ≈ 9.12 · ln(x) + 15.0 | ≈ 0.9999 |
Tool wear rate modelled by a power law. Both X and Y must be positive.
1, 0.50 2, 0.71 3, 0.87 5, 1.12 8, 1.41 12, 1.73 20, 2.24 50, 3.54
| Best curve | Expected equation | Expected R² |
|---|---|---|
| Power | y ≈ 0.50 · x0.500 | ≈ 0.9999 |
A realistic dataset with measurement noise. Use this to practice comparing all four models and using AIC/BIC for selection.
1, 3.8 2, 8.1 3, 14.7 4, 18.3 5, 29.2 6, 39.5 7, 52.1 8, 68.4 9, 87.3 10, 112.0 11, 131.5 12, 165.2
| Curve | Typical R² | Notes |
|---|---|---|
| Polynomial deg. 2 | ~0.994 | Strong fit; slight undershoot at extremes |
| Exponential | ~0.998 | Best fit — data is fundamentally exponential |
| Logarithmic | ~0.915 | Poor at high X — does not capture growth rate |
| Power | ~0.984 | Good but not as tight as exponential |
Try evaluating at x = 13 with expected Y = 200 using the Evaluate panel to see which model predicts best beyond the data range.
→ Try Logarithmic first. Classic for learning curves, signal attenuation, and diminishing returns.
→ Exponential. Populations, radioactive decay, compound interest.
→ Polynomial degree 2 or 3. Projectiles, profit functions, resonance curves.
→ Power law. Kepler's orbit periods, metabolic rates, fracture mechanics.
A degree-5 polynomial through 6 data points will achieve R² = 1 by passing through every point exactly — but it will oscillate wildly between them and make terrible predictions. As a rule:
The app has no internal save function. To preserve work between sessions:
.json extension.A negative R² means the fitted curve is a worse predictor than simply using the mean of Y. This usually happens when the selected curve type is completely wrong for the data shape — for example, fitting a logarithm to data that clearly grows exponentially.
Power and Logarithmic curves are undefined for x ≤ 0. If your data range includes zero or negative X values, those portions of the curve are simply not drawn. The regression coefficients are still calculated from the valid (positive X) portion of your data.
The app supports exactly four model families. To explore additional model families (e.g., Gompertz, logistic, Gaussian), the data would need to be analysed in a dedicated statistics package.
Some browser pop-up blockers interfere with the print-preview window. Ensure pop-ups are allowed for the file URL. Alternatively, use Print Advanced Report, which embeds the chart as a canvas copy.
Check that: (1) commas separate X and Y (not semicolons or tabs); (2) there are no empty lines at the start; (3) decimal numbers use a period, not a comma (i.e., 3.14 not 3,14).
The app builds the normal equations (Xᵀ·X)·β = Xᵀ·Y and solves them using Gaussian elimination with partial pivoting. Exponential, Logarithmic, and Power regressions are linearised via logarithmic transformation and then solved as degree-1 polynomial problems.