WebCab Probability and Statistics for COM v3.6

GeneralLinear.GetChiSquare Method 

Gets the value of the Chi-Squared measure of goodness-of-fit.

public double GetChiSquare();

Return Value

The value of Chi-Squared for the function of best fit.

Remarks

The Chi-Square is a convenient measure of how well (globally) over the range considered the function of best fit, fits the data considered. Note that before the Chi-Squares can be evaluated the set function must first be fitted using SetGeneralFit.

Remark: Roughly speaking for an unweighted function of best fit, the square root of the Chi-Squared measure is the average distance in the y-direction from a data point to the curve of best fit.

What is Chi-Squared?

Recall that here we are finding the curve of best fit in accordance with minimizing the sum of the squares of the terms:

( yi - (a1 * f1(xi) + ... + an * fn(xi)) / sigmai,

where we sum over the i, for 1 <= i <= n; the (xi, yi) are the data points, f1,...,fn are the function basis elements and sigmai are the standard deviations of the measurement error of the values of yi. The Chi-Squared measure is precisely the value of this sum.

Preconditions

Please note that before this method is called you must have already performed the following tasks:

  1. Set the Fitting Function using SetFunctionBasis
  2. Fit the function using SetGeneralFit

See Also

GeneralLinear Class | WebCab.COM.Statistics.CurveFitting Namespace