A linear regression model with a single explanatory variable.
import mir.math.common: approxEqual; static immutable x = [0, 1, 2, 3]; static immutable y = [-1, 0.2, 0.9, 2.1]; auto params = x.simpleLinearRegression(y); assert(params[0].approxEqual(-0.95)); // shift assert(params[1].approxEqual(1)); // slope
See Implementation
A linear regression model with a single explanatory variable.