Click or drag to resize

BivariateLinearLogisticRegression Method

Computes the best-fit linear logistic regression from the data.

Namespace:  Meta.Numerics.Statistics
Assembly:  Meta.Numerics (in Meta.Numerics.dll) Version: (
public static LinearLogisticRegressionResult LinearLogisticRegression(
	this IReadOnlyList<bool> y,
	IReadOnlyList<double> x


Type: System.Collections.GenericIReadOnlyListBoolean
The values of the dependent variable.
Type: System.Collections.GenericIReadOnlyListDouble
The values of the independent variable.

Return Value

Type: LinearLogisticRegressionResult
The fit result.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IReadOnlyListBoolean. 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).
ArgumentNullExceptionx or y is .
DimensionMismatchExceptionThe sizes of x and y do not match.
InsufficientDataExceptionThere are fewer than three data points.

Linear logistic regression is a way to fit binary outcome data to a linear model.

The method assumes that binary outcomes are encoded as 0 and 1. If any y-values other than 0 and 1 are encountered, it throws an InvalidOperationException.

The fit result is two-dimensional. The first parameter is a, the second b.

See Also