Understanding the Art of Curve Fitting
Curve Fitting is the process of constructing a mathematical function that best fits a series of data points. It is the bridge between raw observations and theoretical understanding.
This interactive lab covers 9 essential curve models — from the simplest linear regression to the flexible Richards "master curve." Manipulate parameters with sliders and watch every curve respond in real time to build deep intuition.
9 Models Covered
Basic: Linear, Polynomial, Exponential, Logarithmic, Power Law
S-Shaped: Logistic, Gompertz, Richards, Weibull CDF
Basic Curves
The foundational curve families: Linear, Polynomial, Exponential, Logarithmic, and Power Law.
Every curve-fitting journey starts here. These five families cover the most common data patterns — constant growth, accelerating growth, diminishing returns, and scale-free decay. Select a curve type below and drag the sliders to see how each parameter shapes the function.
Parameters
y = a · x^bVertical scale.
b<1 = diminishing, b>1 = accelerating.
// Mathematical Model
y = 1 · x0.5
S-Shaped (Sigmoidal) Growth Models
The most important curves for growth modeling: slow start, rapid growth, saturation.
Sigmoidal curves capture the universal pattern of bounded growth — from population dynamics to LTV prediction. The Logistic is symmetric, the Gompertz is asymmetric with fixed skew, the Richards "master curve" has an extra parameter that can morph into either, and the Weibull CDF offers a flexible survival-based S-shape.
Parameters
LogisticMaximum possible value (the plateau).
How fast the metric grows during rapid growth phase.
Exact time when growth hits its absolute peak.
// Mathematical Model
y = 100 / (1 + e-0.5(t - 9.5))
Inflection Point
t ≈ 9.5, y ≈ 50.0 (50% of K)
Where growth rate is at its maximum.
Optimizers in Action
Watch how different optimization algorithms find the best-fit curve in real time.
Curve fitting is an optimization problem: find the parameter values that minimize the
difference between your model and the observed data.
When you call scipy.optimize.curve_fit in Python, one of
these algorithms runs under the hood.
Watch each one converge from a poor initial guess to the optimal fit.
Optimizer Controls
LMAmount of scatter in the synthetic data.
Slow (1) → Normal (2) → Fast (3)
Live Fitting Stats
Iteration
0
RSS
—
Current Parameters
K=?, r=?, m=?
LM
Fastest for unconstrained. Uses Jacobian for direction. No bounds support.
TRF
Default with bounds. Robust for large problems. Slightly slower but safer.
Dogbox
Best for small bounded problems. Rectangular trust region. Very stable.
Which Curve Should You Use?
Match your data's shape to the right mathematical model.
Straight Line
Constant rate of change. Baseline model for any analysis.
LinearCurved / Wiggly
Local peaks, valleys, or inflections. Flexible but can overfit.
PolynomialExplosive Growth / Decay
Compound interest, radioactive decay, viral install spikes.
ExponentialDiminishing Returns
Fast initial gains that taper off. Ad spend ROI, learning curves.
LogarithmicScale-Free Decay
Heavy tails, retention curves. Gold standard for mobile gaming.
Power LawS-Shape (Symmetric)
Inflection exactly at 50%. Population dynamics, adoption curves.
LogisticS-Shape (Asymmetric)
Inflection below midpoint. Tumor growth, epidemics, flexible LTV.
Gompertz RichardsSurvival / Risk S-Curve
S-shaped CDF for failure modeling, or PDF for density analysis.
Weibull CDF Weibull PDFDon't Know Yet?
Start with Richards. Its extra ν parameter lets it reduce to Logistic or Gompertz automatically.
Richards (Master)