Curve fitting
Click to place data points. Choose a fitting method and watch the regression curve adapt in real time. Drag points to see the fit update instantly. The residual plot below shows what the model misses.
Minimize ∑(yᵢ − f(xᵢ))² → least squares
Least squares
Curve fitting finds the function that best matches scattered data. The least squares method minimizes the sum of squared residuals — the vertical distances between each data point and the fitted curve. For linear regression, this has a closed-form solution. For other curves, the same principle applies, often via transformation or iterative methods.
R-squared
The coefficient of determination (R²) measures how much variance in the data the model explains. R² = 1 means a perfect fit; R² = 0 means the model does no better than a horizontal line at the mean. A high R² with a polynomial may indicate overfitting rather than true understanding.
Anscombe’s quartet
Four datasets with identical linear regression statistics (same mean, variance, correlation, and regression line) but visually very different distributions. Francis Anscombe constructed them in 1973 to demonstrate the importance of graphing data before analyzing it.