Click or drag to resize

BivariateSampleLinearRegression Method

Computes the best-fit linear regression from the data.

Namespace:  Meta.Numerics.Statistics
Assembly:  Meta.Numerics (in Meta.Numerics.dll) Version: (
public LinearRegressionResult LinearRegression()

Return Value

Type: LinearRegressionResult
The result of the fit.
InsufficientDataExceptionThere are fewer than three data points.

Linear regression assumes that the data have been generated by a function y = a + b x + e, where e is normally distributed noise, and determines the values of a and b that best fit the data. It also determines an error matrix on the parameters a and b, and does an F-test to

The fit result is two-dimensional. The first parameter is the intercept a, the second is the slope b. The goodness-of-fit test is a F-test comparing the variance accounted for by the model to the remaining, unexplained variance.

See Also