Fitting by minimising chi-squared, the sum of squared residuals weighted by their uncertainties; its value at the minimum also measures goodness of fit.Chi-squared minimisation is a generalization of least squares fitting that accounts for the fact that measurements often have different uncertainties. Instead of minimizing the sum of squared residuals, it minimizes the sum of squared residuals each divided by its own variance (the square of its uncertainty). This weighting ensures that more precise measurements have a greater influence on the fit than less precise ones. The value of chi-squared at the minimum also serves as a goodness-of-fit statistic: if it is close to the number of degrees of freedom, the model is a good description of the data; if it is much larger, the model may be wrong or uncertainties underestimated.
The chi-squared distribution was introduced by Karl Pearson in 1900, and the use of chi-squared minimisation for fitting became standard in the early 20th century, particularly in astronomy and particle physics.
For each data point, you compute the residual, square it, and divide by the variance of that measurement. Summing these weighted squared residuals gives the chi-squared value. The model parameters are varied to minimize this sum. Because the weights are the inverse variances, points with small uncertainties dominate the fit. The minimized chi-squared value follows a known statistical distribution (the chi-squared distribution) with degrees of freedom equal to the number of data points minus the number of fitted parameters, allowing a quantitative test of the model's validity.
Standard tool in experimental physics for fitting histograms, particle decay spectra, and astronomical data; also used in cosmology to fit the cosmic microwave background power spectrum.
A reduced chi-squared (chi-squared divided by degrees of freedom) of about 1 indicates a good fit; values much less than 1 often signal that uncertainties have been overestimated.
