Function Basis<T>.Least Squares Fit Method
Definition
Namespace: Numerics.NET.Curves.Generic
Assembly: Numerics.NET.Generic (in Numerics.NET.Generic.dll) Version: 9.0.1
Assembly: Numerics.NET.Generic (in Numerics.NET.Generic.dll) Version: 9.0.1
Overload List
Least | Gets the least squares fit of target data in terms of the components of the FunctionBasis. |
Least | Gets the least squares fit of target data in terms of the components of the FunctionBasis. |
Least | Gets the least squares fit of target data in terms of the components of the FunctionBasis. |
Least | Gets the least squares fit of target data in terms of the components of the FunctionBasis. |
LeastSquaresFit(Vector<T>, Vector<T>)
Gets the least squares fit of target data in terms of
the components of the FunctionBasis.
public virtual LinearCombination<T> LeastSquaresFit(
Vector<T> xValues,
Vector<T> yValues
)
Parameters
- xValues Vector<T>
- A vector containing the data points for the fit.
- yValues Vector<T>
- A vector containing the data values corresponding to the data points in xValues.
Return Value
LinearCombination<T>A LinearCombination that is the least squares fit of the data in terms of this FunctionBasis.
Exceptions
Argument | xValues is null.
-or- yValues is null. |
[!:Mathematics.TotalLossOfPrecisionException] | The solution of the least squares problem could not be found because roundoff error caused a total loss of precision. |
Dimension | The xValues and yValues do not have the same length. |
Argument | The number of data points is less than the number of basis functions. |
LeastSquaresFit(T[], T[], T[])
Gets the least squares fit of target data in terms of
the components of the FunctionBasis.
public virtual LinearCombination<T> LeastSquaresFit(
T[] xValues,
T[] yValues,
T[] weights
)
Parameters
- xValues T[]
- A T array containing the data points for the fit.
- yValues T[]
- A T array containing the data values corresponding to the data points. in xValues.
- weights T[]
- A T array containing the weights to assign to the residual error corresponding to the data values in yValues.
Return Value
LinearCombination<T>A LinearCombination that is the least squares fit of the data in terms of this FunctionBasis.
Exceptions
Argument | xValues is null.
-or- yValues is null. |
Total | The solution of the least squares problem could not be found because roundoff error caused a total loss of precision. |
Dimension | The xValues and yValues do not have the same length. |
Argument | The number of data points is less than the number of basis functions. |
LeastSquaresFit(T[], T[], Int32)
Gets the least squares fit of target data in terms of
the components of the FunctionBasis.
public virtual LinearCombination<T> LeastSquaresFit(
T[] xValues,
T[] yValues,
int numberOfDataPoints
)
Parameters
- xValues T[]
- An array containing the data points for the fit.
- yValues T[]
- A array containing the data values corresponding to the data points in xValues.
- numberOfDataPoints Int32
- The number of actual data points.
Return Value
LinearCombination<T>A LinearCombination that is the least squares fit of the data in terms of this FunctionBasis.
Remarks
Use this method to calculate a LinearCombination of the basis functions in this instance through a set of points using the least squares method.
Only the first numberOfDataPoints values in xValues and yValues are used.
Exceptions
Argument | xValues is null.
-or- yValues is null. |
Argument | numberOfDataPoints is less than the number of basis functions.
-or- numberOfDataPoints is greater than the length of xValues -or- numberOfDataPoints is greater than the length of yValues |
Total | The solution of the least squares problem could not be found because roundoff error caused a total loss of precision. |
LeastSquaresFit(Vector<T>, Vector<T>, Vector<T>)
Gets the least squares fit of target data in terms of
the components of the FunctionBasis.
public virtual LinearCombination<T> LeastSquaresFit(
Vector<T> xValues,
Vector<T> yValues,
Vector<T>? weights
)
Parameters
- xValues Vector<T>
- A vector containing the data points for the fit.
- yValues Vector<T>
- A vector containing the data values corresponding to the data points in xValues.
- weights Vector<T>
- A vector containing the weights to assign to the residual error corresponding to the data values in yValues.
Return Value
LinearCombination<T>A LinearCombination that is the least squares fit of the data in terms of this FunctionBasis.
Exceptions
Argument | xValues is null.
-or- yValues is null. |
[!:Mathematics.TotalLossOfPrecisionException] | The solution of the least squares problem could not be found because roundoff error caused a total loss of precision. |
Dimension | The xValues and yValues do not have the same length. |
Argument | The number of data points is less than the number of basis functions. |