Skip to content
Statistics & Probability · Mathematics

Curve Fitting Simulation

Drag data points and their error bars and watch the best-fit line, parabola or cubic update instantly. Read χ² and r² to judge the fit — or try fitting by hand.

Interactive virtual lab · no download · works on phones and laptops

Chapter
Statistics · Experimental Physics
For
Class 11 · Class 12
Time
~10 min

Curve Fitting is a Pro simulation

Pro opens all 125 virtual labs — 483 simulations with guides and quizzes.

How to use it

  1. 1Drag points from the bucket onto the graph.
  2. 2Drag a point's error bar to change its uncertainty.
  3. 3Choose linear, quadratic or cubic.
  4. 4Switch to Adjustable fit and move the coefficient sliders.

What to notice

  • Least squares minimises the sum of squared, error-weighted residuals.
  • Reduced χ² near 1 means a good fit; much larger means a poor model.
  • One outlier with a small error bar can drag the whole line.
  • A higher-degree polynomial always fits at least as well — but may mean nothing.

For teachers

A ready-made teaching kit comes with this lab

  • Lesson plan

    20 min, 4 steps

  • Ask the class

    3 questions with answers

  • Quick quiz

    7 questions, printable

  • Key formulas

    2 formulas

About the Curve Fitting simulation

Real measurements never lie exactly on a line or a curve. A best-fit curve is the one that makes the squared distances from the points as small as possible — the method of least squares — weighting each point by how precise it is. The chi-squared value tells you whether the fit is as good as the error bars say it should be.

In this curve fitting simulation you drag data points and their error bars, fit a linear, quadratic or cubic curve, adjust the coefficients by hand to see how the fit gets worse, and read r² and reduced χ². It supports Statistics in Class 11 maths and the graph work of physics practicals.

Also covers: least squares, linear regression, best fit, chi square, correlation, error bars.

Frequently asked questions

What does r² measure?

How much of the variation in y the fitted curve explains — 1 is a perfect fit.

What does a reduced χ² near 1 mean?

The points scatter about the fit by about their error bars — a good, honest fit.

Why does one precise outlier pull the line so much?

Each point is weighted by 1/σ², so a point with a small error bar counts heavily.