Click or drag to resize

Bivariate.PolynomialRegression Method

Computes the polynomial of given degree which best fits the data.

Namespace:  Meta.Numerics.Statistics
Assembly:  Meta.Numerics (in Meta.Numerics.dll) Version: 4.1.4
Syntax
public static PolynomialRegressionResult PolynomialRegression(
	this IReadOnlyList<double> y,
	IReadOnlyList<double> x,
	int m
)

Parameters

y
Type: System.Collections.Generic.IReadOnlyList<Double>
The values of the dependent variables (y-coordinates).
x
Type: System.Collections.Generic.IReadOnlyList<Double>
The values of the independent variable (x-coordinates).
m
Type: System.Int32
The degree, which must be non-negative.

Return Value

Type: PolynomialRegressionResult
The result of the fit.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IReadOnlyList<Double>. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Exceptions
ExceptionCondition
ArgumentNullExceptionx or y is null.
DimensionMismatchExceptionx and y do not contain the same number of entries.
ArgumentOutOfRangeExceptionm is negative.
InsufficientDataExceptionThere are fewer data points than coefficients to be fit.
See Also