Linear and Nonlinear Fitting

Fitting linear and nonlinear models to experimental data with uncertainty.

Conceptual context

In experimental physics, a cloud of points is not yet a law. Every datum combines system response, instrumental resolution, fluctuations, and possible bias. Fitting a model means proposing a relation between xx and yy, estimating its parameters, and checking whether disagreement between data and prediction is compatible with σi\sigma_{i}. The task is not to select the prettiest curve, but the simplest explanation that retains physical meaning, respects units, and leaves no pattern in rir_i. A linear model describes constant sensitivity, whereas a nonlinear model allows the response rate to change. Model choice therefore requires parameters, residuals, experimental domain, and measurement quality to be read together.

🟢 Essential level

A fit turns a collection of measurements into an interpretable relation. First, plot yy against xx and decide whether the trend looks straight, curved, or divided into regimes. In a linear model, mm states how much the response changes per unit input, while bb describes the extrapolated starting level. In a power law, AA sets the scale and nn controls how growth accelerates or slows. Selection must not rely only on R2R2. Inspect rir_i as well: positive and negative values scattered without a pattern support the model, whereas curves, fans, or bands suggest missing physics or an incorrect uncertainty description. chi2nuchi2nu helps decide whether deviations have the size expected from σi\sigma_{i}.

A good choice also remains stable when one ordinary point is removed and gives parameters with sensible units. A good fit should also remain reasonable when a single ordinary point is removed: if the result changes drastically, either the model or the datum itself must be reviewed before accepting the obtained parameters.

🔵 Formal level

Basic formulas

The linear model represents a response with constant rate and a possible offset:

Linear model

y=mx+by=mx+b

Ordinary least squares estimates mm by minimizing the sum of squared vertical deviations:

Least-squares slope

m=∑i(xi−xˉ)(yi−yˉ)∑i(xi−xˉ)2m=\frac{\sum_i(x_i-\bar{x})(y_i-\bar{y})}{\sum_i(x_i-\bar{x})^2}

When the response follows scaling behavior, the power-law model introduces AA and nn:

Power-law model

y=Axny=A x^n

Real student questions

Is the model with the largest R2R2 always best? No. Extra flexibility can raise it while leaving structured residuals or meaningless parameters.

Why inspect rir_i if the curve already looks good? The eye is dominated by the global scale. Residuals amplify small systematic deviations.

Does chi2nuchi2nu near one prove the model is correct? It only indicates compatibility with stated uncertainties under specific assumptions.

When should I use a nonlinear model? When physical reasoning, persistent curvature, or changing sensitivity cannot be captured linearly.

Can I linearize a power law with logarithms? Yes, if the transformation is valid and uncertainties are handled properly, because transformation changes the error structure.

What should I do with an outlier? Investigate it. Automatic deletion can hide physics or manufacture a clean fit.

Final synthesis

Choosing between linear and nonlinear fitting requires more than comparing curves. Units, parameters, rir_i, σi\sigma_{i}, global metrics, and mechanism must agree. The best model is the simplest one that explains the observed dependence without rir_i structure, preserves physical meaning, and states its validity limits honestly.

Formal development

This section is part of the complete theory. See the subscription options to access it.

🔴 Structural level

This section is part of the complete theory. See the subscription options to access it.

Deep physical interpretation

This section is part of the complete theory. See the subscription options to access it.

Order of magnitude

This section is part of the complete theory. See the subscription options to access it.

Personalized resolution method

This section is part of the complete theory. See the subscription options to access it.

Special cases and extended example

This section is part of the complete theory. See the subscription options to access it.

Cross-cutting connections and study paths

This section is part of the complete theory. See the subscription options to access it.