dotnetCHARTING Send comments on this topic.
GeneralLinear(Series,Series,Double,Double,Double) Method
See Also 
dotnetCHARTING Namespace > ForecastEngine.Advanced Class > GeneralLinear Method : GeneralLinear(Series,Series,Double,Double,Double) Method


s
A statistical series.
sigma
An array where the k-th term depending on your point of view to one of the following:
  1. Measure Error View: is the standard deviation of the value in the y-axis of the k-th data point.
  2. Weighted Fitting View: is inverse of the weight given to the k-th data point.
.
xMin
The XValue of the starting point of the evaluation of best fitting curve.
xMax
The XValue of the ending point of the evaluation of best fitting curve.
interval
The distance between two points.
Evaluates the greatest likelyhood coefficients of the function of best fit in accordance with the least squares approach for the function basis given.

Syntax

Visual Basic (Declaration)  
Public Overloads Shared Function GeneralLinear( _
   ByVal s As Series, _
   ByVal sigma As Series, _
   ByVal xMin As Double, _
   ByVal xMax As Double, _
   ByVal interval As Double _
) As Series
Visual Basic (Usage) Copy Code
Dim s As Series
Dim sigma As Series
Dim xMin As Double
Dim xMax As Double
Dim interval As Double
Dim value As Series
 
value = ForecastEngine.Advanced.GeneralLinear(s, sigma, xMin, xMax, interval)
C#  
public static Series GeneralLinear( 
   Series s,
   Series sigma,
   double xMin,
   double xMax,
   double interval
)

Parameters

s
A statistical series.
sigma
An array where the k-th term depending on your point of view to one of the following:
  1. Measure Error View: is the standard deviation of the value in the y-axis of the k-th data point.
  2. Weighted Fitting View: is inverse of the weight given to the k-th data point.
.
xMin
The XValue of the starting point of the evaluation of best fitting curve.
xMax
The XValue of the ending point of the evaluation of best fitting curve.
interval
The distance between two points.

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.

Remarks

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:

  1. 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 parameter sigma as the measurement error of the y_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.
  2. 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 the i-th data point.

See Also