Linear and nonlinear curve fitting, chi-square test
- CSIR NET · advanced
- UP Assistant Professor
4 minute read · Updated 2026-11-15
Picking up from
In Least squares fitting, we saw that least squares chooses parameters that minimize a stated residual measure, with weights reflecting the measurement-noise model. When does a fitted curve agree with the uncertainty model rather than merely look smooth?
In one line
Nonlinear fitting searches parameter space, while chi-square diagnostics test residual consistency only under a specified statistical model.
The idea, explained
A nonlinear model depends on its parameters in a way that does not reduce to one fixed linear system. Iterative fitting starts from a trial parameter set and repeatedly updates it, often using a local Jacobian. The objective can contain several local minima or nearly flat directions, so convergence of one algorithm is not proof of a unique physically meaningful solution.
A chi-square statistic compares residual size with known Gaussian uncertainty scales under suitable independence and model assumptions. Its expected distribution depends on the number of independent observations minus fitted parameter constraints. A reduced value near one can indicate consistency, but neither an extremely small value nor a large one has a universal interpretation without checking uncertainties and correlations. Reparameterization or data transformation can also alter the residual-noise model; taking logarithms does not automatically preserve equal-variance errors or the correct fitting objective.
Core ideas
- A model nonlinear in the input can still be linear in parameters. Classify the unknowns before choosing an iterative optimizer.
- Starting values and physical bounds can affect a nonlinear fit’s convergence. Report or test plausible alternatives when local minima are possible.
- Degrees of freedom count independent constraints, not merely the number of plotted points. Correlations and fitted nuisance parameters affect that count.
- A large chi-square can indicate underestimated errors, outliers or model failure. It does not uniquely identify which cause is present.
- A small reduced chi-square can reflect conservative uncertainties or correlated data rather than extraordinary proof of model correctness.
Key formulas
Local nonlinear update model
The Jacobian linearizes one local step, not the full globally nonlinear model.
Chi-square scale and degrees of freedom
The textbook approximation assumes independent Gaussian observations, correct known variances and a suitably identifiable fitted model.
State the objective, noise distribution, constraints and starting values before interpreting a fitted parameter. Examine residual structure and parameter identifiability as well as the optimizer’s stop flag. Use covariance estimates only in the local regime where their linear approximation is justified. If fitting transformed data, propagate how the transformation changes uncertainties. Apply chi-square reference distributions only when their hypotheses are reasonable; otherwise describe the statistic as a weighted discrepancy measure rather than attaching an unjustified probability interpretation.
Quick worked example
Twenty independent measurements fit two identifiable parameters under the simple model. The nominal degrees of freedom are eighteen. A chi-square value of eighteen is consistent with the expected scale but does not prove the model uniquely true.
Where this leads
Continue to Data interpretation and analysis, because interpreting data requires combining those statistical checks with physical scales and alternative explanations.
Related: Least squares fitting — prerequisite definitions used in this model.
Practice this topic
The syllabus topic needs a question-bank mapping before practice is available.