FitPolynomialWeighted Method |
Weighted Least-Squares fitting the points (x,y) and weights w to a k-order polynomial y : x -> p0 + p1*x + p2*x^2 + ... + pk*x^k,
returning its best fitting parameters as [p0, p1, p2, ..., pk] array, compatible with Polynomial.Evaluate.
A polynomial with order/degree k has (k+1) coefficients and thus requires at least (k+1) samples.
Namespace: Altaxo.CalcAssembly: AltaxoCore (in AltaxoCore.dll) Version: 4.8.3572.0 (4.8.3572.0)
Syntaxpublic static double[] PolynomialWeighted(
double[] x,
double[] y,
double[] w,
int order
)
Parameters
- x Double
- The x values of the sample points.
- y Double
- The y values of the sample points.
- w Double
- The weights of the sample points.
- order Int32
- The polynomial order.
Return Value
DoubleThe fitted weighted polynomial coefficients.
See Also