BivariateSampleLinearRegression Method

Computes the best-fit linear regression from the data.

Definition

Namespace: Meta.Numerics.Statistics
Assembly: Meta.Numerics (in Meta.Numerics.dll) Version: 4.2.0+6d77d64445f7d5d91b12e331399c4362ecb25333
C#
public LinearRegressionResult LinearRegression()

Return Value

LinearRegressionResult
The result of the fit.

Remarks

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.

Exceptions

InsufficientDataExceptionThere are fewer than three data points.

See Also