Visual Basic (Declaration) | |
---|---|
Public Overloads Shared Function GeneralLinear( _ ByVal s As Series, _ ByVal sigma As Series _ ) As Series |
Visual Basic (Usage) | Copy Code |
---|---|
|
Parameters
- s
- A statistical series.
- sigma
- An array where the k-th term depending on your point of view to one of the following:
- Measure Error View: is the standard deviation of the value in the y-axis of the k-th data point.
- Weighted Fitting View: is inverse of the weight given to the k-th data point.
Return Value
Returns an array of doubles where the k-th term corresponds to the value of the k-th coefficient within the function of best fit.Further Details
In its simplest case this method given a data set (x_i, y_i)
, for i=0, ..., m
, are are able to find the coefficients a_1, ..., a_n
such that the function:
f(x) = a_1 * f_1(x) + a_2 * f_2 + ... + x_n * f_n(x)
where f_1,...f_n
are the function basis set using SetFunctionBasis method, and the function f(x)
, is best fit in accordance with the least square approach. That is, coefficients are selected such the points (x_i, f(x_i))
, for i=1,...,m
; are a best fit for the given data set (x_i, y_i)
, i=1,...,m
.
Fixing some Coefficients
Please note that within this implementation we reserve the right to fix some of the coefficients 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 they are given. The fit
parameter is used in order to determine which (if any) of the coefficient are kept fixed during the fitting.
Measure Errors or Weighted Best Fit
In addition as mentioned within the overview of this class you are able to incorporate one of the following features when determining the greatest likelyhood coefficients:
- Measure Error: You are able to find the greatest likelyhood coefficients when the measure error (i.e. the standard deviations of the errors of the observation so the
y_i
's). In order to fit the function taking into account the measurment error you are required to provide the k-th term of the parametersigma
as the measurement error of they_k
(i.e. the value of the y-axis corrdinate of the k-th data point which in used within the fitting of the function. - Weighted Best Fit: If you wish you are also able to apply this class with the view of finding the best weighted fit where the
sigma_i
corresponds the weight applied to thei
-th data point.