Evaluates the greatest likelihood coefficients of the function of best fit in accordance with the least squares approach for the function basis given (i.e. fitting the function).
0.0, where the array has a length equal to the number of data points considered. ak above).Returns an array of doubles where the k-th term corresponds to the value of the k-th coefficient (i.e. ak) within the function of best fit.
In the simplest case this method given a data set (xi, yi), for i=0,...,m,
finds the coefficients a1,...,an such that the function:
f(x) = a1 * f1(x) + a2 * f2(x) + ... + an * fn(x)
where f1,...,fn are the function basis set using SetFunctionBasis, is the function
of best fit in accordance with the least square approach for the data set considered. That is, the coefficients
are selected in such a way that the points (xi, f(xi)), for i=1,...,m; are a best fit
in accordance with the least squares approach for the given data set (xi, yi), i=1,...,m.
Please note that within this implementation we reserve the right to fix some of the coefficients of the function of
best fit before the function is fitted. In such instances the above described fitting is performed with some of the
coefficients fixed to the initial value which are given as parameters. The fit parameter is used in order
to determine which (if any) of the coefficients are kept fixed during the fitting.
As mentioned within the overview of this class (see GeneralLinear) you are able to incorporate
the following features when determining the regression model by offering three differing interpretations of the parameter
sigma, as detailed below:
sigma should be set to 1.0. In terms of the values of
the model parameters of the fitted regression model the measurement errors could have been set to any strictly positive
number however in doing so the Chi-Squared measure of the fit would have been scaled by a factor 1/sigma2,
in accordance with the definition of Chi-Squared measure.
yi's) are taken into account. In order to
fit the function taking into account the measurement errors you are required to provide the k-th term of the parameter
sigma for the measurement error of the yk (i.e. the value of the y-axis coordinate of the
k-th data point) which is then used within the fitting of the function. Note that all the measurement errors must be
strictly positive numbers.
1/sigmai corresponds to the (relative) weight applied to the i-th
data point. That is, as sigmai increase the data point is given a correspondingly lower weight.
Note: Within the class MeasurementErrors we offer the auxiliary method MeasurementError which evaluates the measurement error of a collection of measurements of an experiment in the same state.
| Exception Type | Condition |
|---|---|
| Thrown | Thrown if any of the elements of the parameter sigma are not strictly positive numbers. The reason why such a possibility must be excluded is because it would imply a term of the Chi-Squared measure involving division by zero. |
GeneralLinear Class | WebCab.COM.Statistics.CurveFitting Namespace