Performs a linear fit to a given function base using singular value decomposition.
Constructor | Description |
Full Usage:
LinearFitBySvd(xarr, yarr, stddev, numberOfData, numberOfParameter, evaluateFunctionBase, threshold)
Parameters:
float[]
-
The array of x values of the data set.
yarr : float[]
-
The array of y values of the data set.
stddev : float[]
-
The array of y standard deviations of the data set. Can be null if the standard deviation is unkown.
numberOfData : int
-
The number of data points (may be smaller than the array sizes of the data arrays).
numberOfParameter : int
-
The number of parameters to fit == size of the function base.
evaluateFunctionBase : FunctionBaseEvaluator
-
The function base used to fit.
threshold : float
-
A treshold value (usually 1E-5) used to chop the unimportant singular values away.
|
![]() ![]() ![]() ![]() Fits a data set linear to a given function base.
|
Full Usage:
LinearFitBySvd(xarr, yarr, stddev, numberOfData, numberOfParameter, evaluateFunctionBase, threshold)
Parameters:
IReadOnlyList<float>
-
The array of x values of the data set.
yarr : IReadOnlyList<float>
-
The array of y values of the data set.
stddev : IReadOnlyList<float>
-
The array of y standard deviations of the data set. Can be null if the standard deviation is unkown.
numberOfData : int
-
The number of data points (may be smaller than the array sizes of the data arrays).
numberOfParameter : int
-
The number of parameters to fit == size of the function base.
evaluateFunctionBase : FunctionBaseEvaluator
-
The function base used to fit.
threshold : float
-
A treshold value (usually 1E-5) used to chop the unimportant singular values away.
|
![]() ![]() ![]() ![]() Fits a data set linear to a given function base.
|
Full Usage:
LinearFitBySvd(xbase, yarr, stddev, numberOfData, numberOfParameter, threshold)
Parameters:
IROMatrix<float>
-
The matrix of x values of the data set. Dimensions: numberOfData x numberOfParameters. The matrix is changed during calculation!
yarr : float[]
-
The array of y values of the data set.
stddev : float[]
-
The array of y standard deviations of the data set. Can be null if the standard deviation is unkown.
numberOfData : int
-
The number of data points (may be smaller than the array sizes of the data arrays).
numberOfParameter : int
-
The number of parameters to fit == size of the function base.
threshold : float
-
A treshold value (usually 1E-5) used to chop the unimportant singular values away.
|
![]() ![]() ![]() ![]() Fits a data set linear to a given x base.
|
Instance member | Description |
Full Usage:
this.AdjustedRSquared
Returns: float
|
![]() ![]() ![]() ![]() Gives the adjusted coefficient of determination. Ref. "Introduction to linear regression analysis", Wiley, p.90.
|
Full Usage:
this.Calculate
Parameters:
IROMatrix<float>
-
The matrix of x values of the data set. Dimensions: numberOfData x numberOfParameters. The matrix is changed during calculation!
yarr : IReadOnlyList<float>
-
The array of y values of the data set.
stddev : IReadOnlyList<float>
-
The array of y standard deviations of the data set. Can be null if the standard deviation is unkown.
numberOfData : int
-
The number of data points (may be smaller than the array sizes of the data arrays).
numberOfParameter : int
-
The number of parameters to fit == size of the function base.
threshold : float
-
A treshold value (usually 1E-5) used to chop the unimportant singular values away.
Returns: LinearFitBySvd
|
![]() ![]() ![]() ![]() Fits a data set linear to a given x base.
|
Full Usage:
this.ConditionNumber
Returns: float
|
![]() ![]() ![]() ![]() Gets the condition number. The decadic logarithm of the condition number is roughly the loss of precision (in digits) during the calculation.
|
Full Usage:
this.Covariances
Returns: float[][]
|
![]() ![]() ![]() ![]() Get the variance-covariance-matrix for the fit.
|
Full Usage:
this.EstimatedVariance
Returns: float
|
![]() ![]() ![]() ![]() Get the estimated residual mean square, also called SigmaSquare.. The estimated mean square is defined as SumChiSquare(n-p), where n is the number of data points and p is the number of (free) parameters.
|
Full Usage:
this.ExternallyStudentizedResidual
Parameters:
int
-
The index to the residual.
Returns: float
The ith externally studentized residual.
|
![]() ![]() ![]() ![]() Gives the ith studentized residual, with the ith observation removed from the model. As with the studentized residual, the expected variance of this residual is 1. Since the ith observation is excluded from the model, the externally studentized residual is better suited for outlier detection than the (normal) studentized residual. Ref: Introduction to linear regression analysis, 3rd ed., Wiley, p.136
|
Full Usage:
this.NumberOfData
Returns: int
|
![]() ![]() ![]() ![]() Returns the number of data value.
|
Full Usage:
this.NumberOfParameter
Returns: int
|
![]() ![]() ![]() ![]() Returns the number of parameter (=Order+1) of the fit.
|
Full Usage:
this.PRESSResidual
Parameters:
int
-
The index of the PRESS residual.
Returns: float
The ith PRESS residual.
|
![]() ![]() ![]() ![]() Gives the ith PRESS residual. The PRESS residual is the prediction error of the ith value, if the ith value itself is not used in the prediction model. Ref: Introduction to linear regression analysis, 3rd ed., Wiley, p.135
|
Full Usage:
this.Parameter
Returns: float[]
|
![]() ![]() ![]() ![]() Get the resulting parameters, so that the model y = SUM(parameter[i]*functionbase[i])
|
Full Usage:
this.PredictedValues
Returns: float[]
|
![]() ![]() ![]() ![]() Gets the predicted dependent values
|
Full Usage:
this.PredictionVariance
Parameters:
int
-
The index to the ith observation.
Returns: float
The variance of the ith prediction value.
|
![]() ![]() ![]() ![]() Gives the variance of the prediction of the ith y-value.
|
Full Usage:
this.RSquared
Returns: float
|
![]() ![]() ![]() ![]() Gives the coefficient of determination, also called R^2, squared correlation coefficient. It is a measure, how much of the variability of the y data is accounted for by the regression model.
|
Full Usage:
this.RegressionCorrectedSumOfSquares
Returns: float
|
![]() ![]() ![]() ![]() Gets the regression sum of squares, i.e. SUM(yi`-ymean), where yi` is the predicted ith y value and y mean is the mean value of all y values.
|
Full Usage:
this.ResidualSumOfSquares
Returns: float
|
![]() ![]() ![]() ![]() Gets the sum of ChiSquare for the fit. This is SUM(yi-yi`)^2, where yi is the ith y value and yi` is the ith predicted y.
|
Full Usage:
this.ResidualValues
Returns: float[]
|
![]() ![]() ![]() ![]() Gets the array of residual values defined as the difference y[i]-ypredicted[i].
|
Full Usage:
this.Sigma
Returns: float
|
![]() ![]() ![]() ![]()
Get the standard error of regression, defined as
|
Full Usage:
this.StandardErrorOfParameter
Parameters:
int
-
Index of the parameter.
Returns: float
The estimated standard error of parameter i .
|
![]() ![]() ![]() ![]()
Gets the estimated standard error of parameter
|
Full Usage:
this.StudentizedResidual
Parameters:
int
-
The index of the residual.
Returns: float
The ith studentized residual.
|
![]() ![]() ![]() ![]() Gives the ith studentized residual. The studentized residual has constant variance of 1, regardless of the location of xi. Ref: Introduction to linear regression analysis, 3rd ed., Wiley, p.134
|
Full Usage:
this.TofParameter
Parameters:
int
Returns: float
|
![]() ![]() ![]() ![]()
|
Full Usage:
this.TotalCorrectedSumOfSquares
Returns: float
|
![]() ![]() ![]() ![]() Gives the corrected sum of squares of y, i.e. SUM(yi-ymean), where yi is the ith y value and ymean is the mean of all y values.
|
Static member | Description |
Full Usage:
LinearFitBySvd.CorrectedSumOfSquares(x, mean, start, length)
Parameters:
IReadOnlyList<float>
-
Array of values.
mean : float
-
Mean value of the values.
start : int
-
Starting index.
length : int
-
Number of elements used for calculation.
Returns: float
|
![]() ![]() ![]() ![]()
Calculates the corrected sum of squares of
|
Full Usage:
LinearFitBySvd.FitPolymomial(order, xValues, yValues, start, count, doRemoveNaNValues)
Parameters:
int
-
The order of the fit (1:linear, 2:quadratic, etc.)
xValues : IReadOnlyList<float>
-
The column of x-values. Only those values are used, that are not NaN
yValues : IReadOnlyList<float>
-
The column of y-values.
start : int
-
Index of first data point to use.
count : int
-
Number of data points to use.
doRemoveNaNValues : bool
-
If true, value pairs containing NaN are removed before calculation of the fit.
Returns: LinearFitBySvd
The fit.
|
![]() ![]() ![]() ![]() Fits data provided as xcolumn and ycolumn with a polynomial base. Here special measures are taken (scaling of the x-variable) in order to keep the precision high.
|
Full Usage:
LinearFitBySvd.FitPolymomialDestructive(order, xValues, yValues, errorValues, count)
Parameters:
int
-
The order of the fit (1:linear, 2:quadratic, etc.)
xValues : float[]
-
The array of x-values. The values of the array are destroyed (altered) during the evaluation!
yValues : float[]
-
The array of y-values.
errorValues : float[]
-
The column of errorValues. If null, errorValues are set to 1 for each element.
count : int
-
Number of values to use (array[0] ... array[count-1].
Returns: LinearFitBySvd
The fit.
|
![]() ![]() ![]() ![]() Fits data provided as xcolumn and ycolumn with a polynomial base. Here special measures are taken (scaling of the x-variable) in order to keep the precision high.
|
Full Usage:
LinearFitBySvd.GetPolynomialFunctionBase(order)
Parameters:
int
-
Order of the polynomial (0: only intercept, 1: linear, 2: quadratic ...
Returns: FunctionBaseEvaluator
The function base to use with this fit.
|
![]() ![]() ![]() ![]() Gets a default polynomial function base with intercept, i.e. f(y)=a+b*x+c*x*x ...
|
Full Usage:
LinearFitBySvd.Mean(x, start, length)
Parameters:
IReadOnlyList<float>
-
The array of values.
start : int
-
First element.
length : int
-
Number of elements used for calculation.
Returns: float
|
![]() ![]() ![]() ![]()
Calculates the mean value of
|