Function Basis.Least Squares Fit Method
Definition
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.3
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<Double>, Vector<Double>)
public virtual LinearCombination LeastSquaresFit(
Vector<double> xValues,
Vector<double> yValues
)
Parameters
- xValues Vector<Double>
- A vector containing the data points for the fit.
- yValues Vector<Double>
- A vector containing the data values corresponding to the data points in xValues.
Return Value
LinearCombinationA 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(Double[], Double[], Double[])
public virtual LinearCombination LeastSquaresFit(
double[] xValues,
double[] yValues,
double[] weights
)
Parameters
- xValues Double[]
- A Double array containing the data points for the fit.
- yValues Double[]
- A Double array containing the data values corresponding to the data points. in xValues.
- weights Double[]
- A Double array containing the weights to assign to the residual error corresponding to the data values in yValues.
Return Value
LinearCombinationA 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(Double[], Double[], Int32)
public virtual LinearCombination LeastSquaresFit(
double[] xValues,
double[] yValues,
int numberOfDataPoints
)
Parameters
- xValues Double[]
- A Double array containing the data points for the fit.
- yValues Double[]
- A Double array containing the data values corresponding to the data points in xValues.
- numberOfDataPoints Int32
- The number of actual data points.
Return Value
LinearCombinationA 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<Double>, Vector<Double>, Vector<Double>)
public virtual LinearCombination LeastSquaresFit(
Vector<double> xValues,
Vector<double> yValues,
Vector<double>? weights
)
Parameters
- xValues Vector<Double>
- A vector containing the data points for the fit.
- yValues Vector<Double>
- A vector containing the data values corresponding to the data points in xValues.
- weights Vector<Double>
- A vector containing the weights to assign to the residual error corresponding to the data values in yValues.
Return Value
LinearCombinationA 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. |